From 6a866df20eb0ad7c5579dec1612af6e6af772188 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 14 Dec 2018 20:49:12 +0100 Subject: [PATCH 001/326] Added streamwise periodic BC for Momentum equation. Cleanup necessary. --- Common/include/config_structure.hpp | 36 ++++- Common/include/config_structure.inl | 12 ++ Common/src/config_structure.cpp | 32 ++++- Common/src/geometry_structure.cpp | 124 +++++++++++++++++- SU2_CFD/include/numerics_structure.hpp | 33 +++++ SU2_CFD/src/driver_structure.cpp | 2 + SU2_CFD/src/numerics_direct_mean_inc.cpp | 84 ++++++++++++ SU2_CFD/src/output_structure.cpp | 49 ++++++- SU2_CFD/src/solver_direct_mean_inc.cpp | 38 +++++- SU2_CFD/src/solver_structure.cpp | 25 +++- .../poiseuille/lam_poiseuille.cfg | 4 +- 11 files changed, 425 insertions(+), 14 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 6fd4fc8eb511..943d07a8c8f6 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1024,6 +1024,9 @@ class CConfig { su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ + bool Periodic_BC_Body_Force; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ + su2double DeltaP_BodyForce; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + su2double *PeriodicRefNode_BodyForce; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ su2double Max_Vel2; /*!< \brief The maximum velocity^2 in the domain for the incompressible preconditioner. */ @@ -5788,6 +5791,30 @@ class CConfig { */ su2double* GetBody_Force_Vector(void); + /*! + * \brief Get information about the body force. + * \return TRUE if it uses a body force; otherwise FALSE. + */ + bool GetPeriodic_BC_Body_Force(void); + + /*! + * \brief Get a pointer to the pressure delta from which body force vector is computed. + * \return Delta Pressure for body force computation. + */ + su2double GetDeltaP_BodyForce(void); + + /*! + * \brief Get a pointer to the reference node coordinate vector. + * \return A pointer to the reference node coordinate vector. + */ + su2double* GetPeriodicRefNode_BodyForce(void); + + /*! + * \brief Get a pointer to the reference node coordinate vector. + * \return A pointer to the reference node coordinate vector. + */ + void SetPeriodicRefNode_BodyForce(su2double* RefNode, unsigned short nDim); + /*! * \brief Get information about the rotational frame. * \return TRUE if there is a rotational frame; otherwise FALSE. @@ -6190,7 +6217,7 @@ class CConfig { su2double *GetPeriodicRotAngles(string val_marker); /*! - * \brief Translation vector for a rotational periodic boundary. + * \brief Translation vector for a translational periodic boundary. */ su2double *GetPeriodicTranslation(string val_marker); @@ -6373,6 +6400,13 @@ class CConfig { */ su2double* GetPeriodicTranslate(unsigned short val_index); + /*! + * \brief Get the translation vector for a periodic transformation. + * \param[in] val_index - Index corresponding to the periodic transformation. + * \return The translation vector. + */ + su2double* GetPeriodicTranslation(unsigned short val_index); + /*! * \brief Get the total temperature at a nacelle boundary. * \param[in] val_index - Index corresponding to the inlet boundary. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index 80c12c662ccd..bed9d71dddff 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1582,8 +1582,18 @@ inline bool CConfig::GetGravityForce(void) { return GravityForce; } inline bool CConfig::GetBody_Force(void) { return Body_Force; } +inline bool CConfig::GetPeriodic_BC_Body_Force(void) { return Periodic_BC_Body_Force; } + inline su2double* CConfig::GetBody_Force_Vector(void) { return Body_Force_Vector; } +inline su2double CConfig::GetDeltaP_BodyForce(void) { return DeltaP_BodyForce; } + +inline su2double* CConfig::GetPeriodicRefNode_BodyForce(void) { return PeriodicRefNode_BodyForce; } + +inline void CConfig::SetPeriodicRefNode_BodyForce(su2double* RefNode, unsigned short nDim) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) PeriodicRefNode_BodyForce[iDim] = RefNode[iDim]; +} + inline bool CConfig::GetSmoothNumGrid(void) { return SmoothNumGrid; } inline void CConfig::SetSmoothNumGrid(bool val_smoothnumgrid) { SmoothNumGrid = val_smoothnumgrid; } @@ -1626,6 +1636,8 @@ inline su2double** CConfig::GetRotationMatrix(unsigned short val_index) { return inline su2double* CConfig::GetPeriodicTranslate(unsigned short val_index) { return Periodic_Translate[val_index]; } +inline su2double* CConfig::GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } + inline void CConfig::SetPeriodicTranslate(unsigned short val_index, su2double* translate) { for (unsigned short i = 0; i < 3; i++) Periodic_Translate[val_index][i] = translate[i]; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index b1eb5d1a7f51..664b658f7860 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -521,6 +521,8 @@ void CConfig::SetPointersNull(void) { Kind_ObjFunc = NULL; Weight_ObjFunc = NULL; + + PeriodicRefNode_BodyForce = NULL; /*--- Moving mesh pointers ---*/ @@ -707,6 +709,7 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo /*\brief AXISYMMETRIC \n DESCRIPTION: Axisymmetric simulation \n DEFAULT: false \ingroup Config */ addBoolOption("AXISYMMETRIC", Axisymmetric, false); + /* DESCRIPTION: Add the gravity force */ addBoolOption("GRAVITY_FORCE", GravityForce, false); /* DESCRIPTION: Apply a body force as a source term (NO, YES) */ @@ -714,6 +717,12 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo default_body_force[0] = 0.0; default_body_force[1] = 0.0; default_body_force[2] = 0.0; /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ addDoubleArrayOption("BODY_FORCE_VECTOR", 3, Body_Force_Vector, default_body_force); + + /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NO, YES) */ + addBoolOption("PERIODIC_BC_BODY_FORCE", Periodic_BC_Body_Force, false); + /* DESCRIPTION: Delta pressure on which basis body force will be computed */ + addDoubleOption("DELTA_P_BODY_FORCE", DeltaP_BodyForce, 0.0); + /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); /*!\brief BINARY_RESTART \n DESCRIPTION: Read / write binary SU2 native restart files. \n Options: YES, NO \ingroup Config */ @@ -4025,6 +4034,22 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Must list two markers for the pressure drop objective function.\n Expected format: MARKER_ANALYZE= (outlet_name, inlet_name).", CURRENT_FUNCTION); } } + + /*--- Check for Body Force driven case with Periodic Boundary conditions ---*/ + + if ((Periodic_BC_Body_Force == YES) && !(Kind_Regime == INCOMPRESSIBLE)) { + SU2_MPI::Error("Body Force driven Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); + } + cout << "nMarker_PerBound : " << nMarker_PerBound << endl; + if ((Periodic_BC_Body_Force == YES) && !(nMarker_PerBound == 2)) { + SU2_MPI::Error("Body Force driven Periodic BC currently only implemented for one Periodic Boundary pair.", CURRENT_FUNCTION); + } + + /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ + if (Periodic_BC_Body_Force == YES) { + PeriodicRefNode_BodyForce = new su2double[val_nDim]; + } + } @@ -6894,9 +6919,10 @@ CConfig::~CConfig(void) { } if (Rotation_Matrix != NULL) delete [] Rotation_Matrix; - if (MG_CorrecSmooth != NULL) delete[] MG_CorrecSmooth; - if (PlaneTag != NULL) delete[] PlaneTag; - if (CFL != NULL) delete[] CFL; + if (MG_CorrecSmooth != NULL) delete[] MG_CorrecSmooth; + if (PlaneTag != NULL) delete[] PlaneTag; + if (CFL != NULL) delete[] CFL; + if (PeriodicRefNode_BodyForce != NULL) delete[] PeriodicRefNode_BodyForce; /*--- String markers ---*/ diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index 0582f2dc7b47..ab049fe6d2eb 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -15726,7 +15726,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, unsigned short val_period unsigned long *Buffer_Send_nVertex = new unsigned long [1]; unsigned long *Buffer_Receive_nVertex = new unsigned long [nProcessor]; - /*--- Compute the number of vertex that have interfase boundary condition + /*--- Compute the number of vertex that have interface boundary condition without including the ghost nodes ---*/ nLocalVertex_Periodic = 0; @@ -15980,6 +15980,128 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, unsigned short val_period } + + /*--- Compute reference Node for recovered pressure ---*/ + if (config->GetPeriodic_BC_Body_Force() == YES) { + + /*--- Define and initialize helping variables ---*/ + unsigned short iMarker, periodic_recv_Marker, PeriodicInletMarker_PerBound, iPeriodic, iDim; + unsigned long reference_node_id; + su2double PerBoundNodeCoord[nDim]; + su2double norm2_Node = 0.0, norm2_min = 1e300; + for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = 1e300; // init to very high value such that real points can be filtered out later + unsigned short nPeriodic = config->GetnMarker_Periodic(); + unsigned long nNodeOnPBC = 0, iNodeOnPBC; + unsigned long maxNodeOnPBC; // for MPI communication + unsigned long proc_min, node_min; + su2double* Buffer_Send_PBCNodeCoords; + su2double* Buffer_Recv_PBCNodeCoords; + unsigned long* Buffer_Recv_nNodeOnPBC; // vector holding all local nNodeOnPBC + Buffer_Recv_nNodeOnPBC = new unsigned long [size]; + for (int iProc = 0; iProc < size; iProc++) Buffer_Recv_nNodeOnPBC[iProc] = 0; + + /*--- Find an arbitrary(find a metric to get a deterministic solution) node on the PerBound of the Periodic BC, but not on the donor side! ---*/ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { + iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor, 0 if no PBC at all + if (iPeriodic == 1) { // We found a point on a receiver PBC, in + + periodic_recv_Marker = iMarker; + reference_node_id = vertex[iMarker][0]->GetNode(); // just get the first node in the marker + for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = node[reference_node_id]->GetCoord(iDim); + nNodeOnPBC = GetnVertex(iMarker);//Get the number of points on the marker here + + } + } + } + + /*--- Communicate reference node between multiple processes ---*/ + + /*--- Find process with the largest possible nodeset and store array[size] with possible nodes on each rank ---*/ + SU2_MPI::Allreduce(&nNodeOnPBC, &maxNodeOnPBC, 1, MPI_UNSIGNED_LONG, + MPI_MAX, MPI_COMM_WORLD); + cout << "maxNodeOnPBC: " << maxNodeOnPBC << " , rank: " << rank << endl; + + SU2_MPI::Allgather(&nNodeOnPBC, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nNodeOnPBC, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + if (rank == MASTER_NODE) { + for (int iProc = 0; iProc < size; iProc++) { + cout << "Buffer_Recv_nNodeOnPBC[iProc]: " << Buffer_Recv_nNodeOnPBC[iProc] << endl; + } + } + + /*--- Define send buffer ---*/ + Buffer_Send_PBCNodeCoords = new su2double[maxNodeOnPBC*nDim]; + /*--- Fill send buffer with coords ---*/ + + /*--- Find an arbitrary(find a metric to get a deterministic solution) node on the PerBound of the Periodic BC, but not on the donor side! ---*/ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { + iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor, 0 if no PBC at all + if (iPeriodic == 1) { // We found a point on a receiver PBC, in + + periodic_recv_Marker = iMarker; + //reference_node_id = vertex[iMarker][0]->GetNode(); // just get the first node in the marker + for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = node[reference_node_id]->GetCoord(iDim); + nNodeOnPBC = GetnVertex(iMarker);//Get the number of points on the marker here + + for (iNodeOnPBC = 0; iNodeOnPBC < nNodeOnPBC; iNodeOnPBC++) { + for (iDim = 0; iDimGetNode()]->GetCoord(iDim); + } + } + + } + } + } + + /*--- Allocate receive Buffer ---*/ + Buffer_Recv_PBCNodeCoords = new su2double[maxNodeOnPBC*nDim*size]; + + SU2_MPI::Allgather(Buffer_Send_PBCNodeCoords, nDim*maxNodeOnPBC, MPI_DOUBLE, Buffer_Recv_PBCNodeCoords, nDim*maxNodeOnPBC, MPI_DOUBLE, MPI_COMM_WORLD); + + proc_min = 0; + node_min = 0; + /*--- Every processor determines the reference node itself, as all possible nodes were communicated ---*/ + for (int iProc = 0; iProc < size; iProc++) { + for (iNodeOnPBC = 0; iNodeOnPBC < Buffer_Recv_nNodeOnPBC[iProc]; iNodeOnPBC++) { + for (iDim = 0; iDim < nDim; iDim++) { + norm2_Node += pow(Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*iProc + nDim*iNodeOnPBC + iDim],2); + if (rank == MASTER_NODE) { + cout << "maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim: " << maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim << endl; + cout << "Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim]: " << Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*iProc + nDim*iNodeOnPBC + iDim] << endl; + } + } + if (sqrt(norm2_Node) < norm2_min) { //Codi? + norm2_min = norm2_Node; + proc_min = iProc; + node_min = iNodeOnPBC; + } + norm2_Node = 0.0; + } + } + + /*--- Set coordinates of reference node ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + PerBoundNodeCoord[iDim] = Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*proc_min + nDim*node_min + iDim]; + } + + // tmp print the reference node + for (iDim = 0; iDim < nDim; iDim++) { + cout << "Reference Node: " << PerBoundNodeCoord[iDim] << " "; + } + cout << endl; + + /*--- Set the reference node, used in output_structure.cpp ---*/ + config->SetPeriodicRefNode_BodyForce(PerBoundNodeCoord, nDim); + + /*--- Deallocate ---*/ + delete[] Buffer_Send_PBCNodeCoords; + delete[] Buffer_Recv_PBCNodeCoords; + delete[] Buffer_Recv_nNodeOnPBC; + } + } void CPhysicalGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp index 36e2ccfc28d8..7114d4ebf62f 100644 --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5055,6 +5055,39 @@ class CSourceIncBodyForce : public CNumerics { }; +/*! + * \class CSourceIncPeriodicBodyForce + * \brief Class for the source term integration of a body force in the incompressible solver. Used for periodic BC. + * \ingroup SourceDiscr + * \author T. Economon + * \version 6.1.0 "Falcon" + */ +class CSourceIncPeriodicBodyForce : public CNumerics { + su2double *Body_Force_Vector; + +public: + + /*! + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of variables of the problem. + * \param[in] config - Definition of the particular problem. + */ + CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config); + + /*! + * \brief Destructor of the class. + */ + ~CSourceIncPeriodicBodyForce(void); + + /*! + * \brief Source term integration for a body force. + * \param[out] val_residual - Pointer to the residual vector. + * \param[in] config - Definition of the particular problem. + */ + void ComputeResidual(su2double *val_residual, CConfig *config); + +}; + /*! * \class CSourceBoussinesq * \brief Class for the source term integration of the Boussinesq approximation for incompressible flow. diff --git a/SU2_CFD/src/driver_structure.cpp b/SU2_CFD/src/driver_structure.cpp index 69a17ce10d0e..7f02f8e4b207 100644 --- a/SU2_CFD/src/driver_structure.cpp +++ b/SU2_CFD/src/driver_structure.cpp @@ -2221,6 +2221,8 @@ void CDriver::Numerics_Preprocessing(CNumerics *****numerics_container, if (config->GetBody_Force() == YES) if (incompressible) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBodyForce(nDim, nVar_Flow, config); + else if (config->GetPeriodic_BC_Body_Force() == YES) + if (incompressible) {if (rank == MASTER_NODE) cout << "Driver init of CSourceIncPeriodicBodyForce." << endl; numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncPeriodicBodyForce(nDim, nVar_Flow, config);}// Currently not implemented for compressible flow else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBoussinesq(nDim, nVar_Flow, config); else if (config->GetRotating_Frame() == YES) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 142eb2e381ee..18f64cde009b 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -889,6 +889,90 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf } +CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { + + /*--- Store the pointer to the constant body force vector. ---*/ + + su2double DeltaP_BodyForce = config->GetDeltaP_BodyForce(); + //bool energy = config->GetEnergy_Equation(); // to be changed + //if (energy) su2double Temperature_Source_Periodic = config->GetTemperature_Source_Periodic(); + Body_Force_Vector = new su2double[nDim]; + su2double norm2_PBtranslate = 0.0; + + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + if (config->GetPeriodicTranslation(0)[iDim] == 0) { + Body_Force_Vector[iDim] = 0.0; + } else { + Body_Force_Vector[iDim] = DeltaP_BodyForce/config->GetPeriodicTranslation(0)[iDim]; // wrong + for (iDim = 0; iDim < nDim; iDim++) + norm2_PBtranslate =+ pow(config->GetPeriodicTranslation(0)[iDim],2); + Body_Force_Vector[iDim] = DeltaP_BodyForce/norm2_PBtranslate*config->GetPeriodicTranslation(0)[iDim]; + } + } + + cout << "Body force vector based on delta p: [ "; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + cout << Body_Force_Vector[iDim] << " "; + } + cout << " ]" << endl; +} + +CSourceIncPeriodicBodyForce::~CSourceIncPeriodicBodyForce(void) { + + if (Body_Force_Vector != NULL) delete [] Body_Force_Vector; + +} + +void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConfig *config) { + + unsigned short iDim; + su2double DensityInc_0 = 0.0; + su2double Force_Ref = config->GetForce_Ref(); + su2double Temperature_Ref = config->GetTemperature_Ref(); + bool energy = config->GetEnergy_Equation(); + bool variable_density = (config->GetKind_DensityModel() == VARIABLE); + su2double C_p = V_i[nDim+7]; + su2double Velocity[nDim]; + + for (iDim = 0; iDim < nDim; iDim++) + Velocity[iDim] = V_i[iDim+1]; + + su2double Delta_T = 10.0; + su2double norm_translation = 0.0; + + /*--- Check for variable density. If we have a variable density + problem, we should subtract out the hydrostatic pressure component. ---*/ + + if (variable_density) DensityInc_0 = config->GetDensity_FreeStreamND(); + + /*--- Zero the continuity contribution ---*/ + + val_residual[0] = 0.0; + + /*--- Momentum contribution. Note that this form assumes we have + subtracted the operating density * gravity, i.e., removed the + hydrostatic pressure component (important for pressure BCs). ---*/ + + for (iDim = 0; iDim < nDim; iDim++) + val_residual[iDim+1] = -Volume * (DensityInc_i - DensityInc_0) * Body_Force_Vector[iDim] / Force_Ref; // check if pres_ref is the same as force ref + + /*--- Zero the temperature contribution ---*/ + + for (iDim = 0; iDim < nDim; iDim++) { + norm_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + } + norm_translation = sqrt(norm_translation); + + + if (energy) { + for (iDim = 0; iDim < nDim; iDim++) { + val_residual[nDim+1] = Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim] * Volume * (DensityInc_i - DensityInc_0) * Delta_T * DensityInc_i * C_p / pow(norm_translation,2) / Temperature_Ref; // maybe make it class var + } + } + else val_residual[nDim+1] = 0.0; + +} + CSourceBoussinesq::CSourceBoussinesq(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { /*--- Store the pointer to the constant body force vector. ---*/ diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp index 06d2be0b11c3..a5c427edd429 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -13292,6 +13292,15 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } + if (config->GetPeriodic_BC_Body_Force()) { + + nVar_Par += 1; + Variable_Names.push_back("Recovered_pressure"); + + nVar_Par += 1; + Variable_Names.push_back("rank"); + } + } /*--- Auxiliary vectors for variables defined on surfaces only. ---*/ @@ -13586,8 +13595,44 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve Local_Data[jPoint][iVar] = sqrt(pow(p-solDOF[0],2.0)); iVar++; } + + /*--- Compute the recovered pressure levels if reduced pressure + * was computed for a delta p driven periodic BC case. + * p_rec = p_red - delta p * (t dot (r-x*))/norm(t)^2 where + * p_rec : recovered pressure (which we compute here) + * p_red : reduced pressure from the computation + * delta p : prescribed pressure drop + * t : translation vector given in marker_periodic + * x* : point on "inlet" marker which is the furthest in negative t-direction + * r : position vector of any point in the domain ---*/ + + if (config->GetPeriodic_BC_Body_Force() == YES) { + + /*--- Define and initialize helping variables ---*/ + su2double norm2_translation_vector; + su2double dot_product; + su2double PerBoundNodeCoord[nDim]; + + for (iDim = 0; iDim < nDim; iDim++) + PerBoundNodeCoord[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + + /*--- First, set recovered to reduced pressure ---*/ + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSolution(0); + + /*--- Compute correction based on relative distance (0,l) between periodic markers ---*/ + dot_product = 0.0; + norm2_translation_vector = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; + norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? + } + + /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ + Local_Data[jPoint][iVar] -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; iVar++; + Local_Data[jPoint][iVar] = rank; iVar++; + } //body force bracket - } + } //low memory output bracket /*--- Increment the point counter, as there may have been halos we skipped over during the data loading. ---*/ @@ -13998,7 +14043,7 @@ void COutput::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolve /*--- New variables can be loaded to the Local_Data structure here, assuming they were registered above correctly. ---*/ - + } /*--- Increment the point counter, as there may have been halos we diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index ab55b02dee7c..58e2a0e3ff7f 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -3007,6 +3007,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool rotating_frame = config->GetRotating_Frame(); bool axisymmetric = config->GetAxisymmetric(); bool body_force = config->GetBody_Force(); + bool periodic_bc_body_force = config->GetPeriodic_BC_Body_Force(); bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); bool viscous = config->GetViscous(); @@ -3015,7 +3016,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - if (body_force) { + if (body_force || periodic_bc_body_force) { /*--- Loop over all points ---*/ @@ -3025,7 +3026,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->SetConservative(node[iPoint]->GetSolution(), node[iPoint]->GetSolution()); - + + numerics->SetPrimitive(node[iPoint]->GetPrimitive(), NULL); + /*--- Set incompressible density ---*/ numerics->SetDensity(node[iPoint]->GetDensity(), @@ -5066,19 +5069,46 @@ void CIncEulerSolver::SetInletAtVertex(su2double *val_inlet, unsigned short P_position = nDim+1; unsigned short FlowDir_position = nDim+2; + /*--- Make directions be a unit vector and extract magnitude to its field ---*/ + su2double norm = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + norm += pow(val_inlet[FlowDir_position + iDim], 2); + } + norm = sqrt(norm); + if (abs(norm - 1.0) > 1e-6) { + cout << "Sanitized inlet such that flow direction is a unit vector." << endl; + cout << "Magnitude is copied to its respective column." << endl; + + val_inlet[P_position] = norm; + if (norm > 1e-10){ + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + val_inlet[FlowDir_position + iDim] /= norm; + } + } else { + val_inlet[FlowDir_position + 0] = 1.0; // wall node is all zero, set first direction to 1 such that we have a unit vector + } + cout << val_inlet[P_position] << " "; + cout << val_inlet[FlowDir_position + 0] << " "; + cout << val_inlet[FlowDir_position + 1] << " " ; + + } + /*--- Check that the norm of the flow unit vector is actually 1 ---*/ - su2double norm = 0.0; + norm = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) { norm += pow(val_inlet[FlowDir_position + iDim], 2); } norm = sqrt(norm); + cout << norm << " "; + cout << endl; + /*--- The tolerance here needs to be loose. When adding a very * small number (1e-10 or smaller) to a number close to 1.0, floating * point roundoff errors can occur. ---*/ - if (abs(norm - 1.0) > 1e-6) { + if (abs(norm - 1.0) > 1e-5) { ostringstream error_msg; error_msg << "ERROR: Found these values in columns "; error_msg << FlowDir_position << " - "; diff --git a/SU2_CFD/src/solver_structure.cpp b/SU2_CFD/src/solver_structure.cpp index 7d8a6742c3b6..74b5b572b96f 100644 --- a/SU2_CFD/src/solver_structure.cpp +++ b/SU2_CFD/src/solver_structure.cpp @@ -3436,7 +3436,30 @@ void CSolver::LoadInletProfile(CGeometry **geometry, /*--- Set the bit to write a template inlet profile file. ---*/ config->SetWrt_InletFile(true); - + + //// Here I need to force output because the nodes get overwritten below!S + //// This was in COutput::SetResult_Files_Parallel(CSolver *****solver_container, + ////CGeometry ****geometry, + ////CConfig **config, + ////unsigned long iExtIter, + ////unsigned short val_nZone, + ////unsigned short *nInst) { + //////CGeometry **geometry, + //////CSolver ***solver, + //////CConfig *config, + //////int val_iter, + //////unsigned short val_kind_solver, + //////unsigned short val_kind_marker) { + //if (config->GetWrt_InletFile()) { + //output->MergeInletCoordinates(config, geometry[MESH_0]); + + //if (rank == MASTER_NODE) { + //Write_InletFile_Flow(config, geometry[MESH_0], solver[MESH_0]); + //DeallocateInletCoordinates(config, geometry[MESH_0]); + //} + //config->SetWrt_InletFile(false); + //} + //int i;cout << "Waiting!"<< endl; cin >> i; //wait here /*--- Set the mean flow inlets to uniform. ---*/ for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index 27057925d899..2333dd262740 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -23,7 +23,7 @@ KIND_TURB_MODEL= NONE MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) -RESTART_SOL= YES +RESTART_SOL= NO % % Write binary restart files (YES, NO) WRT_BINARY_RESTART= NO @@ -202,7 +202,7 @@ CONV_CRITERIA= RESIDUAL RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number STARTCONV_ITER= 10 From f3ef0051f5bb58250a5c6d6a89c9aa2128a9283b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 14 Dec 2018 21:39:26 +0100 Subject: [PATCH 002/326] Periodic Preproccing base implementation (unfinished). --- SU2_CFD/include/solver_structure.hpp | 11 ++ SU2_CFD/include/solver_structure.inl | 2 + SU2_CFD/src/solver_direct_mean_inc.cpp | 219 +++++++++++++++++++++++++ 3 files changed, 232 insertions(+) diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp index 6912244dd843..0243d404b6a0 100644 --- a/SU2_CFD/include/solver_structure.hpp +++ b/SU2_CFD/include/solver_structure.hpp @@ -2159,6 +2159,11 @@ class CSolver { * \brief A virtual member. */ virtual void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + + /*! + * \brief A virtual member. + */ + virtual void GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); /*! * \brief A virtual member. @@ -8681,6 +8686,12 @@ class CIncEulerSolver : public CSolver { */ void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + /*! + * \brief A virtual member. - add documentaiton + */ + void GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + + }; /*! diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl index 9bb513453229..3676f352c9dd 100644 --- a/SU2_CFD/include/solver_structure.inl +++ b/SU2_CFD/include/solver_structure.inl @@ -829,6 +829,8 @@ inline void CSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, u inline void CSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } +inline void CSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } + inline void CSolver::GetEllipticSpanLoad_Diff(CGeometry *geometry, CConfig *config) { } inline void CSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 0ec82052d90b..f5b4fa2c62f8 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2574,6 +2574,10 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai /*--- Compute properties needed for mass flow BCs. ---*/ if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); + + /*--- ---*/ + + if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); /*--- Initialize the Jacobian matrices ---*/ @@ -10745,6 +10749,217 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } +void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { + + unsigned short iDim, iMarker; + unsigned long iVertex, iPoint; + su2double *V_outlet = NULL, Pressure, Temperature, Velocity[3], MassFlow, + Velocity2, Density, Area, Vel_Infty2, AxiFactor; + unsigned short iMarker_Outlet, nMarker_Outlet; + string Inlet_TagBound, Outlet_TagBound; + + bool axisymmetric = config->GetAxisymmetric(); + + bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) + && (config->GetExtIter()!= 0)) + || (config->GetExtIter() == 1)); + + /*--- Get the number of outlet markers and check for any mass flow BCs. ---*/ + + nMarker_Outlet = config->GetnMarker_Periodic(); + bool Evaluate_BC = true; + + /*--- If we have a massflow outlet BC, then we need to compute and + communicate the total massflow, density, and area through each outlet + boundary, so that it can be used in the iterative procedure to update + the back pressure until we converge to the desired mass flow. This + routine is called only once per iteration as a preprocessing and the + values for all outlets are stored and retrieved later in the BC_Outlet + routines. ---*/ + + if (Evaluate_BC) { + + su2double *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; + su2double *Outlet_Density = new su2double[config->GetnMarker_All()]; + su2double *Outlet_Area = new su2double[config->GetnMarker_All()]; + + /*--- Comute MassFlow, average temp, press, etc. ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + Outlet_MassFlow[iMarker] = 0.0; + Outlet_Density[iMarker] = 0.0; + Outlet_Area[iMarker] = 0.0; + + if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) ) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + + V_outlet = node[iPoint]->GetPrimitive(); + + geometry->vertex[iMarker][iVertex]->GetNormal(Vector); + + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + Temperature = V_outlet[nDim+1]; + Pressure = V_outlet[0]; + Density = V_outlet[nDim+2]; + + Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; + + for (iDim = 0; iDim < nDim; iDim++) { + Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); + Velocity[iDim] = V_outlet[iDim+1]; + Velocity2 += Velocity[iDim] * Velocity[iDim]; + MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; + } + Area = sqrt (Area); + + Outlet_MassFlow[iMarker] += MassFlow; + Outlet_Density[iMarker] += Density*Area; + Outlet_Area[iMarker] += Area; + + } + } + } + } + + /*--- Copy to the appropriate structure ---*/ + + su2double *Outlet_MassFlow_Local = new su2double[nMarker_Outlet]; + su2double *Outlet_Density_Local = new su2double[nMarker_Outlet]; + su2double *Outlet_Area_Local = new su2double[nMarker_Outlet]; + + su2double *Outlet_MassFlow_Total = new su2double[nMarker_Outlet]; + su2double *Outlet_Density_Total = new su2double[nMarker_Outlet]; + su2double *Outlet_Area_Total = new su2double[nMarker_Outlet]; + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; + Outlet_Density_Local[iMarker_Outlet] = 0.0; + Outlet_Area_Local[iMarker_Outlet] = 0.0; + + Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; + Outlet_Density_Total[iMarker_Outlet] = 0.0; + Outlet_Area_Total[iMarker_Outlet] = 0.0; + } + + /*--- Copy the values to the local array for MPI ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY)) { + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_TagBound = config->GetMarker_PerBound(iMarker_Outlet); + if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { + Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; + Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; + Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; + } + } + } + } + + /*--- All the ranks to compute the total value ---*/ + +#ifdef HAVE_MPI + + SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + +#else + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; + Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; + Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; + } + +#endif + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { + Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; + } + else { + Outlet_Density_Total[iMarker_Outlet] = 0.0; + } + + if (iMesh == MESH_0) { + config->SetOutlet_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); + config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); + config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); + } + } + + /*--- Screen output using the values already stored in the config container ---*/ + + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { + + cout.precision(5); + cout.setf(ios::fixed, ios::floatfield); + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { + cout << endl << "---------------------------- Outlet properties --------------------------" << endl; + } + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_TagBound = config->GetMarker_Outlet_TagBound(iMarker_Outlet); + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { + + /*--- Geometry defintion ---*/ + + cout <<"Outlet surface: " << Outlet_TagBound << "." << endl; + + if ((nDim ==3) || axisymmetric) { + cout <<"Area (m^2): " << config->GetOutlet_Area(Outlet_TagBound) << endl; + } + if (nDim == 2) { + cout <<"Length (m): " << config->GetOutlet_Area(Outlet_TagBound) << "." << endl; + } + + cout << setprecision(5) << "Outlet Avg. Density (kg/m^3): " << config->GetOutlet_Density(Outlet_TagBound) * config->GetDensity_Ref() << endl; + su2double Outlet_mDot = fabs(config->GetOutlet_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); + cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot; + + } + } + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; + cout << "-------------------------------------------------------------------------" << endl << endl; + } + + cout.unsetf(ios_base::floatfield); + + } + + delete [] Outlet_MassFlow_Local; + delete [] Outlet_Density_Local; + delete [] Outlet_Area_Local; + + delete [] Outlet_MassFlow_Total; + delete [] Outlet_Density_Total; + delete [] Outlet_Area_Total; + + delete [] Outlet_MassFlow; + delete [] Outlet_Density; + delete [] Outlet_Area; + + } + +} + void CIncEulerSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ unsigned short iVar; @@ -11802,6 +12017,10 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); + /*--- ---*/ + + if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); + /*--- Evaluate the vorticity and strain rate magnitude ---*/ StrainMag_Max = 0.0; Omega_Max = 0.0; From 07655a896ba0fa8f94507a519187a7728110116e Mon Sep 17 00:00:00 2001 From: "Thomas D. Economon" Date: Fri, 14 Dec 2018 13:19:31 -0800 Subject: [PATCH 003/326] Strings for periodic marker and heat flux calc. --- Common/include/config_structure.hpp | 8 ++ Common/include/config_structure.inl | 2 + SU2_CFD/src/solver_direct_mean_inc.cpp | 166 ++++++++++++++++++++++++- 3 files changed, 174 insertions(+), 2 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index a4b12260a8d2..a34a1629af0d 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -3300,6 +3300,14 @@ class CConfig { */ string GetMarker_Outlet_TagBound(unsigned short val_marker); + /*! + * \brief Get the index of the periodic surface defined in the geometry file. + * \param[in] val_marker - Value of the marker in which we are interested. + * \return Value of the index that is in the geometry file for the surface that + * has the marker val_marker. + */ + string GetMarker_Periodic_TagBound(unsigned short val_marker); + /*! * \brief Get the index of the surface defined in the geometry file. * \param[in] val_marker - Value of the marker in which we are interested. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index e2afaffbf59e..1b8e454b8c87 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1317,6 +1317,8 @@ inline string CConfig::GetMarker_ActDiskOutlet_TagBound(unsigned short val_marke inline string CConfig::GetMarker_Outlet_TagBound(unsigned short val_marker) { return Marker_Outlet[val_marker]; } +inline string CConfig::GetMarker_Periodic_TagBound(unsigned short val_marker) { return Marker_PerBound[val_marker]; } + inline string CConfig::GetMarker_EngineInflow_TagBound(unsigned short val_marker) { return Marker_EngineInflow[val_marker]; } inline string CConfig::GetMarker_EngineExhaust_TagBound(unsigned short val_marker) { return Marker_EngineExhaust[val_marker]; } diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index f5b4fa2c62f8..241308dbba55 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -10860,7 +10860,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY)) { for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_PerBound(iMarker_Outlet); + Outlet_TagBound = config->GetMarker_Periodic_TagBound(iMarker_Outlet); + cout << Outlet_TagBound << endl; if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; @@ -10915,7 +10916,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_Outlet_TagBound(iMarker_Outlet); + Outlet_TagBound = config->GetMarker_Periodic_TagBound(iMarker_Outlet); if (write_heads && Output && !config->GetDiscrete_Adjoint()) { /*--- Geometry defintion ---*/ @@ -10944,6 +10945,167 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } + + // BEGIN HEAT FLUX LOOP + + nMarker_Outlet = config->GetnMarker_HeatFlux(); + + + /*--- Comute MassFlow, average temp, press, etc. ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + Outlet_MassFlow[iMarker] = 0.0; + Outlet_Density[iMarker] = 0.0; + Outlet_Area[iMarker] = 0.0; + + if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + + V_outlet = node[iPoint]->GetPrimitive(); + + geometry->vertex[iMarker][iVertex]->GetNormal(Vector); + + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + Temperature = V_outlet[nDim+1]; + Pressure = V_outlet[0]; + Density = V_outlet[nDim+2]; + + /*--- Identify the boundary by string name ---*/ + + string Marker_Tag = config->GetMarker_All_TagBound(iMarker); + + /*--- Get the specified wall heat flux from config ---*/ + + su2double Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + + Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; + + for (iDim = 0; iDim < nDim; iDim++) { + Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); + Velocity[iDim] = V_outlet[iDim+1]; + Velocity2 += Velocity[iDim] * Velocity[iDim]; + MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; + } + Area = sqrt (Area); + + Outlet_MassFlow[iMarker] += MassFlow; + Outlet_Density[iMarker] += Wall_HeatFlux*Area; + Outlet_Area[iMarker] += Area; + + } + } + } + } + + /*--- Copy to the appropriate structure ---*/ + + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; + Outlet_Density_Local[iMarker_Outlet] = 0.0; + Outlet_Area_Local[iMarker_Outlet] = 0.0; + + Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; + Outlet_Density_Total[iMarker_Outlet] = 0.0; + Outlet_Area_Total[iMarker_Outlet] = 0.0; + } + + /*--- Copy the values to the local array for MPI ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX)) { + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_TagBound = config->GetMarker_HeatFlux_TagBound(iMarker_Outlet); + cout << Outlet_TagBound << endl; + if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { + Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; + Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; + Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; + } + } + } + } + + /*--- All the ranks to compute the total value ---*/ + +#ifdef HAVE_MPI + + SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + +#else + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; + Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; + Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; + } + +#endif + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + + if (iMesh == MESH_0) { + config->SetOutlet_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); + config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); + config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); + } + } + + /*--- Screen output using the values already stored in the config container ---*/ + + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { + + cout.precision(5); + cout.setf(ios::fixed, ios::floatfield); + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { + cout << endl << "---------------------------- Outlet properties --------------------------" << endl; + } + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { + Outlet_TagBound = config->GetMarker_HeatFlux_TagBound(iMarker_Outlet); + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { + + /*--- Geometry defintion ---*/ + + cout <<"Heat flux surface: " << Outlet_TagBound << "." << endl; + + if ((nDim ==3) || axisymmetric) { + cout <<"Area (m^2): " << config->GetOutlet_Area(Outlet_TagBound) << endl; + } + if (nDim == 2) { + cout <<"Length (m): " << config->GetOutlet_Area(Outlet_TagBound) << "." << endl; + } + + cout << setprecision(5) << scientific << "Q on surface: " << config->GetOutlet_Density(Outlet_TagBound) << endl; + } + } + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; + cout << "-------------------------------------------------------------------------" << endl << endl; + } + + cout.unsetf(ios_base::floatfield); + + } + + delete [] Outlet_MassFlow_Local; delete [] Outlet_Density_Local; delete [] Outlet_Area_Local; From 252886886c7972c2883a8c871c514faaa280a25b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 15 Dec 2018 04:05:57 +0100 Subject: [PATCH 004/326] Streamwise periodic Temperature updates. --- Common/include/config_structure.hpp | 47 ++++++++++++- Common/include/config_structure.inl | 8 +++ Common/src/config_structure.cpp | 31 +++++++++ SU2_CFD/src/numerics_direct_mean_inc.cpp | 11 +-- SU2_CFD/src/output_structure.cpp | 13 +++- SU2_CFD/src/solver_direct_mean_inc.cpp | 88 ++++++++++++++++-------- 6 files changed, 164 insertions(+), 34 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index a34a1629af0d..6057ba6ec38d 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -359,6 +359,9 @@ class CConfig { su2double *Outlet_MassFlow; /*!< \brief Mass flow for outlet boundaries. */ su2double *Outlet_Density; /*!< \brief Avg. density for outlet boundaries. */ su2double *Outlet_Area; /*!< \brief Area for outlet boundaries. */ + su2double *Periodic_Heatflux; /*!< \brief Area for outlet boundaries. */ + su2double *Periodic_MassFlow; /*!< \brief Mass flow for outlet boundaries. */ + su2double Heatflux_Integrated; /*!< \brief Heatflux integrated over all nonyero heatflux boundaries. */ su2double *Surface_MassFlow; /*!< \brief Massflow at the boundaries. */ su2double *Surface_Mach; /*!< \brief Mach number at the boundaries. */ su2double *Surface_Temperature; /*!< \brief Temperature at the boundaries. */ @@ -3002,7 +3005,7 @@ class CConfig { unsigned short GetnMarker_Periodic(void); /*! - * \brief Get the total number of heat flux markers. + * \brief Get the total number of heat flux markers. (per partition or globally) * \return Total number of heat flux markers. */ unsigned short GetnMarker_HeatFlux(void); @@ -7434,6 +7437,20 @@ class CConfig { */ void SetOutlet_MassFlow(unsigned short val_imarker, su2double val_massflow); + /*! + * \brief Get the back pressure (static) at an outlet boundary. + * \param[in] val_index - Index corresponding to the outlet boundary. + * \return The outlet pressure. + */ + su2double GetPeriodic_MassFlow(string val_marker); + + /*! + * \brief Get the back pressure (static) at an outlet boundary. + * \param[in] val_index - Index corresponding to the outlet boundary. + * \return The outlet pressure. + */ + void SetPeriodic_MassFlow(unsigned short val_imarker, su2double val_massflow); + /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. @@ -7461,7 +7478,35 @@ class CConfig { * \return The outlet pressure. */ void SetOutlet_Area(unsigned short val_imarker, su2double val_area); + + /*! + * \brief Get the back pressure (static) at an outlet boundary. + * \param[in] val_index - Index corresponding to the outlet boundary. + * \return The outlet pressure. + */ + su2double GetPeriodic_Heatflux(string val_marker); + /*! + * \brief Get the back pressure (static) at an outlet boundary. + * \param[in] val_index - Index corresponding to the outlet boundary. + * \return The outlet pressure. + */ + void SetPeriodic_Heatflux(unsigned short val_imarker, su2double val_heatflux); + + /*! + * \brief + * \param[in] + * \return + */ + su2double GetPeriodic_HeatfluxIntegrated(); + + /*! + * \brief + * \param[in] + * \return + */ + void SetPeriodic_HeatfluxIntegrated(su2double IntegratedHeatflux); + /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index 1b8e454b8c87..78517be9e6a7 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -107,10 +107,18 @@ inline void CConfig::SetActDisk_Force(unsigned short val_imarker, su2double val_ inline void CConfig::SetOutlet_MassFlow(unsigned short val_imarker, su2double val_massflow) { Outlet_MassFlow[val_imarker] = val_massflow; } +inline void CConfig::SetPeriodic_MassFlow(unsigned short val_imarker, su2double val_massflow) { Periodic_MassFlow[val_imarker] = val_massflow; } + inline void CConfig::SetOutlet_Density(unsigned short val_imarker, su2double val_density) { Outlet_Density[val_imarker] = val_density; } inline void CConfig::SetOutlet_Area(unsigned short val_imarker, su2double val_area) { Outlet_Area[val_imarker] = val_area; } +inline void CConfig::SetPeriodic_Heatflux(unsigned short val_imarker, su2double val_heatflux) { Periodic_Heatflux[val_imarker] = val_heatflux; } + +inline void CConfig::SetPeriodic_HeatfluxIntegrated(su2double HeatfluxIntegrated) { Heatflux_Integrated = HeatfluxIntegrated; } + +inline su2double CConfig::GetPeriodic_HeatfluxIntegrated() { return Heatflux_Integrated; } + inline void CConfig::SetSurface_DC60(unsigned short val_imarker, su2double val_surface_distortion) { Surface_DC60[val_imarker] = val_surface_distortion; } inline void CConfig::SetSurface_MassFlow(unsigned short val_imarker, su2double val_surface_massflow) { Surface_MassFlow[val_imarker] = val_surface_massflow; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index 4954bb5822bf..a21e6080a337 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -480,6 +480,7 @@ void CConfig::SetPointersNull(void) { Surface_DC60 = NULL; Surface_IDC = NULL; Outlet_MassFlow = NULL; Outlet_Density = NULL; Outlet_Area = NULL; + Periodic_MassFlow = NULL; Periodic_Heatflux = NULL; Surface_Uniformity = NULL; Surface_SecondaryStrength = NULL; Surface_SecondOverUniform = NULL; Surface_MomentumDistortion = NULL; @@ -4516,7 +4517,17 @@ void CConfig::SetMarkers(unsigned short val_software) { Outlet_Density[iMarker_Outlet] = 0.0; Outlet_Area[iMarker_Outlet] = 0.0; } + + Periodic_MassFlow = new su2double[nMarker_PerBound]; + Periodic_Heatflux = new su2double[nMarker_HeatFlux]; + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_PerBound; iMarker_Outlet++) { + Periodic_MassFlow[iMarker_Outlet] = 0.0; + } + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_HeatFlux; iMarker_Outlet++) { + Periodic_Heatflux[iMarker_Outlet] = 0.0; + } + for (iMarker_NearFieldBound = 0; iMarker_NearFieldBound < nMarker_NearFieldBound; iMarker_NearFieldBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_NearFieldBound[iMarker_NearFieldBound]; Marker_CfgFile_KindBC[iMarker_CfgFile] = NEARFIELD_BOUNDARY; @@ -7042,6 +7053,12 @@ CConfig::~CConfig(void) { if (ActDisk_Area != NULL) delete[] ActDisk_Area; if (ActDisk_ReverseMassFlow != NULL) delete[] ActDisk_ReverseMassFlow; + if (Outlet_Area != NULL) delete[] Outlet_Area; + if (Outlet_Density != NULL) delete[] Outlet_Density; + if (Outlet_MassFlow != NULL) delete[] Outlet_MassFlow; + if (Periodic_MassFlow != NULL) delete[] Periodic_MassFlow; + if (Periodic_Heatflux != NULL) delete[] Periodic_Heatflux; + if (Surface_MassFlow != NULL) delete[] Surface_MassFlow; if (Surface_Mach != NULL) delete[] Surface_Mach; if (Surface_Temperature != NULL) delete[] Surface_Temperature; @@ -7740,6 +7757,13 @@ su2double CConfig::GetOutlet_MassFlow(string val_marker) { return Outlet_MassFlow[iMarker_Outlet]; } +su2double CConfig::GetPeriodic_MassFlow(string val_marker) { + unsigned short iMarker_Outlet; + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_PerBound; iMarker_Outlet++) + if ((Marker_PerBound[iMarker_Outlet] == val_marker)) break; + return Periodic_MassFlow[iMarker_Outlet]; +} + su2double CConfig::GetOutlet_Density(string val_marker) { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) @@ -7754,6 +7778,13 @@ su2double CConfig::GetOutlet_Area(string val_marker) { return Outlet_Area[iMarker_Outlet]; } +su2double CConfig::GetPeriodic_Heatflux(string val_marker) { + unsigned short iMarker_Outlet; + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_HeatFlux; iMarker_Outlet++) + if ((Marker_HeatFlux[iMarker_Outlet] == val_marker)) break; + return Periodic_Heatflux[iMarker_Outlet]; +} + unsigned short CConfig::GetMarker_CfgFile_ActDiskOutlet(string val_marker) { unsigned short iMarker_ActDisk, kMarker_All; diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 18f64cde009b..0164f3bfab3a 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -927,7 +927,7 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf unsigned short iDim; su2double DensityInc_0 = 0.0; - su2double Force_Ref = config->GetForce_Ref(); + su2double Pressure_Ref = config->GetPressure_Ref(); // check if pressure and force ref are the same su2double Temperature_Ref = config->GetTemperature_Ref(); bool energy = config->GetEnergy_Equation(); bool variable_density = (config->GetKind_DensityModel() == VARIABLE); @@ -943,7 +943,7 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf /*--- Check for variable density. If we have a variable density problem, we should subtract out the hydrostatic pressure component. ---*/ - if (variable_density) DensityInc_0 = config->GetDensity_FreeStreamND(); + //if (variable_density) DensityInc_0 = config->GetDensity_FreeStreamND(); <- think about that /*--- Zero the continuity contribution ---*/ @@ -954,7 +954,7 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf hydrostatic pressure component (important for pressure BCs). ---*/ for (iDim = 0; iDim < nDim; iDim++) - val_residual[iDim+1] = -Volume * (DensityInc_i - DensityInc_0) * Body_Force_Vector[iDim] / Force_Ref; // check if pres_ref is the same as force ref + val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim] / Pressure_Ref; // check if pres_ref is the same as force ref /*--- Zero the temperature contribution ---*/ @@ -965,8 +965,11 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf if (energy) { + + su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / config->GetPeriodic_MassFlow("outlet") / pow(norm_translation,2); // HARDCODED inlet !!!! + for (iDim = 0; iDim < nDim; iDim++) { - val_residual[nDim+1] = Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim] * Volume * (DensityInc_i - DensityInc_0) * Delta_T * DensityInc_i * C_p / pow(norm_translation,2) / Temperature_Ref; // maybe make it class var + val_residual[nDim+1] = Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim] * Volume * Body_Force_T; // maybe make it class var } } else val_residual[nDim+1] = 0.0; diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp index 8550fe850356..3b220e549361 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -13371,7 +13371,11 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve if (config->GetPeriodic_BC_Body_Force()) { nVar_Par += 1; - Variable_Names.push_back("Recovered_pressure"); + Variable_Names.push_back("Recovered_Pressure"); + if(energy) { + nVar_Par += 1; + Variable_Names.push_back("Recovered_Temperature"); + } nVar_Par += 1; Variable_Names.push_back("rank"); @@ -13705,7 +13709,14 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ Local_Data[jPoint][iVar] -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; iVar++; + + if (energy) { + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSolution(nDim+1); + Local_Data[jPoint][iVar] += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/solver[FirstIndex]->node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; iVar++; // HARDCODED inlet !!!!! + } + Local_Data[jPoint][iVar] = rank; iVar++; + } //body force bracket } //low memory output bracket diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 241308dbba55..df9c936de3a5 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -10757,10 +10757,11 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Velocity2, Density, Area, Vel_Infty2, AxiFactor; unsigned short iMarker_Outlet, nMarker_Outlet; string Inlet_TagBound, Outlet_TagBound; + su2double Heatflux_Integrated = 0.0; bool axisymmetric = config->GetAxisymmetric(); - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) + bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*1)) == 0) && (config->GetExtIter()!= 0)) || (config->GetExtIter() == 1)); @@ -10829,7 +10830,6 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Outlet_MassFlow[iMarker] += MassFlow; Outlet_Density[iMarker] += Density*Area; Outlet_Area[iMarker] += Area; - } } } @@ -10896,11 +10896,9 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi else { Outlet_Density_Total[iMarker_Outlet] = 0.0; } - + if (iMesh == MESH_0) { - config->SetOutlet_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); - config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); - config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); + config->SetPeriodic_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); } } @@ -10922,16 +10920,9 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi /*--- Geometry defintion ---*/ cout <<"Outlet surface: " << Outlet_TagBound << "." << endl; + - if ((nDim ==3) || axisymmetric) { - cout <<"Area (m^2): " << config->GetOutlet_Area(Outlet_TagBound) << endl; - } - if (nDim == 2) { - cout <<"Length (m): " << config->GetOutlet_Area(Outlet_TagBound) << "." << endl; - } - - cout << setprecision(5) << "Outlet Avg. Density (kg/m^3): " << config->GetOutlet_Density(Outlet_TagBound) * config->GetDensity_Ref() << endl; - su2double Outlet_mDot = fabs(config->GetOutlet_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); + su2double Outlet_mDot = fabs(config->GetPeriodic_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot; } @@ -10990,7 +10981,21 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi /*--- Get the specified wall heat flux from config ---*/ - su2double Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + + /*--- OPTION 1 for Heatflux calculation ---*/ + su2double Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + + /*--- OPTION 2 for Heatflux calculation ---*/ + su2double GradTemperature = 0.0; + // turn off for no energy equation + for (iDim = 0; iDim < nDim; iDim++) + GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal + + su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); + Wall_HeatFlux = -thermal_conductivity*GradTemperature; + + /*--- END OPTIONS ---*/ + Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; @@ -11003,7 +11008,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Area = sqrt (Area); Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Wall_HeatFlux*Area; + Outlet_Density[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. Outlet_Area[iMarker] += Area; } @@ -11034,6 +11039,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; + cout << "Outlet_Density_Local: " << Outlet_Density_Local[iMarker_Outlet] << endl; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; } } @@ -11061,12 +11067,18 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { if (iMesh == MESH_0) { - config->SetOutlet_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); - config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); - config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); + config->SetPeriodic_Heatflux(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); + Heatflux_Integrated += Outlet_Density_Total[iMarker_Outlet]; } } + + + if (iMesh == MESH_0) { + config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); + } + + /*--- Screen output using the values already stored in the config container ---*/ if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { @@ -11086,17 +11098,12 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi cout <<"Heat flux surface: " << Outlet_TagBound << "." << endl; - if ((nDim ==3) || axisymmetric) { - cout <<"Area (m^2): " << config->GetOutlet_Area(Outlet_TagBound) << endl; - } - if (nDim == 2) { - cout <<"Length (m): " << config->GetOutlet_Area(Outlet_TagBound) << "." << endl; - } - - cout << setprecision(5) << scientific << "Q on surface: " << config->GetOutlet_Density(Outlet_TagBound) << endl; + cout << setprecision(5) << scientific << "Q on surface: " << config->GetPeriodic_Heatflux(Outlet_TagBound) * config->GetHeat_Flux_Ref() << endl; } } + cout << "Heatflux_Integrated: " << Heatflux_Integrated * config->GetHeat_Flux_Ref() << endl; + if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; cout << "-------------------------------------------------------------------------" << endl << endl; } @@ -13081,6 +13088,31 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai Compute the residual due to the prescribed heat flux. ---*/ Res_Visc[nDim+1] = Wall_HeatFlux*Area; + + // streamwise periodic + if (config->GetPeriodic_BC_Body_Force()) { + + su2double Cp = node[iPoint]->GetSpecificHeatCp(); + su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); + su2double norm_translation = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + norm_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + } + norm_translation = sqrt(norm_translation); + + su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * thermal_conductivity / config->GetPeriodic_MassFlow("outlet") / Cp / pow(norm_translation,2); + + su2double dot_product = 0.0; // t*n*A , n is unitnormal, Normal here is n*A + for (iDim = 0; iDim < nDim; iDim++) { + dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; + } + + Res_Visc[nDim+1] -= Body_Force_T*dot_product; + + cout << "dot_product: " << dot_product << endl; + cout << "Body_Force_T: " << Body_Force_T << endl; + cout << "Physical contribution: " << Res_Visc[nDim+1] << " Periodic contribution: " << Body_Force_T*dot_product << endl; + } /*--- Viscous contribution to the residual at the wall ---*/ From 29bac924b6517095b0e3aab1cf934ed2b24199ca Mon Sep 17 00:00:00 2001 From: "Thomas D. Economon" Date: Sun, 16 Dec 2018 21:40:16 -0800 Subject: [PATCH 005/326] Added recovered pressure and temperature. --- Common/src/config_structure.cpp | 2 + SU2_CFD/include/variable_structure.hpp | 51 +++++ SU2_CFD/include/variable_structure.inl | 16 ++ SU2_CFD/src/solver_direct_mean_inc.cpp | 184 +++++++++++------- .../Xcode/SU2_CFD.xcodeproj/project.pbxproj | 8 + 5 files changed, 196 insertions(+), 65 deletions(-) diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index a21e6080a337..1776b14886ce 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -4187,8 +4187,10 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ + // NEED TO PROPERLY INITIALIZE INTEGRATED VALUE USING BC FOR TEMPERATURE if (Periodic_BC_Body_Force == YES) { PeriodicRefNode_BodyForce = new su2double[val_nDim]; + Heatflux_Integrated = 1e-10; } /*--- Handle default options for topology optimization ---*/ diff --git a/SU2_CFD/include/variable_structure.hpp b/SU2_CFD/include/variable_structure.hpp index 72fb445b1666..84565f1cfa50 100644 --- a/SU2_CFD/include/variable_structure.hpp +++ b/SU2_CFD/include/variable_structure.hpp @@ -869,6 +869,30 @@ class CVariable { */ virtual su2double GetDensity_Old(void); + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + virtual su2double GetPressure_Recovered(void); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + virtual su2double GetTemperature_Recovered(void); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + virtual void SetPressure_Recovered(su2double val_pressure); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + virtual void SetTemperature_Recovered(su2double val_temperature); + /*! * \brief A virtual member. * \return Value of the flow density. @@ -3578,6 +3602,9 @@ class CIncEulerVariable : public CVariable { /*--- Old density for variable density turbulent flows (SST). ---*/ su2double Density_Old; + + su2double Pressure_Recovered; + su2double Temperature_Recovered; public: @@ -3758,6 +3785,30 @@ class CIncEulerVariable : public CVariable { */ su2double GetDensity_Old(void); + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + su2double GetPressure_Recovered(void); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + su2double GetTemperature_Recovered(void); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + void SetPressure_Recovered(su2double val_pressure); + + /*! + * \brief A virtual member. + * \return Old value of the flow density. + */ + void SetTemperature_Recovered(su2double val_temperature); + /*! * \brief Get the temperature of the flow. * \return Value of the temperature of the flow. diff --git a/SU2_CFD/include/variable_structure.inl b/SU2_CFD/include/variable_structure.inl index 7857c0f0c00e..9a504b8449d9 100644 --- a/SU2_CFD/include/variable_structure.inl +++ b/SU2_CFD/include/variable_structure.inl @@ -251,6 +251,14 @@ inline su2double CVariable::GetDensity(void) { return 0; } inline su2double CVariable::GetDensity_Old(void) { return 0; } +inline su2double CVariable::GetPressure_Recovered(void) { return 0; } + +inline su2double CVariable::GetTemperature_Recovered(void) { return 0; } + +inline void CVariable::SetPressure_Recovered(su2double val_pressure) { } + +inline void CVariable::SetTemperature_Recovered(su2double val_temperature) { } + inline su2double CVariable::GetDensity(unsigned short val_iSpecies) { return 0; } inline su2double CVariable::GetEnergy(void) { return 0; } @@ -953,6 +961,14 @@ inline su2double CIncEulerVariable::GetDensity(void) { return Primitive[nDim+2]; inline su2double CIncEulerVariable::GetDensity_Old(void) { return Density_Old; } +inline su2double CIncEulerVariable::GetPressure_Recovered(void) { return Pressure_Recovered; } + +inline su2double CIncEulerVariable::GetTemperature_Recovered(void) { return Temperature_Recovered; } + +inline void CIncEulerVariable::SetPressure_Recovered(su2double val_pressure) { Pressure_Recovered = val_pressure; } + +inline void CIncEulerVariable::SetTemperature_Recovered(su2double val_temperature) { Temperature_Recovered = val_temperature; } + inline su2double CIncEulerVariable::GetBetaInc2(void) { return Primitive[nDim+3]; } inline su2double CIncEulerVariable::GetPressure(void) { return Primitive[0]; } diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index df9c936de3a5..eb0f9f9af85b 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -10813,7 +10813,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi AxiFactor = 1.0; } - Temperature = V_outlet[nDim+1]; + Temperature = node[iPoint]->GetTemperature_Recovered(); //V_outlet[nDim+1]; + //cout << iPoint << " " << Temperature << endl; Pressure = V_outlet[0]; Density = V_outlet[nDim+2]; @@ -10828,7 +10829,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Area = sqrt (Area); Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Density*Area; + Outlet_Density[iMarker] += Temperature*Area; Outlet_Area[iMarker] += Area; } } @@ -10902,6 +10903,15 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } } + // Subtract the bulk temperature to set Q + // HARD CODED for 2 markers and the absolutr value should not be here!!! TDE + su2double dT = 0.0; + dT = fabs(Outlet_Density_Total[1] - Outlet_Density_Total[0]); + + if (iMesh == MESH_0) { + config->SetPeriodic_HeatfluxIntegrated(dT*config->GetPeriodic_MassFlow("outlet")*node[0]->GetSpecificHeatCp()); + } + /*--- Screen output using the values already stored in the config container ---*/ if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { @@ -10925,6 +10935,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi su2double Outlet_mDot = fabs(config->GetPeriodic_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot; + cout <<"Bulk temperature difference: " << dT * config->GetTemperature_Ref()<< " : Q : " << config->GetPeriodic_HeatfluxIntegrated() * config->GetHeat_Flux_Ref()<< endl; + } } @@ -10936,32 +10948,32 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } - + // BEGIN HEAT FLUX LOOP - + nMarker_Outlet = config->GetnMarker_HeatFlux(); - + /*--- Comute MassFlow, average temp, press, etc. ---*/ - + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - + Outlet_MassFlow[iMarker] = 0.0; Outlet_Density[iMarker] = 0.0; Outlet_Area[iMarker] = 0.0; - + if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { - + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - + if (geometry->node[iPoint]->GetDomain()) { - + V_outlet = node[iPoint]->GetPrimitive(); - + geometry->vertex[iMarker][iVertex]->GetNormal(Vector); - + if (axisymmetric) { if (geometry->node[iPoint]->GetCoord(1) != 0.0) AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); @@ -10970,35 +10982,35 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } else { AxiFactor = 1.0; } - + Temperature = V_outlet[nDim+1]; Pressure = V_outlet[0]; Density = V_outlet[nDim+2]; - + /*--- Identify the boundary by string name ---*/ - + string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - + /*--- Get the specified wall heat flux from config ---*/ - - + + /*--- OPTION 1 for Heatflux calculation ---*/ su2double Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); - + /*--- OPTION 2 for Heatflux calculation ---*/ su2double GradTemperature = 0.0; // turn off for no energy equation for (iDim = 0; iDim < nDim; iDim++) GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal - + su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); Wall_HeatFlux = -thermal_conductivity*GradTemperature; - + /*--- END OPTIONS ---*/ - - + + Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; - + for (iDim = 0; iDim < nDim; iDim++) { Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); Velocity[iDim] = V_outlet[iDim+1]; @@ -11006,31 +11018,31 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; } Area = sqrt (Area); - + Outlet_MassFlow[iMarker] += MassFlow; Outlet_Density[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. Outlet_Area[iMarker] += Area; - + } } } } - + /*--- Copy to the appropriate structure ---*/ - - + + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; Outlet_Density_Local[iMarker_Outlet] = 0.0; Outlet_Area_Local[iMarker_Outlet] = 0.0; - + Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; Outlet_Density_Total[iMarker_Outlet] = 0.0; Outlet_Area_Total[iMarker_Outlet] = 0.0; } - + /*--- Copy the values to the local array for MPI ---*/ - + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX)) { for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { @@ -11045,73 +11057,73 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } } } - + /*--- All the ranks to compute the total value ---*/ - + #ifdef HAVE_MPI - + SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - + #else - + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; } - + #endif - + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - + if (iMesh == MESH_0) { config->SetPeriodic_Heatflux(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); Heatflux_Integrated += Outlet_Density_Total[iMarker_Outlet]; } } - - - - if (iMesh == MESH_0) { - config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); - } - - + + + +// if (iMesh == MESH_0) { +// config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); +// } + + /*--- Screen output using the values already stored in the config container ---*/ - + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { - + cout.precision(5); cout.setf(ios::fixed, ios::floatfield); - + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { cout << endl << "---------------------------- Outlet properties --------------------------" << endl; } - + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_TagBound = config->GetMarker_HeatFlux_TagBound(iMarker_Outlet); if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - + /*--- Geometry defintion ---*/ - + cout <<"Heat flux surface: " << Outlet_TagBound << "." << endl; - + cout << setprecision(5) << scientific << "Q on surface: " << config->GetPeriodic_Heatflux(Outlet_TagBound) * config->GetHeat_Flux_Ref() << endl; } } - + cout << "Heatflux_Integrated: " << Heatflux_Integrated * config->GetHeat_Flux_Ref() << endl; - + if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; cout << "-------------------------------------------------------------------------" << endl << endl; } - + cout.unsetf(ios_base::floatfield); - + } - + delete [] Outlet_MassFlow_Local; delete [] Outlet_Density_Local; @@ -12188,6 +12200,48 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- ---*/ + if (config->GetPeriodic_BC_Body_Force() == YES) { + + /*--- Define and initialize helping variables ---*/ + su2double norm2_translation_vector; + su2double dot_product; + su2double PerBoundNodeCoord[nDim]; + su2double Pressure_Recovered, Temperature_Recovered; + + unsigned short iDim; + + for (iDim = 0; iDim < nDim; iDim++) + PerBoundNodeCoord[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + + for (iPoint = 0; iPoint < nPoint; iPoint++) { + + /*--- Compute correction based on relative distance (0,l) between periodic markers ---*/ + dot_product = 0.0; + norm2_translation_vector = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; + norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? + } + + /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ + Pressure_Recovered = node[iPoint]->GetSolution(0); + Pressure_Recovered -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; + + Temperature_Recovered=0.0; + if (config->GetEnergy_Equation()) { + Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); + if (config->GetExtIter() > 0) // TDE here we have to avoid a mdot = 0 (inf) + Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; // HARDCODED inlet !!!!! + } + + //cout << iPoint << " " << Pressure_Recovered << " " << Temperature_Recovered<< endl; + node[iPoint]->SetPressure_Recovered(Pressure_Recovered); + node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); + + } + + } + if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); /*--- Evaluate the vorticity and strain rate magnitude ---*/ @@ -13109,9 +13163,9 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai Res_Visc[nDim+1] -= Body_Force_T*dot_product; - cout << "dot_product: " << dot_product << endl; - cout << "Body_Force_T: " << Body_Force_T << endl; - cout << "Physical contribution: " << Res_Visc[nDim+1] << " Periodic contribution: " << Body_Force_T*dot_product << endl; + //cout << "dot_product: " << dot_product << endl; + //cout << "Body_Force_T: " << Body_Force_T << endl; + //cout << "Physical contribution: " << Res_Visc[nDim+1] << " Periodic contribution: " << Body_Force_T*dot_product << endl; } /*--- Viscous contribution to the residual at the wall ---*/ diff --git a/SU2_IDE/Xcode/SU2_CFD.xcodeproj/project.pbxproj b/SU2_IDE/Xcode/SU2_CFD.xcodeproj/project.pbxproj index 6fec3163a4a1..8f79de1ea716 100644 --- a/SU2_IDE/Xcode/SU2_CFD.xcodeproj/project.pbxproj +++ b/SU2_IDE/Xcode/SU2_CFD.xcodeproj/project.pbxproj @@ -78,6 +78,8 @@ E96FAF162189FECA0046BF5D /* fem_cgns_elements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E96FAF132189FECA0046BF5D /* fem_cgns_elements.cpp */; }; E96FAF182189FF0A0046BF5D /* data_manufactured_solutions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E96FAF172189FF0A0046BF5D /* data_manufactured_solutions.cpp */; }; E9AA98A71BB3436900B7FE37 /* driver_structure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9AA98A61BB3436900B7FE37 /* driver_structure.cpp */; }; + E9BE411D21C4A725004695CB /* driver_direct_singlezone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9BE411B21C4A724004695CB /* driver_direct_singlezone.cpp */; }; + E9BE411E21C4A725004695CB /* driver_direct_multizone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9BE411C21C4A724004695CB /* driver_direct_multizone.cpp */; }; E9C8307F2061E60E004417A9 /* fem_geometry_structure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9C830752061E60E004417A9 /* fem_geometry_structure.cpp */; }; E9C830802061E60E004417A9 /* fem_integration_rules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9C830762061E60E004417A9 /* fem_integration_rules.cpp */; }; E9C830812061E60E004417A9 /* fem_standard_element.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9C830772061E60E004417A9 /* fem_standard_element.cpp */; }; @@ -242,6 +244,8 @@ E97B6C8117F941800008255B /* config_template.cfg */ = {isa = PBXFileReference; lastKnownFileType = text; name = config_template.cfg; path = ../../config_template.cfg; sourceTree = ""; }; E9AA98A61BB3436900B7FE37 /* driver_structure.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = driver_structure.cpp; path = ../../SU2_CFD/src/driver_structure.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E9AA98A81BB3438F00B7FE37 /* driver_structure.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = driver_structure.hpp; path = ../../SU2_CFD/include/driver_structure.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E9BE411B21C4A724004695CB /* driver_direct_singlezone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = driver_direct_singlezone.cpp; path = ../../SU2_CFD/src/driver_direct_singlezone.cpp; sourceTree = ""; }; + E9BE411C21C4A724004695CB /* driver_direct_multizone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = driver_direct_multizone.cpp; path = ../../SU2_CFD/src/driver_direct_multizone.cpp; sourceTree = ""; }; E9C830752061E60E004417A9 /* fem_geometry_structure.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fem_geometry_structure.cpp; path = ../../Common/src/fem_geometry_structure.cpp; sourceTree = ""; }; E9C830762061E60E004417A9 /* fem_integration_rules.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fem_integration_rules.cpp; path = ../../Common/src/fem_integration_rules.cpp; sourceTree = ""; }; E9C830772061E60E004417A9 /* fem_standard_element.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fem_standard_element.cpp; path = ../../Common/src/fem_standard_element.cpp; sourceTree = ""; }; @@ -542,6 +546,8 @@ E96FAF172189FF0A0046BF5D /* data_manufactured_solutions.cpp */, 05E6DBBC17EB62A000FA1F7E /* definition_structure.cpp */, E9AA98A61BB3436900B7FE37 /* driver_structure.cpp */, + E9BE411C21C4A724004695CB /* driver_direct_multizone.cpp */, + E9BE411B21C4A724004695CB /* driver_direct_singlezone.cpp */, 05AF9F1C1BE1E1770062E1F1 /* FEA */, 05F108951978D28F00F2F288 /* FluidModel */, 0530E57317FDF97F00733CE8 /* Geometry */, @@ -738,6 +744,8 @@ 05E6DC3F17EB62A100FA1F7E /* variable_direct_transition.cpp in Sources */, E9C830932061E799004417A9 /* solver_direct_mean_fem.cpp in Sources */, E9C830832061E60E004417A9 /* fem_work_estimate_metis.cpp in Sources */, + E9BE411D21C4A725004695CB /* driver_direct_singlezone.cpp in Sources */, + E9BE411E21C4A725004695CB /* driver_direct_multizone.cpp in Sources */, 05E6DC4017EB62A100FA1F7E /* variable_direct_turbulent.cpp in Sources */, E9F130CE1D513DA300EC8963 /* solver_direct_mean_inc.cpp in Sources */, E9D9CE891C62A1C8004119E9 /* transfer_physics.cpp in Sources */, From 28e82cd309963b2c6c8a3d5ee283850ed40467d2 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 4 Jan 2019 14:32:19 +0100 Subject: [PATCH 006/326] Small change in source term computation for momentum equations. --- SU2_CFD/src/numerics_direct_mean_inc.cpp | 6 +++--- SU2_CFD/src/solver_direct_mean_inc.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 0164f3bfab3a..f08f47099a0a 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -899,13 +899,13 @@ CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim Body_Force_Vector = new su2double[nDim]; su2double norm2_PBtranslate = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + norm2_PBtranslate =+ pow(config->GetPeriodicTranslation(0)[iDim],2); + for (unsigned short iDim = 0; iDim < nDim; iDim++) { if (config->GetPeriodicTranslation(0)[iDim] == 0) { Body_Force_Vector[iDim] = 0.0; } else { - Body_Force_Vector[iDim] = DeltaP_BodyForce/config->GetPeriodicTranslation(0)[iDim]; // wrong - for (iDim = 0; iDim < nDim; iDim++) - norm2_PBtranslate =+ pow(config->GetPeriodicTranslation(0)[iDim],2); Body_Force_Vector[iDim] = DeltaP_BodyForce/norm2_PBtranslate*config->GetPeriodicTranslation(0)[iDim]; } } diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index eb0f9f9af85b..f94050459917 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -10897,7 +10897,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi else { Outlet_Density_Total[iMarker_Outlet] = 0.0; } - + if (iMesh == MESH_0) { config->SetPeriodic_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); } @@ -10905,6 +10905,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi // Subtract the bulk temperature to set Q // HARD CODED for 2 markers and the absolutr value should not be here!!! TDE + // OPTION 3 compute energy Q via inlet and outlet bulk temperature, after FLuent way, but bulk temperature not done as in fluent su2double dT = 0.0; dT = fabs(Outlet_Density_Total[1] - Outlet_Density_Total[0]); @@ -10994,10 +10995,10 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi /*--- Get the specified wall heat flux from config ---*/ - /*--- OPTION 1 for Heatflux calculation ---*/ + /*--- OPTION 1 for Heatflux calculation from config file ---*/ su2double Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); - /*--- OPTION 2 for Heatflux calculation ---*/ + /*--- OPTION 2 for Heatflux calculation from computing actual heatflux ---*/ su2double GradTemperature = 0.0; // turn off for no energy equation for (iDim = 0; iDim < nDim; iDim++) From 6cd1725b71fd9403b7c86648f09152613b1b29bb Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 7 Jan 2019 16:53:08 +0100 Subject: [PATCH 007/326] Computation of recovered values now in solver every iteration. Small sum bugfix. --- SU2_CFD/include/variable_structure.hpp | 16 ++--- SU2_CFD/src/numerics_direct_mean_inc.cpp | 36 +++++----- SU2_CFD/src/output_structure.cpp | 45 ++----------- SU2_CFD/src/solver_direct_mean_inc.cpp | 84 ++++++++++++------------ 4 files changed, 69 insertions(+), 112 deletions(-) diff --git a/SU2_CFD/include/variable_structure.hpp b/SU2_CFD/include/variable_structure.hpp index 84565f1cfa50..d72c55fa3873 100644 --- a/SU2_CFD/include/variable_structure.hpp +++ b/SU2_CFD/include/variable_structure.hpp @@ -871,25 +871,23 @@ class CVariable { /*! * \brief A virtual member. - * \return Old value of the flow density. + * \return Recovered/Physical pressure for periodic flow. */ - virtual su2double GetPressure_Recovered(void); + virtual su2double GetPressure_Recovered(void); // TK /*! * \brief A virtual member. - * \return Old value of the flow density. + * \return Recovered/Physical temperature for periodic flow. */ virtual su2double GetTemperature_Recovered(void); /*! * \brief A virtual member. - * \return Old value of the flow density. */ virtual void SetPressure_Recovered(su2double val_pressure); /*! * \brief A virtual member. - * \return Old value of the flow density. */ virtual void SetTemperature_Recovered(su2double val_temperature); @@ -3787,25 +3785,23 @@ class CIncEulerVariable : public CVariable { /*! * \brief A virtual member. - * \return Old value of the flow density. + * \return Recovered/Physical pressure for periodic flow. */ - su2double GetPressure_Recovered(void); + su2double GetPressure_Recovered(void); // TK /*! * \brief A virtual member. - * \return Old value of the flow density. + * \return Recovered/Physical temperature for periodic flow. */ su2double GetTemperature_Recovered(void); /*! * \brief A virtual member. - * \return Old value of the flow density. */ void SetPressure_Recovered(su2double val_pressure); /*! * \brief A virtual member. - * \return Old value of the flow density. */ void SetTemperature_Recovered(su2double val_temperature); diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index f08f47099a0a..25e9f56ba54a 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -893,23 +893,21 @@ CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim /*--- Store the pointer to the constant body force vector. ---*/ - su2double DeltaP_BodyForce = config->GetDeltaP_BodyForce(); - //bool energy = config->GetEnergy_Equation(); // to be changed - //if (energy) su2double Temperature_Source_Periodic = config->GetTemperature_Source_Periodic(); Body_Force_Vector = new su2double[nDim]; su2double norm2_PBtranslate = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_PBtranslate =+ pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_PBtranslate += pow(config->GetPeriodicTranslation(0)[iDim],2); for (unsigned short iDim = 0; iDim < nDim; iDim++) { if (config->GetPeriodicTranslation(0)[iDim] == 0) { Body_Force_Vector[iDim] = 0.0; } else { - Body_Force_Vector[iDim] = DeltaP_BodyForce/norm2_PBtranslate*config->GetPeriodicTranslation(0)[iDim]; + Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_PBtranslate*config->GetPeriodicTranslation(0)[iDim]; } } + // TK output has to be done differently or at least if rank==master cout << "Body force vector based on delta p: [ "; for (unsigned short iDim = 0; iDim < nDim; iDim++) { cout << Body_Force_Vector[iDim] << " "; @@ -927,18 +925,15 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf unsigned short iDim; su2double DensityInc_0 = 0.0; - su2double Pressure_Ref = config->GetPressure_Ref(); // check if pressure and force ref are the same - su2double Temperature_Ref = config->GetTemperature_Ref(); - bool energy = config->GetEnergy_Equation(); + su2double Pressure_Ref = config->GetPressure_Ref(); // check if pressure and force ref are the same + su2double Temperature_Ref = config->GetTemperature_Ref(); bool variable_density = (config->GetKind_DensityModel() == VARIABLE); - su2double C_p = V_i[nDim+7]; su2double Velocity[nDim]; for (iDim = 0; iDim < nDim; iDim++) Velocity[iDim] = V_i[iDim+1]; - su2double Delta_T = 10.0; - su2double norm_translation = 0.0; + su2double norm2_translation = 0.0; /*--- Check for variable density. If we have a variable density problem, we should subtract out the hydrostatic pressure component. ---*/ @@ -953,26 +948,27 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf subtracted the operating density * gravity, i.e., removed the hydrostatic pressure component (important for pressure BCs). ---*/ + /*--- Compute the periodic pressure contribution to the momentum equation ---*/ + for (iDim = 0; iDim < nDim; iDim++) - val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim] / Pressure_Ref; // check if pres_ref is the same as force ref + val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref - /*--- Zero the temperature contribution ---*/ + /*--- Compute the periodic temperature contribution to the energy equation ---*/ for (iDim = 0; iDim < nDim; iDim++) { - norm_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - norm_translation = sqrt(norm_translation); - - if (energy) { + if (config->GetEnergy_Equation()) { - su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / config->GetPeriodic_MassFlow("outlet") / pow(norm_translation,2); // HARDCODED inlet !!!! + su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / config->GetPeriodic_MassFlow("outlet") / norm2_translation; // TK HARDCODED inlet !!!! for (iDim = 0; iDim < nDim; iDim++) { - val_residual[nDim+1] = Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim] * Volume * Body_Force_T; // maybe make it class var + val_residual[nDim+1] += Volume * Body_Force_T * Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim]; // TK maybe make it class var } + } else { + val_residual[nDim+1] = 0.0; } - else val_residual[nDim+1] = 0.0; } diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp index 3b220e549361..47499cdc3a6d 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -13676,50 +13676,17 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } - /*--- Compute the recovered pressure levels if reduced pressure - * was computed for a delta p driven periodic BC case. - * p_rec = p_red - delta p * (t dot (r-x*))/norm(t)^2 where - * p_rec : recovered pressure (which we compute here) - * p_red : reduced pressure from the computation - * delta p : prescribed pressure drop - * t : translation vector given in marker_periodic - * x* : point on "inlet" marker which is the furthest in negative t-direction - * r : position vector of any point in the domain ---*/ - if (config->GetPeriodic_BC_Body_Force() == YES) { - /*--- Define and initialize helping variables ---*/ - su2double norm2_translation_vector; - su2double dot_product; - su2double PerBoundNodeCoord[nDim]; - - for (iDim = 0; iDim < nDim; iDim++) - PerBoundNodeCoord[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; - - /*--- First, set recovered to reduced pressure ---*/ - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSolution(0); - - /*--- Compute correction based on relative distance (0,l) between periodic markers ---*/ - dot_product = 0.0; - norm2_translation_vector = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; - norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? - } - - /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ - Local_Data[jPoint][iVar] -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; iVar++; - - if (energy) { - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSolution(nDim+1); - Local_Data[jPoint][iVar] += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/solver[FirstIndex]->node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; iVar++; // HARDCODED inlet !!!!! - } - + /*--- TK Recovered p/T comp is already done in CIncNSSolver::Preprocessing() ---*/ + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetPressure_Recovered(); iVar++; + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetTemperature_Recovered(); iVar++; + Local_Data[jPoint][iVar] = rank; iVar++; - } //body force bracket + } // body force bracket - } //low memory output bracket + } // low memory output bracket /*--- Increment the point counter, as there may have been halos we skipped over during the data loading. ---*/ diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index f94050459917..8a0763a93758 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2575,7 +2575,7 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- ---*/ + /*--- TK ---*/ if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); @@ -10813,8 +10813,6 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi AxiFactor = 1.0; } - Temperature = node[iPoint]->GetTemperature_Recovered(); //V_outlet[nDim+1]; - //cout << iPoint << " " << Temperature << endl; Pressure = V_outlet[0]; Density = V_outlet[nDim+2]; @@ -10828,6 +10826,9 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } Area = sqrt (Area); + Temperature = node[iPoint]->GetTemperature_Recovered(); + //cout << iPoint << " " << Temperature << endl; + Outlet_MassFlow[iMarker] += MassFlow; Outlet_Density[iMarker] += Temperature*Area; Outlet_Area[iMarker] += Area; @@ -10904,8 +10905,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } // Subtract the bulk temperature to set Q + // OPTION 3 compute energy Q via inlet and outlet bulk temperature, after FLuent way bulk tmep is not computed correctly // HARD CODED for 2 markers and the absolutr value should not be here!!! TDE - // OPTION 3 compute energy Q via inlet and outlet bulk temperature, after FLuent way, but bulk temperature not done as in fluent su2double dT = 0.0; dT = fabs(Outlet_Density_Total[1] - Outlet_Density_Total[0]); @@ -10921,7 +10922,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi cout.setf(ios::fixed, ios::floatfield); if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - cout << endl << "---------------------------- Outlet properties --------------------------" << endl; + cout << endl << "---------------------------- Outlet properties Fluent way --------------------------" << endl; } for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { @@ -10934,9 +10935,9 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi su2double Outlet_mDot = fabs(config->GetPeriodic_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); - cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot; + cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot << endl; - cout <<"Bulk temperature difference: " << dT * config->GetTemperature_Ref()<< " : Q : " << config->GetPeriodic_HeatfluxIntegrated() * config->GetHeat_Flux_Ref()<< endl; + cout <<"Bulk temperature difference: " << dT * config->GetTemperature_Ref()<< " : Q : " << config->GetPeriodic_HeatfluxIntegrated() * config->GetHeat_Flux_Ref() << endl; } } @@ -10950,7 +10951,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } - // BEGIN HEAT FLUX LOOP + // BEGIN HEAT FLUX LOOP ===================================== nMarker_Outlet = config->GetnMarker_HeatFlux(); @@ -10963,7 +10964,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Outlet_Density[iMarker] = 0.0; Outlet_Area[iMarker] = 0.0; - if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { + if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { // This if-clause can be omitted for OPTION 2 for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -10993,18 +10994,18 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi string Marker_Tag = config->GetMarker_All_TagBound(iMarker); /*--- Get the specified wall heat flux from config ---*/ - + su2double Wall_HeatFlux = 0.0; /*--- OPTION 1 for Heatflux calculation from config file ---*/ - su2double Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); /*--- OPTION 2 for Heatflux calculation from computing actual heatflux ---*/ su2double GradTemperature = 0.0; // turn off for no energy equation for (iDim = 0; iDim < nDim; iDim++) - GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal + GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal TK should it be unit normal here? - su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); + su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); Wall_HeatFlux = -thermal_conductivity*GradTemperature; /*--- END OPTIONS ---*/ @@ -11052,7 +11053,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; - cout << "Outlet_Density_Local: " << Outlet_Density_Local[iMarker_Outlet] << endl; + //cout << "Outlet_Density_Local: " << Outlet_Density_Local[iMarker_Outlet] << endl; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; } } @@ -11087,9 +11088,9 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi -// if (iMesh == MESH_0) { -// config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); -// } + if (iMesh == MESH_0) { + config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); + } /*--- Screen output using the values already stored in the config container ---*/ @@ -12127,6 +12128,7 @@ CIncNSSolver::~CIncNSSolver(void) { void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { unsigned long iPoint, ErrorCounter = 0; + unsigned short iDim; su2double StrainMag = 0.0, Omega = 0.0, *Vorticity; unsigned long ExtIter = config->GetExtIter(); @@ -12199,41 +12201,38 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- ---*/ + /*--- Compute recovered pressure and temperature for streamwise periodic BC ---*/ if (config->GetPeriodic_BC_Body_Force() == YES) { /*--- Define and initialize helping variables ---*/ su2double norm2_translation_vector; su2double dot_product; - su2double PerBoundNodeCoord[nDim]; + su2double PerBoundNodeCoord[nDim]; // reference node on inlet periodic marker x^* su2double Pressure_Recovered, Temperature_Recovered; - unsigned short iDim; - for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; for (iPoint = 0; iPoint < nPoint; iPoint++) { - /*--- Compute correction based on relative distance (0,l) between periodic markers ---*/ - dot_product = 0.0; - norm2_translation_vector = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; - norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? - } - - /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ - Pressure_Recovered = node[iPoint]->GetSolution(0); - Pressure_Recovered -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; - - Temperature_Recovered=0.0; - if (config->GetEnergy_Equation()) { - Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); - if (config->GetExtIter() > 0) // TDE here we have to avoid a mdot = 0 (inf) - Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; // HARDCODED inlet !!!!! - } + /*--- First, ompute correction based on relative distance (0,l) between periodic markers ---*/ + dot_product = 0.0; + norm2_translation_vector = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; + norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? + } + + /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ + Pressure_Recovered = node[iPoint]->GetSolution(0); + Pressure_Recovered -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; + + if (config->GetEnergy_Equation()) { + Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); + if (config->GetExtIter() > 0) // TK TDE here we have to avoid a mdot = 0 (inf) + Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; // TK HARDCODED inlet !!!!! + } //cout << iPoint << " " << Pressure_Recovered << " " << Temperature_Recovered<< endl; node[iPoint]->SetPressure_Recovered(Pressure_Recovered); @@ -13149,13 +13148,12 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai su2double Cp = node[iPoint]->GetSpecificHeatCp(); su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); - su2double norm_translation = 0.0; + su2double norm2_translation = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - norm_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - norm_translation = sqrt(norm_translation); - su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * thermal_conductivity / config->GetPeriodic_MassFlow("outlet") / Cp / pow(norm_translation,2); + su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * thermal_conductivity / config->GetPeriodic_MassFlow("outlet") / Cp / norm2_translation; // TK hardcoded su2double dot_product = 0.0; // t*n*A , n is unitnormal, Normal here is n*A for (iDim = 0; iDim < nDim; iDim++) { From c277de6a65ac0550a71e48de343ddb9430e22e28 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 10 Jan 2019 15:42:01 +0100 Subject: [PATCH 008/326] Pressure only working. Temp converging for BCHF. A lot of cleaning/commenting. --- SU2_CFD/include/numerics_structure.hpp | 6 +- SU2_CFD/src/driver_structure.cpp | 2 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 57 +++++++----- SU2_CFD/src/output_structure.cpp | 9 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 110 +++++++++++++---------- 5 files changed, 106 insertions(+), 78 deletions(-) diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp index a766b096a255..4b30c0f1bcac 100644 --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5273,7 +5273,8 @@ class CSourceIncBodyForce : public CNumerics { * \version 6.1.0 "Falcon" */ class CSourceIncPeriodicBodyForce : public CNumerics { - su2double *Body_Force_Vector; + bool implicit; /*!< \brief Implicit calculation. */ + su2double *Body_Force_Vector; /*!< \brief Additional source term vector in streamwise periodic comp for the momentum equations. */ public: @@ -5292,9 +5293,10 @@ class CSourceIncPeriodicBodyForce : public CNumerics { /*! * \brief Source term integration for a body force. * \param[out] val_residual - Pointer to the residual vector. + * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). * \param[in] config - Definition of the particular problem. */ - void ComputeResidual(su2double *val_residual, CConfig *config); + void ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config); }; diff --git a/SU2_CFD/src/driver_structure.cpp b/SU2_CFD/src/driver_structure.cpp index d86723e41b62..d8944096ca01 100644 --- a/SU2_CFD/src/driver_structure.cpp +++ b/SU2_CFD/src/driver_structure.cpp @@ -2307,7 +2307,7 @@ void CDriver::Numerics_Preprocessing(CNumerics *****numerics_container, if (incompressible) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBodyForce(nDim, nVar_Flow, config); else if (config->GetPeriodic_BC_Body_Force() == YES) - if (incompressible) {if (rank == MASTER_NODE) cout << "Driver init of CSourceIncPeriodicBodyForce." << endl; numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncPeriodicBodyForce(nDim, nVar_Flow, config);}// Currently not implemented for compressible flow + if (incompressible) {if (rank == MASTER_NODE) cout << "Driver init of CSourceIncPeriodicBodyForce." << endl; numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncPeriodicBodyForce(nDim, nVar_Flow, config);}// TK Currently not implemented for compressible flow else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBoussinesq(nDim, nVar_Flow, config); else if (config->GetRotating_Frame() == YES) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 25e9f56ba54a..d78e7edbb9cb 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -891,21 +891,19 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { - /*--- Store the pointer to the constant body force vector. ---*/ + /*--- Store the pointer to the constant body force vector used in the momentum equations. ---*/ + implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); Body_Force_Vector = new su2double[nDim]; - su2double norm2_PBtranslate = 0.0; + su2double norm2_translation = 0.0; + su2double Pressure_Ref = config->GetPressure_Ref(); // TK check if pressure and force ref are the same for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_PBtranslate += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_translation*config->GetPeriodicTranslation(0)[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - if (config->GetPeriodicTranslation(0)[iDim] == 0) { - Body_Force_Vector[iDim] = 0.0; - } else { - Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_PBtranslate*config->GetPeriodicTranslation(0)[iDim]; - } - } // TK output has to be done differently or at least if rank==master cout << "Body force vector based on delta p: [ "; @@ -921,19 +919,27 @@ CSourceIncPeriodicBodyForce::~CSourceIncPeriodicBodyForce(void) { } -void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConfig *config) { +void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { - unsigned short iDim; - su2double DensityInc_0 = 0.0; - su2double Pressure_Ref = config->GetPressure_Ref(); // check if pressure and force ref are the same - su2double Temperature_Ref = config->GetTemperature_Ref(); - bool variable_density = (config->GetKind_DensityModel() == VARIABLE); + unsigned short iDim, iVar, jVar; + su2double norm2_translation = 0.0; + su2double dot_product = 0.0; + su2double Body_Force_T_factor; + //su2double DensityInc_0 = 0.0; + //bool variable_density = (config->GetKind_DensityModel() == VARIABLE); su2double Velocity[nDim]; for (iDim = 0; iDim < nDim; iDim++) Velocity[iDim] = V_i[iDim+1]; - su2double norm2_translation = 0.0; + /*--- Initialize the Jacobian contribution to zero ---*/ + + if (implicit) { + for (iVar=0; iVar < nVar; iVar++) { + for (jVar=0; jVar < nVar; jVar++) + Jacobian_i[iVar][jVar] = 0.0; + } + } /*--- Check for variable density. If we have a variable density problem, we should subtract out the hydrostatic pressure component. ---*/ @@ -951,25 +957,32 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, CConf /*--- Compute the periodic pressure contribution to the momentum equation ---*/ for (iDim = 0; iDim < nDim; iDim++) - val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref + val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim]; /*--- Compute the periodic temperature contribution to the energy equation ---*/ for (iDim = 0; iDim < nDim; iDim++) { norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - + if (config->GetEnergy_Equation()) { - su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / config->GetPeriodic_MassFlow("outlet") / norm2_translation; // TK HARDCODED inlet !!!! + Body_Force_T_factor = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / (config->GetPeriodic_MassFlow("outlet") * norm2_translation); // TK HARDCODED inlet !!!! for (iDim = 0; iDim < nDim; iDim++) { - val_residual[nDim+1] += Volume * Body_Force_T * Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim]; // TK maybe make it class var + dot_product += Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim]; + } + val_residual[nDim+1] = Volume * Body_Force_T_factor * dot_product; + + /*--- TK Jacobian contribution of energy equation periodic source term ---*/ + if (implicit) { + for (iDim = 0; iDim < nDim; iDim++) + Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * Body_Force_T_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why } } else { val_residual[nDim+1] = 0.0; } - + } CSourceBoussinesq::CSourceBoussinesq(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp index 47499cdc3a6d..cb3c9c0a1bb6 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -13676,17 +13676,18 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } - if (config->GetPeriodic_BC_Body_Force() == YES) { + /*--- Recovered p/T for streamwise periodic BC ---*/ + if (config->GetPeriodic_BC_Body_Force()) { /*--- TK Recovered p/T comp is already done in CIncNSSolver::Preprocessing() ---*/ Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetPressure_Recovered(); iVar++; - Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetTemperature_Recovered(); iVar++; + if(energy) { Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetTemperature_Recovered(); iVar++; } Local_Data[jPoint][iVar] = rank; iVar++; - } // body force bracket + } - } // low memory output bracket + } /*--- Increment the point counter, as there may have been halos we skipped over during the data loading. ---*/ diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 8a0763a93758..e6ce5e0c770a 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -3048,14 +3048,18 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->SetVolume(geometry->node[iPoint]->GetVolume()); - /*--- Compute the rotating frame source residual ---*/ + /*--- Compute the streamwise periodic source residual ---*/ - numerics->ComputeResidual(Residual, config); + numerics->ComputeResidual(Residual, Jacobian_i, config); /*--- Add the source residual to the total ---*/ LinSysRes.AddBlock(iPoint, Residual); + /*--- Add the implicit Jacobian contribution ---*/ + + if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); + } } @@ -10911,7 +10915,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi dT = fabs(Outlet_Density_Total[1] - Outlet_Density_Total[0]); if (iMesh == MESH_0) { - config->SetPeriodic_HeatfluxIntegrated(dT*config->GetPeriodic_MassFlow("outlet")*node[0]->GetSpecificHeatCp()); + if (config->GetExtIter() == 0) { config->SetPeriodic_HeatfluxIntegrated(3.1415); } // TK HARDCODED starting help with value from BC definition + else { config->SetPeriodic_HeatfluxIntegrated(dT*config->GetPeriodic_MassFlow("outlet")*node[0]->GetSpecificHeatCp());} } /*--- Screen output using the values already stored in the config container ---*/ @@ -10993,24 +10998,6 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - /*--- Get the specified wall heat flux from config ---*/ - su2double Wall_HeatFlux = 0.0; - - /*--- OPTION 1 for Heatflux calculation from config file ---*/ - Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); - - /*--- OPTION 2 for Heatflux calculation from computing actual heatflux ---*/ - su2double GradTemperature = 0.0; - // turn off for no energy equation - for (iDim = 0; iDim < nDim; iDim++) - GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal TK should it be unit normal here? - - su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); - Wall_HeatFlux = -thermal_conductivity*GradTemperature; - - /*--- END OPTIONS ---*/ - - Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; for (iDim = 0; iDim < nDim; iDim++) { @@ -11020,11 +11007,28 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; } Area = sqrt (Area); - + + /*--- Get the specified wall heat flux from config ---*/ + su2double Wall_HeatFlux = 0.0; + + /*--- OPTION 2 for Heatflux calculation from computing actual heatflux ---*/ + su2double GradTemperature = 0.0; + // turn off for no energy equation + for (iDim = 0; iDim < nDim; iDim++) // TK This would need to be done with recoverd Temperature!!! + GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal TK should it be unit normal here? A test with division by Area showed that the area normal is correct + + su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); + Wall_HeatFlux = -thermal_conductivity*GradTemperature; + + /*--- OPTION 1 for Heatflux calculation from config file ---*/ + Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + + /*--- END OPTIONS ---*/ + Outlet_MassFlow[iMarker] += MassFlow; Outlet_Density[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. Outlet_Area[iMarker] += Area; - + } } } @@ -11086,13 +11090,10 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } } - - if (iMesh == MESH_0) { config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); } - /*--- Screen output using the values already stored in the config container ---*/ if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { @@ -12203,47 +12204,56 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Compute recovered pressure and temperature for streamwise periodic BC ---*/ - if (config->GetPeriodic_BC_Body_Force() == YES) { + if (config->GetPeriodic_BC_Body_Force()) { /*--- Define and initialize helping variables ---*/ - su2double norm2_translation_vector; + + su2double norm2_translation; su2double dot_product; - su2double PerBoundNodeCoord[nDim]; // reference node on inlet periodic marker x^* + su2double Reference_node[nDim]; su2double Pressure_Recovered, Temperature_Recovered; + /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector ---*/ + for (iDim = 0; iDim < nDim; iDim++) - PerBoundNodeCoord[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + Reference_node[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + + /*--- Compute recoverd p/T for all points ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { - /*--- First, ompute correction based on relative distance (0,l) between periodic markers ---*/ - dot_product = 0.0; - norm2_translation_vector = 0.0; + /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ + + norm2_translation = 0.0; dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - dot_product += (geometry->node[iPoint]->GetCoord(iDim) - PerBoundNodeCoord[iDim]) * config->GetPeriodicTranslation(0)[iDim]; - norm2_translation_vector += config->GetPeriodicTranslation(0)[iDim]*config->GetPeriodicTranslation(0)[iDim]; // what is best for CoDi pow? + dot_product += fabs((geometry->node[iPoint]->GetCoord(iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - /*--- Second, substract correction from reduced pressure to get recoverd pressure ---*/ - Pressure_Recovered = node[iPoint]->GetSolution(0); - Pressure_Recovered -= (config->GetDeltaP_BodyForce())*dot_product/norm2_translation_vector; + /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ + + Pressure_Recovered = node[iPoint]->GetSolution(0) - config->GetDeltaP_BodyForce()*dot_product/norm2_translation; if (config->GetEnergy_Equation()) { Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); - if (config->GetExtIter() > 0) // TK TDE here we have to avoid a mdot = 0 (inf) - Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation_vector; // TK HARDCODED inlet !!!!! + + /*--- Avoid m_dot=0 in 0th iteration, as m_dot is in the denominator ---*/ + + if (config->GetExtIter() > 0) + Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation; // TK HARDCODED inlet !!!!! } - - //cout << iPoint << " " << Pressure_Recovered << " " << Temperature_Recovered<< endl; - node[iPoint]->SetPressure_Recovered(Pressure_Recovered); - node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); + /*--- Save the recovered values of p and T ---*/ + + node[iPoint]->SetPressure_Recovered(Pressure_Recovered); + if (config->GetEnergy_Equation()) node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); } + /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ + + GetPeriodic_Properties(geometry, config, iMesh, Output); } - - if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); - + /*--- Evaluate the vorticity and strain rate magnitude ---*/ StrainMag_Max = 0.0; Omega_Max = 0.0; @@ -13143,7 +13153,9 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai Res_Visc[nDim+1] = Wall_HeatFlux*Area; - // streamwise periodic + /*--- With streamwise periodic BC and heatflux walls an additional + term is introduced in the boundary formulation ---*/ + if (config->GetPeriodic_BC_Body_Force()) { su2double Cp = node[iPoint]->GetSpecificHeatCp(); @@ -13155,7 +13167,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * thermal_conductivity / config->GetPeriodic_MassFlow("outlet") / Cp / norm2_translation; // TK hardcoded - su2double dot_product = 0.0; // t*n*A , n is unitnormal, Normal here is n*A + su2double dot_product = 0.0; // TK t*n*A , n is unitnormal, Normal here is n*A for (iDim = 0; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } From 89b90fa8e1d67167365cc8a838e33b555c684ef2 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 10 Jan 2019 16:38:23 +0100 Subject: [PATCH 009/326] Added a testcase for pressure/momentum-eq only. travis adapted for feature branch. --- .travis.yml | 6 +- .../half_cylinder/streamwise_periodic.cfg | 263 ++++++++++++++++++ TestCases/parallel_regression.py | 11 + 3 files changed, 277 insertions(+), 3 deletions(-) create mode 100644 TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg mode change 100644 => 100755 TestCases/parallel_regression.py diff --git a/.travis.yml b/.travis.yml index dde5afddc384..322b643c995b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ compiler: notifications: email: recipients: - - su2code-dev@lists.stanford.edu + - tobias.kattmann@de.bosch.com branches: only: - - develop + - feature_periodic_streamwise python: - 2.7 @@ -82,7 +82,7 @@ install: before_script: # Get the test cases - - git clone -b develop https://github.com/su2code/TestCases.git ./TestData + - git clone -b feature_periodic_streamwise https://github.com/su2code/TestCases.git ./TestData - cp -R ./TestData/* ./TestCases/ # Get the tutorial cases diff --git a/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg b/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg new file mode 100644 index 000000000000..f31b31048631 --- /dev/null +++ b/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg @@ -0,0 +1,263 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Poiseuille flow case for testing a body force/periodicity % +% Author: Thomas D. Economon % +% Institution: Stanford University % +% Date: 2017.02.27 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +% +% Regime type (COMPRESSIBLE, INCOMPRESSIBLE, FREESURFACE) +REGIME_TYPE= INCOMPRESSIBLE +% +% If Navier-Stokes, kind of turbulent model (NONE, SA) +KIND_TURB_MODEL= NONE +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= NO +% +% Write binary restart files (YES, NO) +WRT_BINARY_RESTART= NO +% +% Read binary restart files (YES, NO) +READ_BINARY_RESTART= NO + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +% Reference origin for moment computation (m or in) +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +% +% Reference length for pitching, rolling, and yawing non-dimensional +% moment (m or in) +REF_LENGTH= 0.001 +% +% Reference area for force coefficients (0 implies automatic +% calculation) (m^2 or in^2) +REF_AREA= 1.0 +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. +INC_DENSITY_MODEL= CONSTANT +% +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = NO +% +% Initial density for incompressible flows +% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) +INC_DENSITY_INIT= 1.0 +% +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) +% +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= INITIAL_VALUES +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) +FLUID_MODEL= CONSTANT_DENSITY +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1e-4 +% +% ----------------------- BODY FORCE DEFINITION -------------------------------% +% +% Apply a body force as a source term (NO, YES) +BODY_FORCE= NO +% +% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) +BODY_FORCE_VECTOR= ( 1000.0, 0.0, 0.0 ) +% +% ----------------------- BODY FORCE FOR PERIODIC DEFINITION -------------------------------% +% +% Apply a body force as a source term (NO, YES) +PERIODIC_BC_BODY_FORCE= YES +% +% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) +DELTA_P_BODY_FORCE= 8.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_pin_interface, 0.0 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +MARKER_SYM= ( fluid_sym ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( inlet, outlet, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.008, 0.0, 0.0 ) +% +% Marker(s) of the surface to be plotted or designed +MARKER_PLOTTING= ( inlet ) +% +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= ( fluid_pin_interface ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +%MARKER_ANALYZE = ( inlet ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +%MARKER_ANALYZE_AVERAGE = AREA + +% Kind of adaptation (needed to create the initial periodic mesh) +%KIND_ADAPT= PERIODIC + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +% Courant-Friedrichs-Lewy condition of the finest grid +CFL_NUMBER= 1e5 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) +% +% Number of total iterations +EXT_ITER= 400 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver for implicit formulations (BCGSTAB, FGMRES) +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-15 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 20 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= FDS +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +% +% Coefficient for the limiter (smooth regions) +VENKAT_LIMITER_COEFF= 0.03 +% +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.5, 0.04 ) +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (CAUCHY, RESIDUAL) +% +CONV_CRITERIA= RESIDUAL +% +% Residual reduction (order of magnitude with respect to the initial value) +RESIDUAL_REDUCTION= 18 +% +% Min value of the residual (log10 of the residual) +RESIDUAL_MINVAL= -24 +% +% Start convergence criteria at iteration number +STARTCONV_ITER= 10 +% +% Number of elements to apply the criteria +CAUCHY_ELEMS= 100 +% +% Epsilon to control the series convergence +CAUCHY_EPS= 1E-6 +% +% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, +% SENS_MACH, DELTA_LIFT, DELTA_DRAG) +CAUCHY_FUNC_FLOW= DRAG + +% ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 +% +% Mesh input file +MESH_FILENAME= channel_bump_2D.su2 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FLOW_FILENAME= solution_flow.dat +% +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= solution_adj.dat +% +% Output file format (PARAVIEW, TECPLOT, STL) +OUTPUT_FORMAT= TECPLOT +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FLOW_FILENAME= restart_flow.dat +% +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat +% +% Output file flow (w/o extension) variables +VOLUME_FLOW_FILENAME= flow +% +% Output file adjoint (w/o extension) variables +VOLUME_ADJ_FILENAME= adjoint +% +% Output objective function gradient (using continuous adjoint) +GRAD_OBJFUNC_FILENAME= of_grad.dat +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FLOW_FILENAME= surface_flow +% +% Output file surface adjoint coefficient (w/o extension) +SURFACE_ADJ_FILENAME= surface_adjoint +% +% Writing solution file frequency +WRT_SOL_FREQ= 200 +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +WRT_RESIDUALS= YES diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py old mode 100644 new mode 100755 index dcb8decf4674..2412fe7cff34 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -338,6 +338,17 @@ def main(): inc_buoyancy.tol = 0.00001 test_list.append(inc_buoyancy) + # Laminar cylinder in channel, streamwise periodic + streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') + streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/half_cylinder" + streamwise_periodic_cylinder.cfg_file = "streamwise_periodic.cfg" + streamwise_periodic_cylinder.test_iter = 10 + streamwise_periodic_cylinder.test_vals = [-7.024390, -5.517378, 0.015077, 0.016414] #last 4 lines + streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" + streamwise_periodic_cylinder.timeout = 1600 + streamwise_periodic_cylinder.tol = 0.00001 + test_list.append(streamwise_periodic_cylinder) + ############################ ### Incompressible RANS ### ############################ From 49906e92af9fce5b9c54174e8b5460990473e75e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 10 Jan 2019 21:07:29 +0100 Subject: [PATCH 010/326] .travis change in tutorial repo that failed. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 322b643c995b..877568972f71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ before_script: - cp -R ./TestData/* ./TestCases/ # Get the tutorial cases - - git clone -b feature_pressure_inlet https://github.com/su2code/su2code.github.io ./Tutorials + - git clone -b develop https://github.com/su2code/su2code.github.io ./Tutorials # Enter the SU2/TestCases/ directory, which is now ready to run - cd TestCases/ From 752b42ef9fe898eac7d26980015b85d5b617154a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 14 Jan 2019 17:24:30 +0100 Subject: [PATCH 011/326] Added massflow specification for streamwise periodicty. --- Common/include/config_structure.hpp | 15 +++- Common/include/config_structure.inl | 4 + Common/src/config_structure.cpp | 6 +- SU2_CFD/include/numerics_structure.hpp | 3 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 41 ++++------ SU2_CFD/src/solver_direct_mean_inc.cpp | 100 ++++++++++++++++++++--- 6 files changed, 126 insertions(+), 43 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 52a184403dbd..5c54fad4d0df 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1055,6 +1055,7 @@ class CConfig { su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ bool Periodic_BC_Body_Force; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ su2double DeltaP_BodyForce; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + su2double Streamwise_periodic_massflow; /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ su2double *PeriodicRefNode_BodyForce; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ @@ -5997,10 +5998,22 @@ class CConfig { bool GetPeriodic_BC_Body_Force(void); /*! - * \brief Get a pointer to the pressure delta from which body force vector is computed. + * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. */ su2double GetDeltaP_BodyForce(void); + + /*! + * \brief Set the value of the pressure delta from which body force vector is computed. + * \param[in] delta_p - pressure difference between in- and outlet. + */ + void SetDeltaP_BodyForce(su2double delta_p); + +/*! + * \brief Get the value of the massflow from which body force vector is computed. + * \return Massflow for body force computation. + */ + su2double GetStreamwise_periodic_massflow(void); /*! * \brief Get a pointer to the reference node coordinate vector. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index c09aaa6a8db2..c9d572eb2ab0 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1648,6 +1648,10 @@ inline su2double* CConfig::GetBody_Force_Vector(void) { return Body_Force_Vector inline su2double CConfig::GetDeltaP_BodyForce(void) { return DeltaP_BodyForce; } +inline void CConfig::SetDeltaP_BodyForce(su2double delta_p) { DeltaP_BodyForce = delta_p; } + +inline su2double CConfig::GetStreamwise_periodic_massflow(void) { return Streamwise_periodic_massflow; } + inline su2double* CConfig::GetPeriodicRefNode_BodyForce(void) { return PeriodicRefNode_BodyForce; } inline void CConfig::SetPeriodicRefNode_BodyForce(su2double* RefNode, unsigned short nDim) { diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index c00dbd2f1136..a98865201cdc 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -760,8 +760,10 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NO, YES) */ addBoolOption("PERIODIC_BC_BODY_FORCE", Periodic_BC_Body_Force, false); - /* DESCRIPTION: Delta pressure on which basis body force will be computed */ - addDoubleOption("DELTA_P_BODY_FORCE", DeltaP_BodyForce, 0.0); + /* DESCRIPTION: Delta pressure on which basis body force will be computed */ // TK 1.0 is now the starting value for specified massflow, or simply the value that you specify + addDoubleOption("DELTA_P_BODY_FORCE", DeltaP_BodyForce, 1.0); + /* DESCRIPTION: Massflow basis body (via Delta P) force will be computed */ + addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_periodic_massflow, 0.0); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp index 4b30c0f1bcac..b887078cb0a4 100644 --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5274,8 +5274,7 @@ class CSourceIncBodyForce : public CNumerics { */ class CSourceIncPeriodicBodyForce : public CNumerics { bool implicit; /*!< \brief Implicit calculation. */ - su2double *Body_Force_Vector; /*!< \brief Additional source term vector in streamwise periodic comp for the momentum equations. */ - + public: /*! diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index d78e7edbb9cb..b66fd9e60e20 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -890,33 +890,13 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf } CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { - - /*--- Store the pointer to the constant body force vector used in the momentum equations. ---*/ implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - Body_Force_Vector = new su2double[nDim]; - su2double norm2_translation = 0.0; - su2double Pressure_Ref = config->GetPressure_Ref(); // TK check if pressure and force ref are the same - - for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_translation*config->GetPeriodicTranslation(0)[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref - - - // TK output has to be done differently or at least if rank==master - cout << "Body force vector based on delta p: [ "; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - cout << Body_Force_Vector[iDim] << " "; - } - cout << " ]" << endl; } CSourceIncPeriodicBodyForce::~CSourceIncPeriodicBodyForce(void) { - if (Body_Force_Vector != NULL) delete [] Body_Force_Vector; - } void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { @@ -924,7 +904,9 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2do unsigned short iDim, iVar, jVar; su2double norm2_translation = 0.0; su2double dot_product = 0.0; + su2double Body_Force_Vector[nDim]; su2double Body_Force_T_factor; + su2double Pressure_Ref = config->GetPressure_Ref(); // TK check if pressure and force ref are the same //su2double DensityInc_0 = 0.0; //bool variable_density = (config->GetKind_DensityModel() == VARIABLE); su2double Velocity[nDim]; @@ -932,6 +914,9 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2do for (iDim = 0; iDim < nDim; iDim++) Velocity[iDim] = V_i[iDim+1]; + for (iDim = 0; iDim < nDim; iDim++) + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + /*--- Initialize the Jacobian contribution to zero ---*/ if (implicit) { @@ -956,14 +941,20 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2do /*--- Compute the periodic pressure contribution to the momentum equation ---*/ + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_translation*config->GetPeriodicTranslation(0)[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref + for (iDim = 0; iDim < nDim; iDim++) val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim]; - /*--- Compute the periodic temperature contribution to the energy equation ---*/ + // TK output has to be done differently or at least if rank==master + //cout << "Body force vector based on delta p: [ "; + //for (unsigned short iDim = 0; iDim < nDim; iDim++) { + //cout << Body_Force_Vector[iDim] << " "; + //} + //cout << " ]" << endl; - for (iDim = 0; iDim < nDim; iDim++) { - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - } + /*--- Compute the periodic temperature contribution to the energy equation ---*/ if (config->GetEnergy_Equation()) { @@ -982,7 +973,7 @@ void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2do } else { val_residual[nDim+1] = 0.0; } - + } CSourceBoussinesq::CSourceBoussinesq(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 4a430078ae29..a9245cc4be0b 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -10877,7 +10877,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi bool axisymmetric = config->GetAxisymmetric(); - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*1)) == 0) + bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration && (config->GetExtIter()!= 0)) || (config->GetExtIter() == 1)); @@ -10896,9 +10896,10 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (Evaluate_BC) { - su2double *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Density = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Area = new su2double[config->GetnMarker_All()]; + su2double *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; + su2double *Outlet_Density = new su2double[config->GetnMarker_All()]; + su2double *Outlet_Temperature = new su2double[config->GetnMarker_All()]; + su2double *Outlet_Area = new su2double[config->GetnMarker_All()]; /*--- Comute MassFlow, average temp, press, etc. ---*/ @@ -10906,6 +10907,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Outlet_MassFlow[iMarker] = 0.0; Outlet_Density[iMarker] = 0.0; + Outlet_Temperature[iMarker] = 0.0; Outlet_Area[iMarker] = 0.0; if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) ) { @@ -10945,9 +10947,10 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Temperature = node[iPoint]->GetTemperature_Recovered(); //cout << iPoint << " " << Temperature << endl; - Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Temperature*Area; - Outlet_Area[iMarker] += Area; + Outlet_MassFlow[iMarker] += MassFlow; + Outlet_Density[iMarker] += Density*Area; + Outlet_Temperature[iMarker] += Temperature*Area; + Outlet_Area[iMarker] += Area; } } } @@ -10957,19 +10960,23 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi su2double *Outlet_MassFlow_Local = new su2double[nMarker_Outlet]; su2double *Outlet_Density_Local = new su2double[nMarker_Outlet]; + su2double *Outlet_Temperature_Local = new su2double[nMarker_Outlet]; su2double *Outlet_Area_Local = new su2double[nMarker_Outlet]; su2double *Outlet_MassFlow_Total = new su2double[nMarker_Outlet]; su2double *Outlet_Density_Total = new su2double[nMarker_Outlet]; + su2double *Outlet_Temperature_Total = new su2double[nMarker_Outlet]; su2double *Outlet_Area_Total = new su2double[nMarker_Outlet]; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; Outlet_Density_Local[iMarker_Outlet] = 0.0; + Outlet_Temperature_Local[iMarker_Outlet] = 0.0; Outlet_Area_Local[iMarker_Outlet] = 0.0; Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; Outlet_Density_Total[iMarker_Outlet] = 0.0; + Outlet_Temperature_Total[iMarker_Outlet] = 0.0; Outlet_Area_Total[iMarker_Outlet] = 0.0; } @@ -10983,6 +10990,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; + Outlet_Temperature_Local[iMarker_Outlet] += Outlet_Temperature[iMarker]; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; } } @@ -10995,6 +11003,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); #else @@ -11002,6 +11011,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; + Outlet_Temperature_Total[iMarker_Outlet] = Outlet_Temperature_Local[iMarker_Outlet]; Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; } @@ -11010,13 +11020,17 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; + Outlet_Temperature_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; } else { Outlet_Density_Total[iMarker_Outlet] = 0.0; + Outlet_Temperature_Total[iMarker_Outlet] = 0.0; } if (iMesh == MESH_0) { config->SetPeriodic_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); + config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); // TK maybe use own function here, but otherwise no problem + config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); // TK maybe use own function here, but otherwise no problem } } @@ -11024,7 +11038,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi // OPTION 3 compute energy Q via inlet and outlet bulk temperature, after FLuent way bulk tmep is not computed correctly // HARD CODED for 2 markers and the absolutr value should not be here!!! TDE su2double dT = 0.0; - dT = fabs(Outlet_Density_Total[1] - Outlet_Density_Total[0]); + dT = fabs(Outlet_Temperature_Total[1] - Outlet_Temperature_Total[0]); // TK !! Here was Density before as the container was used for that if (iMesh == MESH_0) { if (config->GetExtIter() == 0) { config->SetPeriodic_HeatfluxIntegrated(3.1415); } // TK HARDCODED starting help with value from BC definition @@ -11079,6 +11093,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi Outlet_MassFlow[iMarker] = 0.0; Outlet_Density[iMarker] = 0.0; + Outlet_Temperature[iMarker] = 0.0; Outlet_Area[iMarker] = 0.0; if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { // This if-clause can be omitted for OPTION 2 @@ -11138,7 +11153,8 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi /*--- END OPTIONS ---*/ Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. + Outlet_Density[iMarker] += Density*Area; + Outlet_Temperature[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. Outlet_Area[iMarker] += Area; } @@ -11152,10 +11168,12 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; Outlet_Density_Local[iMarker_Outlet] = 0.0; + Outlet_Temperature_Local[iMarker_Outlet] = 0.0; Outlet_Area_Local[iMarker_Outlet] = 0.0; Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; Outlet_Density_Total[iMarker_Outlet] = 0.0; + Outlet_Temperature_Total[iMarker_Outlet] = 0.0; Outlet_Area_Total[iMarker_Outlet] = 0.0; } @@ -11169,7 +11187,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; - //cout << "Outlet_Density_Local: " << Outlet_Density_Local[iMarker_Outlet] << endl; + Outlet_Temperature_Local[iMarker_Outlet] += Outlet_Temperature[iMarker]; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; } } @@ -11182,6 +11200,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); #else @@ -11189,16 +11208,24 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; + Outlet_Temperature_Total[iMarker_Outlet] = Outlet_Temperature_Local[iMarker_Outlet]; Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; } #endif - + for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - + if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { + Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; + } + else { + Outlet_Density_Total[iMarker_Outlet] = 0.0; + } + if (iMesh == MESH_0) { config->SetPeriodic_Heatflux(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); - Heatflux_Integrated += Outlet_Density_Total[iMarker_Outlet]; + //Heatflux_Integrated += Outlet_Density_Total[iMarker_Outlet]; // TK changing to dedicated T container + Heatflux_Integrated += Outlet_Temperature_Total[iMarker_Outlet]; } } @@ -11239,17 +11266,64 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi } + /*--- Compute Update for Delta P if a massflow is prescribed for streamwise periodic BC ---*/ + + if (config->GetStreamwise_periodic_massflow() != 0.0) { + + /*--- Load/define all necessary variables ---*/ + + su2double Delta_P_old = config->GetDeltaP_BodyForce() / config->GetPressure_Ref(); // Nondimensionalize the dimensional cfg value + su2double Delta_P; + su2double Density_avg = config->GetOutlet_Density("outlet"); + su2double Area = config->GetOutlet_Area("outlet"); + su2double Massflow = config->GetPeriodic_MassFlow("outlet"); + su2double target_Massflow = config->GetStreamwise_periodic_massflow()/(config->GetDensity_Ref() * config->GetVelocity_Ref()); // Nondimensionalize the dimensional cfg value + su2double ddP; + su2double Damping = config->GetInc_Outlet_Damping(); + + /*--- Compute update to Delta p based on massflow-difference ---*/ + ddP = 0.5 / ( Density_avg * Area*Area) * (target_Massflow*target_Massflow - Massflow*Massflow); + + /*--- Store updated pressure difference ---*/ + Delta_P = Delta_P_old + Damping*ddP; + config->SetDeltaP_BodyForce(Delta_P); + + /*--- Output the new value of Delta P and ddp ---*/ + + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK Move whole computation up in front of output + + cout.precision(5); + cout.setf(ios::fixed, ios::floatfield); + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) { + cout << endl << "---------------------------- Streamwise periodic pressure: massflow update --------------------------" << endl; + } + + cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; + cout << "New Delta P: " << Delta_P * config->GetPressure_Ref() << endl; + + if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; + cout << "-------------------------------------------------------------------------" << endl << endl; + } + + cout.unsetf(ios_base::floatfield); + + } + } delete [] Outlet_MassFlow_Local; delete [] Outlet_Density_Local; + delete [] Outlet_Temperature_Local; delete [] Outlet_Area_Local; delete [] Outlet_MassFlow_Total; delete [] Outlet_Density_Total; + delete [] Outlet_Temperature_Total; delete [] Outlet_Area_Total; delete [] Outlet_MassFlow; delete [] Outlet_Density; + delete [] Outlet_Temperature; delete [] Outlet_Area; } From f7e5209d4ed0ac3faef9fc43ce04dd2ca64dbe90 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 23 Jan 2019 18:20:39 +0100 Subject: [PATCH 012/326] Added velocity correction for sym BC in the incompressible solver. Still diverging. --- SU2_CFD/include/variable_structure.hpp | 12 ++++ SU2_CFD/include/variable_structure.inl | 7 +++ SU2_CFD/src/integration_time.cpp | 2 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 87 +++++++++++++++++++++++--- 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/SU2_CFD/include/variable_structure.hpp b/SU2_CFD/include/variable_structure.hpp index d72c55fa3873..68206f9b9e3e 100644 --- a/SU2_CFD/include/variable_structure.hpp +++ b/SU2_CFD/include/variable_structure.hpp @@ -1579,6 +1579,12 @@ class CVariable { */ virtual void SetVelocity_Old(su2double *val_velocity); + /*! + * \brief A virtual member. + * \param[in] val_velocity - Pointer to the velocity. + */ + virtual void SetVelocity(su2double *val_velocity); + /*! * \brief A virtual member. * \param[in] laminarViscosity @@ -3831,6 +3837,12 @@ class CIncEulerVariable : public CVariable { */ void SetVelocity_Old(su2double *val_velocity); + /*! + * \brief Set the velocity vector from the solution. + * \param[in] val_velocity - Pointer to the velocity. + */ + void SetVelocity(su2double *val_velocity); + /*! * \brief Set all the primitive variables for incompressible flows. */ diff --git a/SU2_CFD/include/variable_structure.inl b/SU2_CFD/include/variable_structure.inl index 9a504b8449d9..6f976b780c21 100644 --- a/SU2_CFD/include/variable_structure.inl +++ b/SU2_CFD/include/variable_structure.inl @@ -445,6 +445,8 @@ inline void CVariable::SetVelocity2(void) { } inline void CVariable::SetVelocity_Old(su2double *val_velocity) { } +inline void CVariable::SetVelocity(su2double *val_velocity) { } + inline void CVariable::SetVel_ResTruncError_Zero(unsigned short iSpecies) { } inline void CVariable::SetLaminarViscosity(su2double laminarViscosity) { } @@ -1019,6 +1021,11 @@ inline void CIncEulerVariable::SetVelocity_Old(su2double *val_velocity) { Solution_Old[iDim+1] = val_velocity[iDim]; } +inline void CIncEulerVariable::SetVelocity(su2double *val_velocity) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Solution[iDim+1] = val_velocity[iDim]; +} + inline void CIncEulerVariable::AddGradient_Primitive(unsigned short val_var, unsigned short val_dim, su2double val_value) { Gradient_Primitive[val_var][val_dim] += val_value; } inline void CIncEulerVariable::SubtractGradient_Primitive(unsigned short val_var, unsigned short val_dim, su2double val_value) { Gradient_Primitive[val_var][val_dim] -= val_value; } diff --git a/SU2_CFD/src/integration_time.cpp b/SU2_CFD/src/integration_time.cpp index 56957d151e3a..5df00c9381e3 100644 --- a/SU2_CFD/src/integration_time.cpp +++ b/SU2_CFD/src/integration_time.cpp @@ -195,7 +195,7 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, /*--- Send-Receive boundary conditions, and postprocessing ---*/ - solver_container[iZone][iInst][iMesh][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh); + solver_container[iZone][iInst][iMesh][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh); // TK CIncEulerSolver::Postprocessing called from here } diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index a9245cc4be0b..b4162989ccd4 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2708,7 +2708,78 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai } void CIncEulerSolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) { } + unsigned short iMesh) { + + int test = 0; + cout << "CIncEulerSolver::Postprocessing" << endl; + //cin >> test; + /*--- Define necessary variables ---*/ + unsigned short iMarker, Kind_BC, iDim; + unsigned long iPoint, iVertex; + su2double Area, dot_product, Velocity[3]; + su2double *AreaNormal, *UnitNormal, *Vector; + AreaNormal = new su2double[nDim]; + UnitNormal = new su2double[nDim]; + Vector = new su2double[nDim]; + + /*--- Loop over all Euler_Wall/Symmetry_Plane marker ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + Kind_BC = config->GetMarker_All_KindBC(iMarker); + if ((Kind_BC == SYMMETRY_PLANE) || (Kind_BC == EULER_WALL)) { + + /*--- Loop over all vertices on the marker ---*/ + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + + if (geometry->node[iPoint]->GetDomain()) { + test++; + /*--- Compute outward facing unit normal ---*/ + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); + + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) Area += AreaNormal[iDim]*AreaNormal[iDim]; + Area = sqrt (Area); + + for (iDim = 0; iDim < nDim; iDim++) { + UnitNormal[iDim] = -AreaNormal[iDim]/Area; + } + /*--- Get Velocity and compute required dot product ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + Velocity[iDim] = node[iPoint]->GetVelocity(iDim); + } + + dot_product = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + dot_product += Velocity[iDim] * UnitNormal[iDim]; + } + /*---Compute velocity correction to in order to fullfill v \cdot n = 0 + * and set Primitive ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + Vector[iDim] = Velocity[iDim] - dot_product * UnitNormal[iDim]; + } + + /*--- Where to set the corrected velocity? ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + node[iPoint]->SetPrimitive(iDim+1, Vector[iDim]); //This does nothing! + } + //node[iPoint]->SetVelocity(Vector); // Set Solution directly + } + } + } + } + cout << "Sym vertex counter: " << test << endl; + + delete [] AreaNormal; + delete [] UnitNormal; + delete [] Vector; + +}//TK implement correction here unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { @@ -3139,11 +3210,11 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; if (body_force || periodic_bc_body_force) { - + /*--- Loop over all points ---*/ - + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - + /*--- Load the conservative variables ---*/ numerics->SetConservative(node[iPoint]->GetSolution(), @@ -5641,7 +5712,7 @@ void CIncEulerSolver::BC_Euler_Wall(CGeometry *geometry, CSolver **solver_contai if (geometry->node[iPoint]->GetDomain()) { - /*--- Normal vector for this vertex (negative for outward convention) ---*/ + /*--- Normal vector for this vertex (negative for outward convention) ---*/ //TK is the normal vector averaged? geometry->vertex[val_marker][iVertex]->GetNormal(Normal); @@ -5660,7 +5731,7 @@ void CIncEulerSolver::BC_Euler_Wall(CGeometry *geometry, CSolver **solver_contai Residual[0] = 0.0; for (iDim = 0; iDim < nDim; iDim++) - Residual[iDim+1] = Pressure*NormalArea[iDim]; + Residual[iDim+1] = Pressure*NormalArea[iDim]; //TK Here maybe Residual[iDim+1] = Pressure*UnitNormal[iDim]*Area; but that is exactly whats happening Residual[nDim+1] = 0.0; /*--- Add the Reynolds stress tensor contribution ---*/ @@ -13304,7 +13375,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai /*--- Initialize the convective & viscous residuals to zero ---*/ for (iVar = 0; iVar < nVar; iVar++) { - Res_Conv[iVar] = 0.0; + Res_Conv[iVar] = 0.0; // TK Not used after that in this function ?? Res_Visc[iVar] = 0.0; if (implicit) { for (jVar = 0; jVar < nVar; jVar++) @@ -13326,7 +13397,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai condition (Dirichlet). Fix the velocity and remove any contribution to the residual at this node. ---*/ - node[iPoint]->SetVelocity_Old(Vector); + node[iPoint]->SetVelocity_Old(Vector); // TK Why _Old? Is there a solution copying directly afterwards? for (iDim = 0; iDim < nDim; iDim++) LinSysRes.SetBlock_Zero(iPoint, iDim+1); From db004645ef31080ab61afad40a1c1e8b9698f1c6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 28 Feb 2019 17:08:13 +0100 Subject: [PATCH 013/326] Merged corrected sym_plane_BC. Cleaned code parts from unnecessary comments and allocations. --- SU2_CFD/include/numerics_structure.hpp | 7 +- SU2_CFD/include/variable_structure.hpp | 2 +- SU2_CFD/src/driver_structure.cpp | 2 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 78 ++--- SU2_CFD/src/numerics_structure.cpp | 35 ++- SU2_CFD/src/solver_direct_mean.cpp | 4 +- SU2_CFD/src/solver_direct_mean_fem.cpp | 2 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 383 ++++++++++++++++------- 8 files changed, 318 insertions(+), 195 deletions(-) diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp index b887078cb0a4..85302b53028a 100644 --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5272,8 +5272,9 @@ class CSourceIncBodyForce : public CNumerics { * \author T. Economon * \version 6.1.0 "Falcon" */ -class CSourceIncPeriodicBodyForce : public CNumerics { +class CSourceIncStreamwise_Periodic : public CNumerics { bool implicit; /*!< \brief Implicit calculation. */ + su2double norm2_translation; /*!< \brief Square of distance between the 2 periodic surfaces. */ public: @@ -5282,12 +5283,12 @@ class CSourceIncPeriodicBodyForce : public CNumerics { * \param[in] val_nVar - Number of variables of the problem. * \param[in] config - Definition of the particular problem. */ - CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config); + CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config); /*! * \brief Destructor of the class. */ - ~CSourceIncPeriodicBodyForce(void); + ~CSourceIncStreamwise_Periodic(void); /*! * \brief Source term integration for a body force. diff --git a/SU2_CFD/include/variable_structure.hpp b/SU2_CFD/include/variable_structure.hpp index 68206f9b9e3e..9c6860650ee3 100644 --- a/SU2_CFD/include/variable_structure.hpp +++ b/SU2_CFD/include/variable_structure.hpp @@ -3159,7 +3159,7 @@ class CEulerVariable : public CVariable { /*--- Secondary variable definition ---*/ - su2double *Secondary; /*!< \brief Primitive variables (T, vx, vy, vz, P, rho, h, c) in compressible flows. */ + su2double *Secondary; /*!< \brief Primitive variables (T, vx, vy, vz, P, rho, h, c) in compressible flows. */ //TK wrong adapt su2double **Gradient_Secondary; /*!< \brief Gradient of the primitive variables (T, vx, vy, vz, P, rho). */ su2double *Limiter_Secondary; /*!< \brief Limiter of the primitive variables (T, vx, vy, vz, P, rho). */ diff --git a/SU2_CFD/src/driver_structure.cpp b/SU2_CFD/src/driver_structure.cpp index 23bba63df8e3..480d4fe1e77a 100644 --- a/SU2_CFD/src/driver_structure.cpp +++ b/SU2_CFD/src/driver_structure.cpp @@ -2307,7 +2307,7 @@ void CDriver::Numerics_Preprocessing(CNumerics *****numerics_container, if (incompressible) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBodyForce(nDim, nVar_Flow, config); else if (incompressible && (config->GetPeriodic_BC_Body_Force() == YES)) - numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncPeriodicBodyForce(nDim, nVar_Flow, config); // TK Currently not implemented for compressible flow + numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBoussinesq(nDim, nVar_Flow, config); else if (config->GetRotating_Frame() == YES) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index b66fd9e60e20..f6e072830868 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -889,90 +889,62 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf } -CSourceIncPeriodicBodyForce::CSourceIncPeriodicBodyForce(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { +CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + /*--- Compute square of the distance between the 2 periodic surfaces ---*/ + norm2_translation = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } -CSourceIncPeriodicBodyForce::~CSourceIncPeriodicBodyForce(void) { +CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { } -void CSourceIncPeriodicBodyForce::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { +void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { unsigned short iDim, iVar, jVar; - su2double norm2_translation = 0.0; - su2double dot_product = 0.0; - su2double Body_Force_Vector[nDim]; - su2double Body_Force_T_factor; - su2double Pressure_Ref = config->GetPressure_Ref(); // TK check if pressure and force ref are the same - //su2double DensityInc_0 = 0.0; - //bool variable_density = (config->GetKind_DensityModel() == VARIABLE); - su2double Velocity[nDim]; - - for (iDim = 0; iDim < nDim; iDim++) - Velocity[iDim] = V_i[iDim+1]; - - for (iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - + su2double Body_Force; + /*--- Initialize the Jacobian contribution to zero ---*/ - if (implicit) { - for (iVar=0; iVar < nVar; iVar++) { + for (iVar=0; iVar < nVar; iVar++) for (jVar=0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - } } - /*--- Check for variable density. If we have a variable density - problem, we should subtract out the hydrostatic pressure component. ---*/ - - //if (variable_density) DensityInc_0 = config->GetDensity_FreeStreamND(); <- think about that - - /*--- Zero the continuity contribution ---*/ + // TK What in the case of variable density. Substract Freestream density i.e. hydrostatic pressure? + /*--- No contribution in the continuity equation ---*/ val_residual[0] = 0.0; - /*--- Momentum contribution. Note that this form assumes we have - subtracted the operating density * gravity, i.e., removed the - hydrostatic pressure component (important for pressure BCs). ---*/ - - /*--- Compute the periodic pressure contribution to the momentum equation ---*/ - - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Body_Force_Vector[iDim] = config->GetDeltaP_BodyForce()/norm2_translation*config->GetPeriodicTranslation(0)[iDim] / Pressure_Ref; // TK check if pres_ref is the same as force ref - - for (iDim = 0; iDim < nDim; iDim++) - val_residual[iDim+1] = -Volume * Body_Force_Vector[iDim]; - - // TK output has to be done differently or at least if rank==master - //cout << "Body force vector based on delta p: [ "; - //for (unsigned short iDim = 0; iDim < nDim; iDim++) { - //cout << Body_Force_Vector[iDim] << " "; - //} - //cout << " ]" << endl; + /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + Body_Force = ( config->GetDeltaP_BodyForce()/config->GetPressure_Ref() ) / norm2_translation * config->GetPeriodicTranslation(0)[iDim]; // TK check if pres_ref is the same as force ref, TK is the (0) hardcoded? + val_residual[iDim+1] = -Volume * Body_Force; + } - /*--- Compute the periodic temperature contribution to the energy equation ---*/ - + /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ + val_residual[nDim+1] = 0.0; if (config->GetEnergy_Equation()) { - Body_Force_T_factor = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / (config->GetPeriodic_MassFlow("outlet") * norm2_translation); // TK HARDCODED inlet !!!! + su2double Body_Force_T_factor = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / (config->GetPeriodic_MassFlow("outlet") * norm2_translation); // TK hardcoded outlet! + /*--- Compute scalar-product v*t ---*/ + su2double dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - dot_product += Velocity[iDim] * config->GetPeriodicTranslation(0)[iDim]; + dot_product += V_i[iDim+1] * config->GetPeriodicTranslation(0)[iDim]; } val_residual[nDim+1] = Volume * Body_Force_T_factor * dot_product; - /*--- TK Jacobian contribution of energy equation periodic source term ---*/ + /*--- Jacobian contribution of energy equation periodic source term ---*/ if (implicit) { for (iDim = 0; iDim < nDim; iDim++) Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * Body_Force_T_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why } - } else { - val_residual[nDim+1] = 0.0; - } + } // Energy } diff --git a/SU2_CFD/src/numerics_structure.cpp b/SU2_CFD/src/numerics_structure.cpp index 56a5a4d9d326..0479829439ab 100644 --- a/SU2_CFD/src/numerics_structure.cpp +++ b/SU2_CFD/src/numerics_structure.cpp @@ -278,8 +278,10 @@ CNumerics::~CNumerics(void) { } -void CNumerics::GetInviscidFlux(su2double val_density, su2double *val_velocity, - su2double val_pressure, su2double val_enthalpy) { +void CNumerics::GetInviscidFlux(su2double val_density, + su2double *val_velocity, + su2double val_pressure, + su2double val_enthalpy) { if (nDim == 3) { Flux_Tensor[0][0] = val_density*val_velocity[0]; Flux_Tensor[1][0] = Flux_Tensor[0][0]*val_velocity[0]+val_pressure; @@ -1806,11 +1808,13 @@ void CNumerics::GetViscousFlux(su2double *val_primvar, su2double **val_gradprimv void CNumerics::GetViscousProjFlux(su2double *val_primvar, - su2double **val_gradprimvar, su2double val_turb_ke, - su2double *val_normal, - su2double val_laminar_viscosity, - su2double val_eddy_viscosity, - su2double val_tau_wall, bool val_qcr) { + su2double **val_gradprimvar, + su2double val_turb_ke, + su2double *val_normal, + su2double val_laminar_viscosity, + su2double val_eddy_viscosity, + su2double val_tau_wall, + bool val_qcr) { unsigned short iVar, iDim, jDim; su2double total_viscosity, heat_flux_factor, div_vel, Cp, Density; @@ -1956,7 +1960,8 @@ void CNumerics::GetViscousProjFlux(su2double *val_primvar, } void CNumerics::GetViscousProjFlux(su2double *val_primvar, - su2double **val_gradprimvar, su2double val_turb_ke, + su2double **val_gradprimvar, + su2double val_turb_ke, su2double *val_normal, su2double val_laminar_viscosity, su2double val_eddy_viscosity, @@ -2026,12 +2031,12 @@ void CNumerics::GetViscousProjFlux(su2double *val_primvar, } void CNumerics::GetViscousIncProjFlux(su2double *val_primvar, - su2double **val_gradprimvar, - su2double *val_normal, - su2double val_laminar_viscosity, - su2double val_eddy_viscosity, - su2double val_turb_ke, - su2double val_thermal_conductivity) { + su2double **val_gradprimvar, + su2double *val_normal, + su2double val_laminar_viscosity, + su2double val_eddy_viscosity, + su2double val_turb_ke, + su2double val_thermal_conductivity) { unsigned short iVar, iDim, jDim; su2double total_viscosity, div_vel, Density; @@ -2053,7 +2058,7 @@ void CNumerics::GetViscousIncProjFlux(su2double *val_primvar, -TWO3*total_viscosity*div_vel*delta[iDim][jDim] -TWO3*Density*val_turb_ke*delta[iDim][jDim]); - /*--- Gradient of primitive variables -> [Pressure vel_x vel_y vel_z Temperature] ---*/ + /*--- Gradient of primitive variables -> [Pressure vel_x vel_y vel_z Temperature] ---*/ // TK ?? if (nDim == 2) { Flux_Tensor[0][0] = 0.0; diff --git a/SU2_CFD/src/solver_direct_mean.cpp b/SU2_CFD/src/solver_direct_mean.cpp index e71335bf42ba..c31b637da5c6 100644 --- a/SU2_CFD/src/solver_direct_mean.cpp +++ b/SU2_CFD/src/solver_direct_mean.cpp @@ -12692,7 +12692,7 @@ void CEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, /*--- Call the Euler residual ---*/ BC_Euler_Wall(geometry, solver_container, conv_numerics, config, val_marker); - + } void CEulerSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, @@ -21261,7 +21261,7 @@ void CNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_contain for (iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] = -Normal[iDim]/Area; - /*--- Calculate useful quantities ---*/ + /*--- Calculate useful quantities ---*/ //TK How could this be useful?? square of 2-norm should always be one! theta2 = 0.0; for (iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/src/solver_direct_mean_fem.cpp b/SU2_CFD/src/solver_direct_mean_fem.cpp index 319b0b34b454..0829646acb8b 100644 --- a/SU2_CFD/src/solver_direct_mean_fem.cpp +++ b/SU2_CFD/src/solver_direct_mean_fem.cpp @@ -14572,7 +14572,7 @@ void CFEM_DG_NSSolver::BC_Sym_Plane(CConfig *config, GradCartNormMomL[0] = ULGradCart[1][0]*normals[0] + ULGradCart[2][0]*normals[1]; GradCartNormMomL[1] = ULGradCart[1][1]*normals[0] + ULGradCart[2][1]*normals[1]; - const su2double GradNormNormMomL = ULGradNorm[1]*normals[0] + ULGradNorm[2]*normals[1]; + const su2double GradNormNormMomL = ULGradNorm[1]*normals[0] + ULGradNorm[2]*normals[1]; // why not GradCartNormMomL here instead of ULGradNorm...same but makes more sense /* Abbreviate twice the normal vector. */ const su2double tnx = 2.0*normals[0], tny = 2.0*normals[1]; diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index b4162989ccd4..2fb93610ff14 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2687,7 +2687,7 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- TK ---*/ + /*--- Compute integrated Heatflux and massflow, TK Euler equations not implemented yet ---*/ if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); @@ -2708,78 +2708,7 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai } void CIncEulerSolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) { - - int test = 0; - cout << "CIncEulerSolver::Postprocessing" << endl; - //cin >> test; - /*--- Define necessary variables ---*/ - unsigned short iMarker, Kind_BC, iDim; - unsigned long iPoint, iVertex; - su2double Area, dot_product, Velocity[3]; - su2double *AreaNormal, *UnitNormal, *Vector; - AreaNormal = new su2double[nDim]; - UnitNormal = new su2double[nDim]; - Vector = new su2double[nDim]; - - /*--- Loop over all Euler_Wall/Symmetry_Plane marker ---*/ - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - Kind_BC = config->GetMarker_All_KindBC(iMarker); - if ((Kind_BC == SYMMETRY_PLANE) || (Kind_BC == EULER_WALL)) { - - /*--- Loop over all vertices on the marker ---*/ - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - - if (geometry->node[iPoint]->GetDomain()) { - test++; - /*--- Compute outward facing unit normal ---*/ - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); - - Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) Area += AreaNormal[iDim]*AreaNormal[iDim]; - Area = sqrt (Area); - - for (iDim = 0; iDim < nDim; iDim++) { - UnitNormal[iDim] = -AreaNormal[iDim]/Area; - } - /*--- Get Velocity and compute required dot product ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - Velocity[iDim] = node[iPoint]->GetVelocity(iDim); - } - - dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - dot_product += Velocity[iDim] * UnitNormal[iDim]; - } - /*---Compute velocity correction to in order to fullfill v \cdot n = 0 - * and set Primitive ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - Vector[iDim] = Velocity[iDim] - dot_product * UnitNormal[iDim]; - } - - /*--- Where to set the corrected velocity? ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - node[iPoint]->SetPrimitive(iDim+1, Vector[iDim]); //This does nothing! - } - //node[iPoint]->SetVelocity(Vector); // Set Solution directly - } - } - } - } - cout << "Sym vertex counter: " << test << endl; - - delete [] AreaNormal; - delete [] UnitNormal; - delete [] Vector; - -}//TK implement correction here + unsigned short iMesh) { } unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { @@ -3200,7 +3129,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool rotating_frame = config->GetRotating_Frame(); bool axisymmetric = config->GetAxisymmetric(); bool body_force = config->GetBody_Force(); - bool periodic_bc_body_force = config->GetPeriodic_BC_Body_Force(); + bool streamwise_periodic = config->GetPeriodic_BC_Body_Force(); bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); bool viscous = config->GetViscous(); @@ -3209,7 +3138,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - if (body_force || periodic_bc_body_force) { + if (body_force || streamwise_periodic) { /*--- Loop over all points ---*/ @@ -5712,7 +5641,7 @@ void CIncEulerSolver::BC_Euler_Wall(CGeometry *geometry, CSolver **solver_contai if (geometry->node[iPoint]->GetDomain()) { - /*--- Normal vector for this vertex (negative for outward convention) ---*/ //TK is the normal vector averaged? + /*--- Normal vector for this vertex (negative for outward convention) ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); @@ -5731,7 +5660,7 @@ void CIncEulerSolver::BC_Euler_Wall(CGeometry *geometry, CSolver **solver_contai Residual[0] = 0.0; for (iDim = 0; iDim < nDim; iDim++) - Residual[iDim+1] = Pressure*NormalArea[iDim]; //TK Here maybe Residual[iDim+1] = Pressure*UnitNormal[iDim]*Area; but that is exactly whats happening + Residual[iDim+1] = Pressure*NormalArea[iDim]; Residual[nDim+1] = 0.0; /*--- Add the Reynolds stress tensor contribution ---*/ @@ -6368,13 +6297,240 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, } -void CIncEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { +void CIncEulerSolver::BC_Sym_Plane(CGeometry *geometry, + CSolver **solver_container, + CNumerics *conv_numerics, + CNumerics *visc_numerics, + CConfig *config, + unsigned short val_marker) { - /*--- Call the Euler wall residual method. ---*/ + unsigned short iDim, iVar; + unsigned long iVertex, iPoint; + + bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + + su2double ProjVelocity_i, ProjGradient; + su2double *V_reflected, *V_domain; + + su2double *Normal = new su2double[nDim]; + su2double *UnitNormal = new su2double[nDim]; + su2double *Tangential = new su2double[nDim]; + + /*--- Allocation of primitive gradient arrays. ---*/ + su2double **Grad_Reflected = new su2double*[nPrimVarGrad]; + su2double **Grad_Prim = new su2double*[nPrimVarGrad]; + for (iVar = 0; iVar < nPrimVarGrad; iVar++) { + Grad_Reflected[iVar] = new su2double[nDim]; + Grad_Prim[iVar] = new su2double[nDim]; + } + + /*--- Loop over all the vertices on this boundary marker. ---*/ + for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { + + iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + + /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ + if (geometry->node[iPoint]->GetDomain()) { + + /*-------------------------------------------------------------------------------*/ + /*--- Step 1: For the convective fluxes, create a reflected state of the ---*/ + /*--- Primitive variables by copying all interior values to the ---*/ + /*--- reflected. Only the velocity is mirrored along the symmetry ---*/ + /*--- axis. Based on the Upwind_Residual routine. ---*/ + /*-------------------------------------------------------------------------------*/ + + /*--- Allocate the reflected state at the symmetry boundary. ---*/ + V_reflected = GetCharacPrimVar(val_marker, iVertex); + + /*--- Grid movement ---*/ + if (config->GetGrid_Movement()) + conv_numerics->SetGridVel(geometry->node[iPoint]->GetGridVel(), geometry->node[iPoint]->GetGridVel()); + + /*--- Normal vector for this vertex (negate for outward convention). ---*/ + geometry->vertex[val_marker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) + Normal[iDim] = -Normal[iDim]; + conv_numerics->SetNormal(Normal); + + /*--- Compute unit normal, to be used for projected velocity and velocity component gradients. ---*/ + su2double Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + Area += Normal[iDim]*Normal[iDim]; + Area = sqrt(Area); + + for (iDim = 0; iDim < nDim; iDim++) + UnitNormal[iDim] = -Normal[iDim]/Area; + + /*--- Get current solution at this boundary node ---*/ + V_domain = node[iPoint]->GetPrimitive(); + + /*--- Set the reflected state based on the boundary node. Scalars are copied and + the velocity is mirrored along the symmetry boundary, i.e. the velocity in + normal direction is substracted twice. ---*/ + for(iVar = 0; iVar < nPrimVar; iVar++) + V_reflected[iVar] = node[iPoint]->GetPrimitive(iVar); + + /*--- Compute velocity in normal direction (ProjVelcity_i=(v*n)) und substract twice from + velocity in normal direction: v_r = v - 2 (v*n)n ---*/ + ProjVelocity_i = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + ProjVelocity_i += node[iPoint]->GetVelocity(iDim)*UnitNormal[iDim]; + + for (iDim = 0; iDim < nDim; iDim++) + V_reflected[iDim+1] = node[iPoint]->GetVelocity(iDim) - 2.0 * ProjVelocity_i*UnitNormal[iDim]; + + /*--- Set Primitive and Secondary for numerics class. ---*/ + conv_numerics->SetPrimitive(V_domain, V_reflected); + conv_numerics->SetSecondary(node[iPoint]->GetSecondary(), node[iPoint]->GetSecondary()); + + /*--- Compute the residual using an upwind scheme. ---*/ + conv_numerics->ComputeResidual(Residual, Jacobian_i, Jacobian_j, config); + + /*--- Update residual value ---*/ + LinSysRes.AddBlock(iPoint, Residual); + + /*--- Jacobian contribution for implicit integration. ---*/ + if (implicit) { + Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); + } + + /*-------------------------------------------------------------------------------*/ + /*--- Step 2: The viscous fluxes of the Navier-Stokes equations depend on the ---*/ + /*--- Primitive variables and their gradients. The viscous numerics ---*/ + /*--- container is filled just as the convective numerics container, ---*/ + /*--- but the primitive gradients of the reflected state have to be ---*/ + /*--- determined additionally such that symmetry at the boundary is ---*/ + /*--- enforced. Based on the Viscous_Residual routine. ---*/ + /*-------------------------------------------------------------------------------*/ + if (config->GetViscous()) { + + /*--- Set the normal vector and the coordinates. ---*/ + visc_numerics->SetCoord(geometry->node[iPoint]->GetCoord(), geometry->node[iPoint]->GetCoord()); + visc_numerics->SetNormal(Normal); + + /*--- Set the primitive and Secondary variables. ---*/ + visc_numerics->SetPrimitive(V_domain, V_reflected); + visc_numerics->SetSecondary(node[iPoint]->GetSecondary(), node[iPoint]->GetSecondary()); + + /*--- For viscous Fluxes also the gradients of the primitives need to be determined. + 1. The gradients of scalars are mirrored along the sym plane just as velocity for the primitives + 2. The gradients of the velocity components need more attention, i.e. the gradient of the + normal velocity in tangential direction is mirrored and the gradient of the tangential velocity in + normal direction is mirrored. ---*/ + + /*--- Get gradients of primitives of boundary cell ---*/ + for (iVar = 0; iVar < nPrimVarGrad; iVar++) + for (iDim = 0; iDim < nDim; iDim++) + Grad_Prim[iVar][iDim] = node[iPoint]->GetGradient_Primitive(iVar, iDim); + + /*--- Reflect the gradients for all scalars including the velocity components. + The gradients of the velocity components are overriden later with the + correct values: grad(V)_r = grad(V) - 2 [grad(V)*n]n, V beeing any primitive ---*/ + for (iVar = 0; iVar < nPrimVarGrad; iVar++) { + + /*--- Compute projected part of the gradient in a dot product ---*/ + ProjGradient = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + ProjGradient += Grad_Prim[iVar][iDim]*UnitNormal[iDim]; + + for (iDim = 0; iDim < nDim; iDim++) + Grad_Reflected[iVar][iDim] = Grad_Prim[iVar][iDim] - 2.0 * ProjGradient*UnitNormal[iDim]; + } + + /*--- Compute unit tangential, the direction is arbitrary as long as t*n=0. ---*/ + switch( nDim ) { + case 2: { + Tangential[0] = -UnitNormal[1]; + Tangential[1] = UnitNormal[0]; + break; + } + case 3: { + /*--- Find the largest entry index of the UnitNormal, and create Tangential vector based on that. ---*/ + unsigned short Largest, Arbitrary, Zero; + if (abs(UnitNormal[0]) >= abs(UnitNormal[1]) && abs(UnitNormal[0]) >= abs(UnitNormal[2])){Largest=0;Arbitrary=1;Zero=2;} + else if(abs(UnitNormal[1]) >= abs(UnitNormal[0]) && abs(UnitNormal[1]) >= abs(UnitNormal[2])){Largest=1;Arbitrary=0;Zero=2;} + else {Largest=2;Arbitrary=1;Zero=0;} + + Tangential[Largest] = -UnitNormal[Arbitrary]/sqrt(pow(UnitNormal[Largest],2) + pow(UnitNormal[Arbitrary],2)); + Tangential[Arbitrary] = UnitNormal[Largest]/sqrt(pow(UnitNormal[Largest],2) + pow(UnitNormal[Arbitrary],2)); + Tangential[Zero] = 0.0; + break; + } + } + + /*--- Compute gradients of normal and tangential velocity: + grad(v*n) = grad(v_x) n_x + grad(v_y) n_y (+ grad(v_z) n_z) + grad(v*t) = grad(v_x) t_x + grad(v_y) t_y (+ grad(v_z) t_z) ---*/ + su2double GradNormVel[nDim]; + su2double GradTangVel[nDim]; + for (iVar = 0; iVar < nDim; iVar++) { // counts gradient components + GradNormVel[iVar] = 0.0; + GradTangVel[iVar] = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { // counts sum with unit normal/tangential + GradNormVel[iVar] += Grad_Prim[iDim+1][iVar] * UnitNormal[iDim]; + GradTangVel[iVar] += Grad_Prim[iDim+1][iVar] * Tangential[iDim]; + } + } + + /*--- Refelect gradients in tangential and normal direction by substracting the normal/tangential + component twice, just as done with velocity above. + grad(v*n)_r = grad(v*n) - 2 {grad([v*n])*t}t + grad(v*t)_r = grad(v*t) - 2 {grad([v*t])*n}n ---*/ + su2double ReflGradNormVel[nDim]; + su2double ReflGradTangVel[nDim]; + su2double ProjNormVelGrad = 0.0; + su2double ProjTangVelGrad = 0.0; + + for (iDim = 0; iDim < nDim; iDim++) { + ProjNormVelGrad += GradNormVel[iDim]*Tangential[iDim]; //grad([v*n])*t + ProjTangVelGrad += GradTangVel[iDim]*UnitNormal[iDim]; //grad([v*t])*n + } + + for (iDim = 0; iDim < nDim; iDim++) { + ReflGradNormVel[iDim] = GradNormVel[iDim] - 2.0 * ProjNormVelGrad * Tangential[iDim]; + ReflGradTangVel[iDim] = GradTangVel[iDim] - 2.0 * ProjTangVelGrad * UnitNormal[iDim]; + } + + /*--- Transfer reflected gradients back into the Cartesian Coordinate system: + grad(v_x)_r = grad(v*n)_r n_x + grad(v*t)_r t_x + grad(v_y)_r = grad(v*n)_r n_y + grad(v*t)_r t_y + ( grad(v_z)_r = grad(v*n)_r n_z + grad(v*t)_r t_z ) ---*/ + for (iVar = 0; iVar < nDim; iVar++) // loops over the velocity component gradients + for (iDim = 0; iDim < nDim; iDim++) // loops over the entries of the above + Grad_Reflected[iVar+1][iDim] = ReflGradNormVel[iDim]*UnitNormal[iVar] + ReflGradTangVel[iDim]*Tangential[iVar]; + + /*--- Set the primitive gradients of the boundary and reflected state. ---*/ + visc_numerics->SetPrimVarGradient(node[iPoint]->GetGradient_Primitive(), Grad_Reflected); + + /*--- Turbulent kinetic energy. ---*/ + if (config->GetKind_Turb_Model() == SST) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->node[iPoint]->GetSolution(0), + solver_container[TURB_SOL]->node[iPoint]->GetSolution(0)); + + /*--- Compute and update residual. Note that the viscous shear stress tensor is computed in the + following routine based upon the velocity-component gradients. ---*/ + visc_numerics->ComputeResidual(Residual, Jacobian_i, Jacobian_j, config); + + LinSysRes.SubtractBlock(iPoint, Residual); + + /*--- Jacobian contribution for implicit integration. ---*/ + if (implicit) + Jacobian.SubtractBlock(iPoint, iPoint, Jacobian_i); + } + } + } - BC_Euler_Wall(geometry, solver_container, conv_numerics, config, val_marker); + /*--- Free locally allocated memory ---*/ + delete [] Normal; + delete [] UnitNormal; + delete [] Tangential; + for (iVar = 0; iVar < nPrimVarGrad; iVar++) { + delete [] Grad_Prim[iVar]; + delete [] Grad_Reflected[iVar]; + } + delete [] Grad_Prim; + delete [] Grad_Reflected; } void CIncEulerSolver::BC_Periodic_GG(CGeometry *geometry, CConfig *config, unsigned short val_periodic) { @@ -10936,7 +11092,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { +void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { // TK Heatflux computation only if energy equation is on unsigned short iDim, iMarker; unsigned long iVertex, iPoint; @@ -11295,7 +11451,6 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (iMesh == MESH_0) { config->SetPeriodic_Heatflux(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); - //Heatflux_Integrated += Outlet_Density_Total[iMarker_Outlet]; // TK changing to dedicated T container Heatflux_Integrated += Outlet_Temperature_Total[iMarker_Outlet]; } } @@ -12464,51 +12619,45 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (config->GetPeriodic_BC_Body_Force()) { /*--- Define and initialize helping variables ---*/ - - su2double norm2_translation; - su2double dot_product; - su2double Reference_node[nDim]; + su2double norm2_translation = 0.0, dot_product; su2double Pressure_Recovered, Temperature_Recovered; + su2double *Reference_node = new su2double[nDim]; - /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector ---*/ - - for (iDim = 0; iDim < nDim; iDim++) + /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector + and compute square of the distance between the 2 periodic surfaces. ---*/ + for (iDim = 0; iDim < nDim; iDim++) { Reference_node[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + } - /*--- Compute recoverd p/T for all points ---*/ - + /*--- Compute recoverd pressure and temperature for all points ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ - - norm2_translation = 0.0; dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + dot_product = 0.0; + for (iDim = 0; iDim < nDim; iDim++) dot_product += fabs((geometry->node[iPoint]->GetCoord(iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - } - - /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ - - Pressure_Recovered = node[iPoint]->GetSolution(0) - config->GetDeltaP_BodyForce()*dot_product/norm2_translation; - + + /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ + Pressure_Recovered = node[iPoint]->GetSolution(0) - ( config->GetDeltaP_BodyForce()/config->GetPressure_Ref() ) / norm2_translation * dot_product; + node[iPoint]->SetPressure_Recovered(Pressure_Recovered); + if (config->GetEnergy_Equation()) { Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); - + /*--- Avoid m_dot=0 in 0th iteration, as m_dot is in the denominator ---*/ - if (config->GetExtIter() > 0) Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation; // TK HARDCODED inlet !!!!! + + node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); } - - /*--- Save the recovered values of p and T ---*/ - - node[iPoint]->SetPressure_Recovered(Pressure_Recovered); - if (config->GetEnergy_Equation()) node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - GetPeriodic_Properties(geometry, config, iMesh, Output); + + /*--- Free allocated memory. ---*/ + delete [] Reference_node; } /*--- Evaluate the vorticity and strain rate magnitude ---*/ @@ -13411,29 +13560,25 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai Res_Visc[nDim+1] = Wall_HeatFlux*Area; /*--- With streamwise periodic BC and heatflux walls an additional - term is introduced in the boundary formulation ---*/ - + term is introduced in the boundary formulation ---*/ if (config->GetPeriodic_BC_Body_Force()) { su2double Cp = node[iPoint]->GetSpecificHeatCp(); su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); - su2double norm2_translation = 0.0; + su2double norm2_translation = 0.0, dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated() * thermal_conductivity / config->GetPeriodic_MassFlow("outlet") / Cp / norm2_translation; // TK hardcoded + /*--- Scalar part of the contribution ---*/ + su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated()*thermal_conductivity / (config->GetPeriodic_MassFlow("outlet") * Cp * norm2_translation); // TK hardcoded outlet! - su2double dot_product = 0.0; // TK t*n*A , n is unitnormal, Normal here is n*A + /*--- Scalar product ---*/ for (iDim = 0; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } Res_Visc[nDim+1] -= Body_Force_T*dot_product; - - //cout << "dot_product: " << dot_product << endl; - //cout << "Body_Force_T: " << Body_Force_T << endl; - //cout << "Physical contribution: " << Res_Visc[nDim+1] << " Periodic contribution: " << Body_Force_T*dot_product << endl; } /*--- Viscous contribution to the residual at the wall ---*/ From 502664613f713695bb8058a384dfd43a49640e50 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 5 Mar 2019 12:25:39 +0100 Subject: [PATCH 014/326] Added incomplete code for turbulence in streamwise periodicity. Gradient of eddy viscosity still necessary. --- SU2_CFD/src/numerics_direct_mean_inc.cpp | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index f6e072830868..7f703b389771 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -906,7 +906,11 @@ CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { unsigned short iDim, iVar, jVar; - su2double Body_Force; + bool turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); + su2double Body_Force, dot_product, Body_Force_T_factor; + + su2double integrated_heatflux = config->GetPeriodic_HeatfluxIntegrated(); + su2double massflow = config->GetPeriodic_MassFlow("outlet"); // TK hardcoded outlet! /*--- Initialize the Jacobian contribution to zero ---*/ if (implicit) { @@ -930,14 +934,29 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 val_residual[nDim+1] = 0.0; if (config->GetEnergy_Equation()) { - su2double Body_Force_T_factor = config->GetPeriodic_HeatfluxIntegrated() * DensityInc_i / (config->GetPeriodic_MassFlow("outlet") * norm2_translation); // TK hardcoded outlet! + Body_Force_T_factor = integrated_heatflux * DensityInc_i / (massflow * norm2_translation); /*--- Compute scalar-product v*t ---*/ - su2double dot_product = 0.0; + dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { dot_product += V_i[iDim+1] * config->GetPeriodicTranslation(0)[iDim]; } val_residual[nDim+1] = Volume * Body_Force_T_factor * dot_product; + + /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity + gradient is added. ---*/ + if(turbulent) { + + /*--- Compute the scalar factor ---*/ + Body_Force_T_factor = integrated_heatflux / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); + + /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ + dot_product = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + dot_product += config->GetPeriodicTranslation(0)[iDim] * PrimVar_Grad_i[nDim+4][iDim]; // gradient of eddy viscosity, TK not readliy available yet +4 only to prevent out of bound error/segfault + + val_residual[nDim+1] -= Volume * Body_Force_T_factor * dot_product; + } // turbulent /*--- Jacobian contribution of energy equation periodic source term ---*/ if (implicit) { From 0dd047fc05d7b3159fa3c89aa8b6c1397366d25c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 13 Mar 2019 17:54:10 +0100 Subject: [PATCH 015/326] Introduced consistent var/func naming 'Streamwise_Periodic*'. Rewrote large bits without changing results for code clarity. --- Common/include/config_structure.hpp | 97 ++-- Common/include/config_structure.inl | 34 +- Common/include/option_structure.hpp | 13 + Common/src/config_structure.cpp | 72 +-- Common/src/geometry_structure.cpp | 209 ++++---- SU2_CFD/include/numerics_structure.hpp | 18 +- SU2_CFD/include/solver_structure.hpp | 6 +- SU2_CFD/include/solver_structure.inl | 2 +- SU2_CFD/include/variable_structure.hpp | 44 +- SU2_CFD/include/variable_structure.inl | 16 +- SU2_CFD/src/driver_structure.cpp | 2 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 45 +- SU2_CFD/src/output_structure.cpp | 12 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 589 ++++++----------------- config_template.cfg | 14 + 15 files changed, 448 insertions(+), 725 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 5c54fad4d0df..d242b33be5d1 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -359,9 +359,6 @@ class CConfig { su2double *Outlet_MassFlow; /*!< \brief Mass flow for outlet boundaries. */ su2double *Outlet_Density; /*!< \brief Avg. density for outlet boundaries. */ su2double *Outlet_Area; /*!< \brief Area for outlet boundaries. */ - su2double *Periodic_Heatflux; /*!< \brief Area for outlet boundaries. */ - su2double *Periodic_MassFlow; /*!< \brief Mass flow for outlet boundaries. */ - su2double Heatflux_Integrated; /*!< \brief Heatflux integrated over all nonyero heatflux boundaries. */ su2double *Surface_MassFlow; /*!< \brief Massflow at the boundaries. */ su2double *Surface_Mach; /*!< \brief Mach number at the boundaries. */ su2double *Surface_Temperature; /*!< \brief Temperature at the boundaries. */ @@ -1053,10 +1050,14 @@ class CConfig { su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ - bool Periodic_BC_Body_Force; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ - su2double DeltaP_BodyForce; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ - su2double Streamwise_periodic_massflow; /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ - su2double *PeriodicRefNode_BodyForce; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + + unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ + su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + su2double Streamwise_Periodic_TargetMassFlow; /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_MassFlow; /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + su2double *Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ su2double Max_Vel2; /*!< \brief The maximum velocity^2 in the domain for the incompressible preconditioner. */ @@ -2921,16 +2922,22 @@ class CConfig { su2double *GetWeightsIntegrationADER_DG(void); /*! - * \brief Get the total number of boundary markers. + * \brief Get the total number of boundary markers of the local process. * \return Total number of boundary markers. */ unsigned short GetnMarker_All(void); /*! - * \brief Get the total number of boundary markers. + * \brief Get the total number of boundary markers in the cfg plus the possible send/receive domains. * \return Total number of boundary markers. */ unsigned short GetnMarker_Max(void); + + /*! + * \brief Get the total number of boundary markers in the cfg file. + * \return Total number of boundary markers. + */ + unsigned short GetnMarker_CfgFile(void); /*! * \brief Get the total number of boundary markers. @@ -5992,40 +5999,64 @@ class CConfig { su2double* GetBody_Force_Vector(void); /*! - * \brief Get information about the body force. - * \return TRUE if it uses a body force; otherwise FALSE. + * \brief Get information about the streamwise periodicity (None, Pressure_Drop, Massflow). + * \return Driving force identification. */ - bool GetPeriodic_BC_Body_Force(void); + unsigned short GetKind_Streamwise_Periodic(void); /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. */ - su2double GetDeltaP_BodyForce(void); + su2double GetStreamwise_Periodic_PressureDrop(void); /*! * \brief Set the value of the pressure delta from which body force vector is computed. * \param[in] delta_p - pressure difference between in- and outlet. */ - void SetDeltaP_BodyForce(su2double delta_p); + void SetStreamwise_Periodic_PressureDrop(su2double delta_p); -/*! + /*! * \brief Get the value of the massflow from which body force vector is computed. * \return Massflow for body force computation. */ - su2double GetStreamwise_periodic_massflow(void); + su2double GetStreamwise_Periodic_TargetMassFlow(void); /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - su2double* GetPeriodicRefNode_BodyForce(void); + su2double* GetStreamwise_Periodic_RefNode(void); /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - void SetPeriodicRefNode_BodyForce(su2double* RefNode, unsigned short nDim); + void SetStreamwise_Periodic_RefNode(su2double* RefNode, unsigned short nDim); + + /*! + * \brief Get the massflow of the streamwise periodic donor/outlet boundary. + * \return The streamwise periodic donor/outlet massflow. + */ + su2double GetStreamwise_Periodic_MassFlow(); + + /*! + * \brief Set the massflow at the streamwise periodic donor/outlet boundary. + * \param[in] val_massflow - Massflow at the streamwise periodic donor marker. + */ + void SetStreamwise_Periodic_MassFlow(su2double val_massflow); + + /*! + * \brief Get the net sum of the heatflow into the domain. + * \return The net sum of the heatflow into the domain. + */ + su2double GetStreamwise_Periodic_IntegratedHeatFlow(); + + /*! + * \brief Set the net sum of the heatflow into the domain. + * \param[in] val_heatflow - Net sum of the heatflow into the domain. + */ + void SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow); /*! * \brief Get information about the rotational frame. @@ -6101,7 +6132,7 @@ class CConfig { * \return Kind of convergence criteria. */ unsigned short GetConvCriteria(void); - + /*! * \brief Get the index in the config information of the marker val_marker. * \note When we read the config file, it stores the markers in a particular vector. @@ -7590,34 +7621,6 @@ class CConfig { */ void SetOutlet_Area(unsigned short val_imarker, su2double val_area); - /*! - * \brief Get the back pressure (static) at an outlet boundary. - * \param[in] val_index - Index corresponding to the outlet boundary. - * \return The outlet pressure. - */ - su2double GetPeriodic_Heatflux(string val_marker); - - /*! - * \brief Get the back pressure (static) at an outlet boundary. - * \param[in] val_index - Index corresponding to the outlet boundary. - * \return The outlet pressure. - */ - void SetPeriodic_Heatflux(unsigned short val_imarker, su2double val_heatflux); - - /*! - * \brief - * \param[in] - * \return - */ - su2double GetPeriodic_HeatfluxIntegrated(); - - /*! - * \brief - * \param[in] - * \return - */ - void SetPeriodic_HeatfluxIntegrated(su2double IntegratedHeatflux); - /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index c9d572eb2ab0..9f8911c08654 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -107,18 +107,10 @@ inline void CConfig::SetActDisk_Force(unsigned short val_imarker, su2double val_ inline void CConfig::SetOutlet_MassFlow(unsigned short val_imarker, su2double val_massflow) { Outlet_MassFlow[val_imarker] = val_massflow; } -inline void CConfig::SetPeriodic_MassFlow(unsigned short val_imarker, su2double val_massflow) { Periodic_MassFlow[val_imarker] = val_massflow; } - inline void CConfig::SetOutlet_Density(unsigned short val_imarker, su2double val_density) { Outlet_Density[val_imarker] = val_density; } inline void CConfig::SetOutlet_Area(unsigned short val_imarker, su2double val_area) { Outlet_Area[val_imarker] = val_area; } -inline void CConfig::SetPeriodic_Heatflux(unsigned short val_imarker, su2double val_heatflux) { Periodic_Heatflux[val_imarker] = val_heatflux; } - -inline void CConfig::SetPeriodic_HeatfluxIntegrated(su2double HeatfluxIntegrated) { Heatflux_Integrated = HeatfluxIntegrated; } - -inline su2double CConfig::GetPeriodic_HeatfluxIntegrated() { return Heatflux_Integrated; } - inline void CConfig::SetSurface_DC60(unsigned short val_imarker, su2double val_surface_distortion) { Surface_DC60[val_imarker] = val_surface_distortion; } inline void CConfig::SetSurface_MassFlow(unsigned short val_imarker, su2double val_surface_massflow) { Surface_MassFlow[val_imarker] = val_surface_massflow; } @@ -1442,6 +1434,8 @@ inline unsigned short CConfig::GetnMarker_All(void) { return nMarker_All; } inline unsigned short CConfig::GetnMarker_Max(void) { return nMarker_Max; } +inline unsigned short CConfig::GetnMarker_CfgFile(void) { return nMarker_CfgFile; } + inline unsigned short CConfig::GetnMarker_EngineInflow(void) { return nMarker_EngineInflow; } inline unsigned short CConfig::GetnMarker_EngineExhaust(void) { return nMarker_EngineExhaust; } @@ -1642,22 +1636,30 @@ inline bool CConfig::GetGravityForce(void) { return GravityForce; } inline bool CConfig::GetBody_Force(void) { return Body_Force; } -inline bool CConfig::GetPeriodic_BC_Body_Force(void) { return Periodic_BC_Body_Force; } - inline su2double* CConfig::GetBody_Force_Vector(void) { return Body_Force_Vector; } -inline su2double CConfig::GetDeltaP_BodyForce(void) { return DeltaP_BodyForce; } +inline unsigned short CConfig::GetKind_Streamwise_Periodic(void) { return Kind_Streamwise_Periodic; } -inline void CConfig::SetDeltaP_BodyForce(su2double delta_p) { DeltaP_BodyForce = delta_p; } +inline su2double CConfig::GetStreamwise_Periodic_PressureDrop(void) { return Streamwise_Periodic_PressureDrop; } -inline su2double CConfig::GetStreamwise_periodic_massflow(void) { return Streamwise_periodic_massflow; } +inline void CConfig::SetStreamwise_Periodic_PressureDrop(su2double delta_p) { Streamwise_Periodic_PressureDrop = delta_p; } -inline su2double* CConfig::GetPeriodicRefNode_BodyForce(void) { return PeriodicRefNode_BodyForce; } +inline su2double CConfig::GetStreamwise_Periodic_TargetMassFlow(void) { return Streamwise_Periodic_TargetMassFlow; } -inline void CConfig::SetPeriodicRefNode_BodyForce(su2double* RefNode, unsigned short nDim) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) PeriodicRefNode_BodyForce[iDim] = RefNode[iDim]; +inline su2double* CConfig::GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } + +inline void CConfig::SetStreamwise_Periodic_RefNode(su2double* RefNode, unsigned short nDim) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) Streamwise_Periodic_RefNode[iDim] = RefNode[iDim]; } +inline void CConfig::SetStreamwise_Periodic_MassFlow(su2double val_massflow) { Streamwise_Periodic_MassFlow = val_massflow; } + +inline su2double CConfig::GetStreamwise_Periodic_MassFlow() { return Streamwise_Periodic_MassFlow; } + +inline void CConfig::SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow) { Streamwise_Periodic_IntegratedHeatFlow = val_heatflow; } + +inline su2double CConfig::GetStreamwise_Periodic_IntegratedHeatFlow() { return Streamwise_Periodic_IntegratedHeatFlow; } + inline bool CConfig::GetSmoothNumGrid(void) { return SmoothNumGrid; } inline void CConfig::SetSmoothNumGrid(bool val_smoothnumgrid) { SmoothNumGrid = val_smoothnumgrid; } diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 6a9ad4bd134a..f5e0f22f378c 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1980,6 +1980,19 @@ static const map Projection_Function_Map = CCr ("HEAVISIDE_UP" , HEAVISIDE_UP) ("HEAVISIDE_DOWN", HEAVISIDE_DOWN); +/*! + * \brief types of streamwise periodicity. + */ +enum ENUM_STREAMWISE_PERIODIC { + NO_STREAMWISE_PERIODIC = 0, /*!< \brief No projection. */ + PRESSURE_DROP = 1, /*!< \brief Prescribed pressure drop. */ + STREAMWISE_MASSFLOW = 2, /*!< \brief Prescribed massflow. */ +}; +static const map Streamwise_Periodic_Map = CCreateMap +("NONE" , NO_STREAMWISE_PERIODIC) +("PRESSURE_DROP" , PRESSURE_DROP) +("MASSFLOW" , STREAMWISE_MASSFLOW); + /* END_CONFIG_ENUMS */ class COptionBase { diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index a98865201cdc..e57f753833c8 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -480,7 +480,6 @@ void CConfig::SetPointersNull(void) { Surface_DC60 = NULL; Surface_IDC = NULL; Outlet_MassFlow = NULL; Outlet_Density = NULL; Outlet_Area = NULL; - Periodic_MassFlow = NULL; Periodic_Heatflux = NULL; Surface_Uniformity = NULL; Surface_SecondaryStrength = NULL; Surface_SecondOverUniform = NULL; Surface_MomentumDistortion = NULL; @@ -527,8 +526,8 @@ void CConfig::SetPointersNull(void) { Kind_ObjFunc = NULL; Weight_ObjFunc = NULL; - - PeriodicRefNode_BodyForce = NULL; + + Streamwise_Periodic_RefNode = NULL; /*--- Moving mesh pointers ---*/ @@ -757,13 +756,13 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo default_body_force[0] = 0.0; default_body_force[1] = 0.0; default_body_force[2] = 0.0; /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ addDoubleArrayOption("BODY_FORCE_VECTOR", 3, Body_Force_Vector, default_body_force); - - /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NO, YES) */ - addBoolOption("PERIODIC_BC_BODY_FORCE", Periodic_BC_Body_Force, false); - /* DESCRIPTION: Delta pressure on which basis body force will be computed */ // TK 1.0 is now the starting value for specified massflow, or simply the value that you specify - addDoubleOption("DELTA_P_BODY_FORCE", DeltaP_BodyForce, 1.0); + + /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NONE, PRESSURE_DROP, MASSFLOW) */ + addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); + /* DESCRIPTION: Delta pressure on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ + addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); /* DESCRIPTION: Massflow basis body (via Delta P) force will be computed */ - addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_periodic_massflow, 0.0); + addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); @@ -4254,21 +4253,15 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - /*--- Check for Body Force driven case with Periodic Boundary conditions ---*/ + /*--- Check for Streamwise Periodic Boundary conditions ---*/ + if (Kind_Streamwise_Periodic != NONE) { + if (Kind_Solver == EULER) SU2_MPI::Error("Didn't test dat shit yet.", CURRENT_FUNCTION); + if (Kind_Regime != INCOMPRESSIBLE) SU2_MPI::Error("Streamwise Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); + if (nMarker_PerBound != 2) SU2_MPI::Error("Streamwise Periodic BC currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible.", CURRENT_FUNCTION); + if (Energy_Equation && nMarker_Isothermal != 0) SU2_MPI::Error("No isothermal marker allowed with streamwise periodicity, only heatflux..", CURRENT_FUNCTION); - if ((Periodic_BC_Body_Force == YES) && !(Kind_Regime == INCOMPRESSIBLE)) { - SU2_MPI::Error("Body Force driven Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); - } - cout << "nMarker_PerBound : " << nMarker_PerBound << endl; - if ((Periodic_BC_Body_Force == YES) && !(nMarker_PerBound == 2)) { - SU2_MPI::Error("Body Force driven Periodic BC currently only implemented for one Periodic Boundary pair.", CURRENT_FUNCTION); - } - - /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ - // NEED TO PROPERLY INITIALIZE INTEGRATED VALUE USING BC FOR TEMPERATURE - if (Periodic_BC_Body_Force == YES) { - PeriodicRefNode_BodyForce = new su2double[val_nDim]; - Heatflux_Integrated = 1e-10; + /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ + Streamwise_Periodic_RefNode = new su2double[val_nDim]; } /*--- Handle default options for topology optimization ---*/ @@ -4369,7 +4362,7 @@ void CConfig::SetMarkers(unsigned short val_software) { /*--- Basic dimensionalization of the markers (worst scenario) ---*/ - nMarker_All = nMarker_Max; + nMarker_All = nMarker_Max; // TK:: one of these is unecessary /*--- Allocate the memory (markers in each domain) ---*/ @@ -4607,16 +4600,6 @@ void CConfig::SetMarkers(unsigned short val_software) { Outlet_Area[iMarker_Outlet] = 0.0; } - Periodic_MassFlow = new su2double[nMarker_PerBound]; - Periodic_Heatflux = new su2double[nMarker_HeatFlux]; - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_PerBound; iMarker_Outlet++) { - Periodic_MassFlow[iMarker_Outlet] = 0.0; - } - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_HeatFlux; iMarker_Outlet++) { - Periodic_Heatflux[iMarker_Outlet] = 0.0; - } - - for (iMarker_NearFieldBound = 0; iMarker_NearFieldBound < nMarker_NearFieldBound; iMarker_NearFieldBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_NearFieldBound[iMarker_NearFieldBound]; Marker_CfgFile_KindBC[iMarker_CfgFile] = NEARFIELD_BOUNDARY; @@ -7144,10 +7127,7 @@ CConfig::~CConfig(void) { if (Outlet_Area != NULL) delete[] Outlet_Area; if (Outlet_Density != NULL) delete[] Outlet_Density; - if (Outlet_MassFlow != NULL) delete[] Outlet_MassFlow; - if (Periodic_MassFlow != NULL) delete[] Periodic_MassFlow; - if (Periodic_Heatflux != NULL) delete[] Periodic_Heatflux; - + if (Outlet_MassFlow != NULL) delete[] Outlet_MassFlow; if (Surface_MassFlow != NULL) delete[] Surface_MassFlow; if (Surface_Mach != NULL) delete[] Surface_Mach; if (Surface_Temperature != NULL) delete[] Surface_Temperature; @@ -7250,7 +7230,7 @@ CConfig::~CConfig(void) { if (MG_CorrecSmooth != NULL) delete[] MG_CorrecSmooth; if (PlaneTag != NULL) delete[] PlaneTag; if (CFL != NULL) delete[] CFL; - if (PeriodicRefNode_BodyForce != NULL) delete[] PeriodicRefNode_BodyForce; + if (Streamwise_Periodic_RefNode != NULL) delete[] Streamwise_Periodic_RefNode; /*--- String markers ---*/ @@ -7853,13 +7833,6 @@ su2double CConfig::GetOutlet_MassFlow(string val_marker) { return Outlet_MassFlow[iMarker_Outlet]; } -su2double CConfig::GetPeriodic_MassFlow(string val_marker) { - unsigned short iMarker_Outlet; - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_PerBound; iMarker_Outlet++) - if ((Marker_PerBound[iMarker_Outlet] == val_marker)) break; - return Periodic_MassFlow[iMarker_Outlet]; -} - su2double CConfig::GetOutlet_Density(string val_marker) { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) @@ -7874,13 +7847,6 @@ su2double CConfig::GetOutlet_Area(string val_marker) { return Outlet_Area[iMarker_Outlet]; } -su2double CConfig::GetPeriodic_Heatflux(string val_marker) { - unsigned short iMarker_Outlet; - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_HeatFlux; iMarker_Outlet++) - if ((Marker_HeatFlux[iMarker_Outlet] == val_marker)) break; - return Periodic_Heatflux[iMarker_Outlet]; -} - unsigned short CConfig::GetMarker_CfgFile_ActDiskOutlet(string val_marker) { unsigned short iMarker_ActDisk, kMarker_All; diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index 4841026c925d..0085c899c9c5 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -16328,129 +16328,112 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, unsigned short val_period delete [] Buffer_Receive_Marker; } - - - /*--- Compute reference Node for recovered pressure ---*/ - if (config->GetPeriodic_BC_Body_Force() == YES) { - - /*--- Define and initialize helping variables ---*/ - unsigned short iMarker, periodic_recv_Marker, PeriodicInletMarker_PerBound, iPeriodic, iDim; - unsigned long reference_node_id; - su2double PerBoundNodeCoord[nDim]; - su2double norm2_Node = 0.0, norm2_min = 1e300; - for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = 1e300; // init to very high value such that real points can be filtered out later - unsigned short nPeriodic = config->GetnMarker_Periodic(); - unsigned long nNodeOnPBC = 0, iNodeOnPBC; - unsigned long maxNodeOnPBC; // for MPI communication - unsigned long proc_min, node_min; - su2double* Buffer_Send_PBCNodeCoords; - su2double* Buffer_Recv_PBCNodeCoords; - unsigned long* Buffer_Recv_nNodeOnPBC; // vector holding all local nNodeOnPBC - Buffer_Recv_nNodeOnPBC = new unsigned long [size]; - for (int iProc = 0; iProc < size; iProc++) Buffer_Recv_nNodeOnPBC[iProc] = 0; - - /*--- Find an arbitrary(find a metric to get a deterministic solution) node on the PerBound of the Periodic BC, but not on the donor side! ---*/ + + /*--- Compute reference Node for streamwise periodicity. ---*/ + if (config->GetKind_Streamwise_Periodic() != NONE) { + + /*-------------------------------------------------------------------------------------------*/ + /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ + /*--- of recovered pressure/temperature, such that this found node is independent of the ---*/ + /*--- number of ranks. This does not affect the 'correctness' of the solution as the ---*/ + /*--- absolute value is arbitrary anyway, but it assures that the solution does not change---*/ + /*--- with a higher number of ranks. If the periodic markers are a line\plane and the ---*/ + /*--- streamwise coordiante vector is perpendicular to that |--->|, the choice of the ---*/ + /*--- reference node is not relevant at all. This is probably true for most streamwise ---*/ + /*--- periodic cases. Other cases where it is relevant could look like this (--->( or ---*/ + /*--- \--->\ . The chosen metric is the minimal distance to the origin. ---*/ + /*-------------------------------------------------------------------------------------------*/ + + /*--- Initialize/Allocate variables. ---*/ + unsigned short iMarker, iPeriodic, iDim; + unsigned long iPoint; + su2double norm, min_norm = 0.0; + + su2double *Buffer_Send_RefNode = new su2double[nDim]; + su2double *Buffer_Recv_RefNode = new su2double[size*nDim]; + + for (iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = 1e300; + + /*-------------------------------------------------------------------------------------------*/ + /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ + /*--- each process has the local ref-nodes from every process. Most processes ---*/ + /*--- won't have a boundary with the streamwise periodic 'inlet' marker, ---*/ + /*--- therefore the default value of the send value is set super high. ---*/ + /*-------------------------------------------------------------------------------------------*/ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor, 0 if no PBC at all - if (iPeriodic == 1) { // We found a point on a receiver PBC, in - - periodic_recv_Marker = iMarker; - reference_node_id = vertex[iMarker][0]->GetNode(); // just get the first node in the marker - for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = node[reference_node_id]->GetCoord(iDim); - nNodeOnPBC = GetnVertex(iMarker);//Get the number of points on the marker here + + /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ + iPeriodic = config->GetMarker_All_PerBound(iMarker); + if (iPeriodic == 1) { - } - } - } - - /*--- Communicate reference node between multiple processes ---*/ - - /*--- Find process with the largest possible nodeset and store array[size] with possible nodes on each rank ---*/ - SU2_MPI::Allreduce(&nNodeOnPBC, &maxNodeOnPBC, 1, MPI_UNSIGNED_LONG, - MPI_MAX, MPI_COMM_WORLD); - cout << "maxNodeOnPBC: " << maxNodeOnPBC << " , rank: " << rank << endl; - - SU2_MPI::Allgather(&nNodeOnPBC, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nNodeOnPBC, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - if (rank == MASTER_NODE) { - for (int iProc = 0; iProc < size; iProc++) { - cout << "Buffer_Recv_nNodeOnPBC[iProc]: " << Buffer_Recv_nNodeOnPBC[iProc] << endl; - } - } - - /*--- Define send buffer ---*/ - Buffer_Send_PBCNodeCoords = new su2double[maxNodeOnPBC*nDim]; - /*--- Fill send buffer with coords ---*/ - - /*--- Find an arbitrary(find a metric to get a deterministic solution) node on the PerBound of the Periodic BC, but not on the donor side! ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - iPeriodic = config->GetMarker_All_PerBound(iMarker); // this is 1 or 2 if only 1 PBC is present, 2 is the donor, 0 if no PBC at all - if (iPeriodic == 1) { // We found a point on a receiver PBC, in - - periodic_recv_Marker = iMarker; - //reference_node_id = vertex[iMarker][0]->GetNode(); // just get the first node in the marker - for (iDim = 0; iDim < nDim; iDim++) PerBoundNodeCoord[iDim] = node[reference_node_id]->GetCoord(iDim); - nNodeOnPBC = GetnVertex(iMarker);//Get the number of points on the marker here - - for (iNodeOnPBC = 0; iNodeOnPBC < nNodeOnPBC; iNodeOnPBC++) { - for (iDim = 0; iDimGetNode()]->GetCoord(iDim); - } + for (iPoint = 0; iPoint < GetnVertex(iMarker); iPoint++) { + + /*--- Get the squared norm of the current point. ---*/ + norm = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + norm += pow(node[vertex[iMarker][iPoint]->GetNode()]->GetCoord(iDim),2); + + /*--- Check if new unique reference node is found. ---*/ + if (norm < min_norm || iPoint == 0) { + min_norm = norm; + for (iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = node[vertex[iMarker][iPoint]->GetNode()]->GetCoord(iDim); + + } else if (norm == min_norm) { + // TK::write code later + } } - } - } - } - - /*--- Allocate receive Buffer ---*/ - Buffer_Recv_PBCNodeCoords = new su2double[maxNodeOnPBC*nDim*size]; + } // receiver conditional + } // periodic conditional + break; // Actually no more than one streamwise periodic marker pair is allowed, TK::what if combined with spanwise periodicity? + } // marker loop + + /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ + SU2_MPI::Allgather(Buffer_Send_RefNode, nDim, MPI_DOUBLE, Buffer_Recv_RefNode, nDim, MPI_DOUBLE, MPI_COMM_WORLD); + + /*-------------------------------------------------------------------------------------------*/ + /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ + /*--- globally closest to the origin. Store the found node coordinates in the ---*/ + /*--- config container. ---*/ + /*-------------------------------------------------------------------------------------------*/ + + for (iPoint = 0; iPoint < size; iPoint++) { // loop over all vertices on that marker and fi + + /*--- Get the norm of the current Point. ---*/ + norm = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + norm += pow(Buffer_Recv_RefNode[iPoint*nDim + iDim],2); + + /*--- Check if new unique reference node is found. ---*/ + if (norm < min_norm || iPoint == 0) { + min_norm = norm; + for (iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iPoint*nDim + iDim]; - SU2_MPI::Allgather(Buffer_Send_PBCNodeCoords, nDim*maxNodeOnPBC, MPI_DOUBLE, Buffer_Recv_PBCNodeCoords, nDim*maxNodeOnPBC, MPI_DOUBLE, MPI_COMM_WORLD); - - proc_min = 0; - node_min = 0; - /*--- Every processor determines the reference node itself, as all possible nodes were communicated ---*/ - for (int iProc = 0; iProc < size; iProc++) { - for (iNodeOnPBC = 0; iNodeOnPBC < Buffer_Recv_nNodeOnPBC[iProc]; iNodeOnPBC++) { - for (iDim = 0; iDim < nDim; iDim++) { - norm2_Node += pow(Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*iProc + nDim*iNodeOnPBC + iDim],2); - if (rank == MASTER_NODE) { - cout << "maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim: " << maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim << endl; - cout << "Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*iProc + nDim*iNodeOnPBC + iDim]: " << Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*iProc + nDim*iNodeOnPBC + iDim] << endl; - } - } - if (sqrt(norm2_Node) < norm2_min) { //Codi? - norm2_min = norm2_Node; - proc_min = iProc; - node_min = iNodeOnPBC; - } - norm2_Node = 0.0; + } else if (norm == min_norm) { + // TK::write code later } } - - /*--- Set coordinates of reference node ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - PerBoundNodeCoord[iDim] = Buffer_Recv_PBCNodeCoords[maxNodeOnPBC*nDim*proc_min + nDim*node_min + iDim]; - } - - // tmp print the reference node - for (iDim = 0; iDim < nDim; iDim++) { - cout << "Reference Node: " << PerBoundNodeCoord[iDim] << " "; + + /*--- Store the final reference node. ---*/ + config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode, nDim); + + /*--- Print the reference node. ---*/ + if (rank == MASTER_NODE) { + cout << "Streamwise Periodic Reference Node: ["; + for (iDim = 0; iDim < nDim; iDim++) + cout << " " << Buffer_Send_RefNode[iDim] << ","; + cout << "\b ]" << endl; } - cout << endl; - - /*--- Set the reference node, used in output_structure.cpp ---*/ - config->SetPeriodicRefNode_BodyForce(PerBoundNodeCoord, nDim); - - /*--- Deallocate ---*/ - delete[] Buffer_Send_PBCNodeCoords; - delete[] Buffer_Recv_PBCNodeCoords; - delete[] Buffer_Recv_nNodeOnPBC; + + /*--- Free allocated memory. ---*/ + delete [] Buffer_Send_RefNode; + delete [] Buffer_Recv_RefNode; } - } void CPhysicalGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp index 85302b53028a..c81c9bdf7da2 100644 --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5266,16 +5266,24 @@ class CSourceIncBodyForce : public CNumerics { }; /*! - * \class CSourceIncPeriodicBodyForce + * \class CSourceIncStreamwise_Periodic * \brief Class for the source term integration of a body force in the incompressible solver. Used for periodic BC. * \ingroup SourceDiscr - * \author T. Economon + * \author T. Kattmann * \version 6.1.0 "Falcon" */ class CSourceIncStreamwise_Periodic : public CNumerics { - bool implicit; /*!< \brief Implicit calculation. */ - su2double norm2_translation; /*!< \brief Square of distance between the 2 periodic surfaces. */ - + bool implicit, /*!< \brief Implicit calculation. */ + turbulent, /*!< \brief Turbulence model used. */ + energy; /*!< \brief Energy equation on. */ + + su2double *Streamwise_Coord_Vector; /*!< \brief Translation vector between periodic surfaces. */ + + su2double norm2_translation, /*!< \brief Square of distance between the 2 periodic surfaces. */ + integrated_heatflow, /*!< \brief Total heat added intto the domain via heatflux marker. */ + massflow, /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ + delta_p; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + public: /*! diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp index 0243d404b6a0..b578ec19cded 100644 --- a/SU2_CFD/include/solver_structure.hpp +++ b/SU2_CFD/include/solver_structure.hpp @@ -2163,7 +2163,7 @@ class CSolver { /*! * \brief A virtual member. */ - virtual void GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + virtual void GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); /*! * \brief A virtual member. @@ -8687,9 +8687,9 @@ class CIncEulerSolver : public CSolver { void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); /*! - * \brief A virtual member. - add documentaiton + * \brief Compute necessary quantities (massflow, integrated heatflux, ...) for streamwise periodic cases. */ - void GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + void GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); }; diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl index 3676f352c9dd..37b291ce9f7c 100644 --- a/SU2_CFD/include/solver_structure.inl +++ b/SU2_CFD/include/solver_structure.inl @@ -829,7 +829,7 @@ inline void CSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, u inline void CSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } -inline void CSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } +inline void CSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } inline void CSolver::GetEllipticSpanLoad_Diff(CGeometry *geometry, CConfig *config) { } diff --git a/SU2_CFD/include/variable_structure.hpp b/SU2_CFD/include/variable_structure.hpp index 9c6860650ee3..7762a95f8585 100644 --- a/SU2_CFD/include/variable_structure.hpp +++ b/SU2_CFD/include/variable_structure.hpp @@ -871,26 +871,28 @@ class CVariable { /*! * \brief A virtual member. - * \return Recovered/Physical pressure for periodic flow. + * \param[in] val_pressure - pressure value. */ - virtual su2double GetPressure_Recovered(void); // TK + virtual void SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure); /*! * \brief A virtual member. - * \return Recovered/Physical temperature for periodic flow. + * \return Recovered/Physical pressure for streamwise periodic flow. */ - virtual su2double GetTemperature_Recovered(void); + virtual su2double GetStreamwise_Periodic_RecoveredPressure(void); /*! * \brief A virtual member. + * \param[in] val_temperature - temperature value. */ - virtual void SetPressure_Recovered(su2double val_pressure); + virtual void SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature); /*! * \brief A virtual member. + * \return Recovered/Physical temperature for streamwise periodic flow. */ - virtual void SetTemperature_Recovered(su2double val_temperature); - + virtual su2double GetStreamwise_Periodic_RecoveredTemperature(void); + /*! * \brief A virtual member. * \return Value of the flow density. @@ -3607,8 +3609,8 @@ class CIncEulerVariable : public CVariable { su2double Density_Old; - su2double Pressure_Recovered; - su2double Temperature_Recovered; + su2double Streamwise_Periodic_RecoveredPressure, /*!< \brief Recovered/Physical pressure for streamwise periodic flow. */ + Streamwise_Periodic_RecoveredTemperature; /*!< \brief Recovered/Physical temperature for streamwise periodic flow. */ public: @@ -3790,27 +3792,29 @@ class CIncEulerVariable : public CVariable { su2double GetDensity_Old(void); /*! - * \brief A virtual member. - * \return Recovered/Physical pressure for periodic flow. + * \brief Set the recovered pressure for streamwise periodic flow. + * \param[in] val_pressure - pressure value. */ - su2double GetPressure_Recovered(void); // TK + void SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure); /*! - * \brief A virtual member. - * \return Recovered/Physical temperature for periodic flow. + * \brief Get the recovered pressure for streamwise periodic flow. + * \return Recovered/Physical pressure for streamwise periodic flow. */ - su2double GetTemperature_Recovered(void); + su2double GetStreamwise_Periodic_RecoveredPressure(void); /*! - * \brief A virtual member. + * \brief Set the recovered pressure for streamwise periodic flow. + * \param[in] val_temperature - temperature value. */ - void SetPressure_Recovered(su2double val_pressure); + void SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature); /*! - * \brief A virtual member. + * \brief Get the recovered temperature for streamwise periodic flow. + * \return Recovered/Physical temperature for streamwise periodic flow. */ - void SetTemperature_Recovered(su2double val_temperature); - + su2double GetStreamwise_Periodic_RecoveredTemperature(void); + /*! * \brief Get the temperature of the flow. * \return Value of the temperature of the flow. diff --git a/SU2_CFD/include/variable_structure.inl b/SU2_CFD/include/variable_structure.inl index 6f976b780c21..2f634b4a7450 100644 --- a/SU2_CFD/include/variable_structure.inl +++ b/SU2_CFD/include/variable_structure.inl @@ -251,13 +251,13 @@ inline su2double CVariable::GetDensity(void) { return 0; } inline su2double CVariable::GetDensity_Old(void) { return 0; } -inline su2double CVariable::GetPressure_Recovered(void) { return 0; } +inline void CVariable::SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure) { } -inline su2double CVariable::GetTemperature_Recovered(void) { return 0; } +inline su2double CVariable::GetStreamwise_Periodic_RecoveredPressure(void) { return 0; } -inline void CVariable::SetPressure_Recovered(su2double val_pressure) { } +inline void CVariable::SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature) { } -inline void CVariable::SetTemperature_Recovered(su2double val_temperature) { } +inline su2double CVariable::GetStreamwise_Periodic_RecoveredTemperature(void) { return 0; } inline su2double CVariable::GetDensity(unsigned short val_iSpecies) { return 0; } @@ -963,13 +963,13 @@ inline su2double CIncEulerVariable::GetDensity(void) { return Primitive[nDim+2]; inline su2double CIncEulerVariable::GetDensity_Old(void) { return Density_Old; } -inline su2double CIncEulerVariable::GetPressure_Recovered(void) { return Pressure_Recovered; } +inline void CIncEulerVariable::SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure) { Streamwise_Periodic_RecoveredPressure = val_pressure; } -inline su2double CIncEulerVariable::GetTemperature_Recovered(void) { return Temperature_Recovered; } +inline su2double CIncEulerVariable::GetStreamwise_Periodic_RecoveredPressure(void) { return Streamwise_Periodic_RecoveredPressure; } -inline void CIncEulerVariable::SetPressure_Recovered(su2double val_pressure) { Pressure_Recovered = val_pressure; } +inline void CIncEulerVariable::SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature) { Streamwise_Periodic_RecoveredTemperature = val_temperature; } -inline void CIncEulerVariable::SetTemperature_Recovered(su2double val_temperature) { Temperature_Recovered = val_temperature; } +inline su2double CIncEulerVariable::GetStreamwise_Periodic_RecoveredTemperature(void) { return Streamwise_Periodic_RecoveredTemperature; } inline su2double CIncEulerVariable::GetBetaInc2(void) { return Primitive[nDim+3]; } diff --git a/SU2_CFD/src/driver_structure.cpp b/SU2_CFD/src/driver_structure.cpp index 480d4fe1e77a..46a17f507769 100644 --- a/SU2_CFD/src/driver_structure.cpp +++ b/SU2_CFD/src/driver_structure.cpp @@ -2306,7 +2306,7 @@ void CDriver::Numerics_Preprocessing(CNumerics *****numerics_container, if (config->GetBody_Force() == YES) if (incompressible) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBodyForce(nDim, nVar_Flow, config); - else if (incompressible && (config->GetPeriodic_BC_Body_Force() == YES)) + else if (incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) numerics_container[val_iInst][iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBoussinesq(nDim, nVar_Flow, config); diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 7f703b389771..2e707812ad8d 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -891,27 +891,36 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { - implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - + implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); + energy = config->GetEnergy_Equation(); + + Streamwise_Coord_Vector = new su2double[nDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Streamwise_Coord_Vector[iDim] = config->GetPeriodicTranslation(0)[iDim]; + /*--- Compute square of the distance between the 2 periodic surfaces ---*/ norm2_translation = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(Streamwise_Coord_Vector[iDim],2); + } CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { + if (Streamwise_Coord_Vector != NULL) delete [] Streamwise_Coord_Vector; + } void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { unsigned short iDim, iVar, jVar; - bool turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); - su2double Body_Force, dot_product, Body_Force_T_factor; - - su2double integrated_heatflux = config->GetPeriodic_HeatfluxIntegrated(); - su2double massflow = config->GetPeriodic_MassFlow("outlet"); // TK hardcoded outlet! + su2double dot_product, scalar_factor; + delta_p = config->GetStreamwise_Periodic_PressureDrop(); + massflow = config->GetStreamwise_Periodic_MassFlow(); + integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + /*--- Initialize the Jacobian contribution to zero ---*/ if (implicit) { for (iVar=0; iVar < nVar; iVar++) @@ -926,42 +935,42 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ for (iDim = 0; iDim < nDim; iDim++) { - Body_Force = ( config->GetDeltaP_BodyForce()/config->GetPressure_Ref() ) / norm2_translation * config->GetPeriodicTranslation(0)[iDim]; // TK check if pres_ref is the same as force ref, TK is the (0) hardcoded? - val_residual[iDim+1] = -Volume * Body_Force; + scalar_factor = ( delta_p/config->GetPressure_Ref() ) / norm2_translation * Streamwise_Coord_Vector[iDim]; // TK check if pres_ref is the same as force ref, TK the (0) is hardcoded! streamwise periodic has to be the first marker + val_residual[iDim+1] = -Volume * scalar_factor; } /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ val_residual[nDim+1] = 0.0; - if (config->GetEnergy_Equation()) { + if (energy) { - Body_Force_T_factor = integrated_heatflux * DensityInc_i / (massflow * norm2_translation); + scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); /*--- Compute scalar-product v*t ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - dot_product += V_i[iDim+1] * config->GetPeriodicTranslation(0)[iDim]; + dot_product += V_i[iDim+1] * Streamwise_Coord_Vector[iDim]; } - val_residual[nDim+1] = Volume * Body_Force_T_factor * dot_product; + val_residual[nDim+1] = Volume * scalar_factor * dot_product; /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity gradient is added. ---*/ if(turbulent) { /*--- Compute the scalar factor ---*/ - Body_Force_T_factor = integrated_heatflux / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); + scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) - dot_product += config->GetPeriodicTranslation(0)[iDim] * PrimVar_Grad_i[nDim+4][iDim]; // gradient of eddy viscosity, TK not readliy available yet +4 only to prevent out of bound error/segfault + dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+4][iDim]; // gradient of eddy viscosity, TK not readliy available yet +4 only to prevent out of bound error/segfault - val_residual[nDim+1] -= Volume * Body_Force_T_factor * dot_product; + val_residual[nDim+1] -= Volume * scalar_factor * dot_product; } // turbulent /*--- Jacobian contribution of energy equation periodic source term ---*/ if (implicit) { for (iDim = 0; iDim < nDim; iDim++) - Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * Body_Force_T_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why + Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * scalar_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why } } // Energy diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp index 60ff2cd22a49..ad6740538f42 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -13464,7 +13464,7 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } - if (config->GetPeriodic_BC_Body_Force()) { + if (config->GetKind_Streamwise_Periodic()) { nVar_Par += 1; Variable_Names.push_back("Recovered_Pressure"); @@ -13782,11 +13782,13 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } /*--- Recovered p/T for streamwise periodic BC ---*/ - if (config->GetPeriodic_BC_Body_Force()) { + if (config->GetKind_Streamwise_Periodic()) { - /*--- TK Recovered p/T comp is already done in CIncNSSolver::Preprocessing() ---*/ - Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetPressure_Recovered(); iVar++; - if(energy) { Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetTemperature_Recovered(); iVar++; } + /*--- Recovered p/T comp is already done in CIncNSSolver::Preprocessing() ---*/ + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetStreamwise_Periodic_RecoveredPressure(); iVar++; + if(energy) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetStreamwise_Periodic_RecoveredTemperature(); iVar++; + } Local_Data[jPoint][iVar] = rank; iVar++; diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 2fb93610ff14..55ddc017fc58 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2687,9 +2687,9 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- Compute integrated Heatflux and massflow, TK Euler equations not implemented yet ---*/ - - if (config->GetPeriodic_BC_Body_Force()) GetPeriodic_Properties(geometry, config, iMesh, Output); + /*--- Compute integrated Heatflux and massflow, TK:: Euler equations not implemented yet, probalby wasted here ---*/ + + if (config->GetKind_Streamwise_Periodic()) GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Initialize the Jacobian matrices ---*/ @@ -3129,7 +3129,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool rotating_frame = config->GetRotating_Frame(); bool axisymmetric = config->GetAxisymmetric(); bool body_force = config->GetBody_Force(); - bool streamwise_periodic = config->GetPeriodic_BC_Body_Force(); + bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); bool viscous = config->GetViscous(); @@ -11092,238 +11092,136 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { // TK Heatflux computation only if energy equation is on - +void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { + if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } + /*---------------------------------------------------------------------------------------------*/ + // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results + // 2. Update delta_p is target massflow is chosen. + // 3. Loop Heatflux (or all for real heatflux) markers. compute heatflux in domain via config or real heatflux, communicate and set results. only if energy equation is on. + /*---------------------------------------------------------------------------------------------*/ + + /*--- Initialization and allocation done here. ---*/ unsigned short iDim, iMarker; unsigned long iVertex, iPoint; - su2double *V_outlet = NULL, Pressure, Temperature, Velocity[3], MassFlow, - Velocity2, Density, Area, Vel_Infty2, AxiFactor; - unsigned short iMarker_Outlet, nMarker_Outlet; - string Inlet_TagBound, Outlet_TagBound; - su2double Heatflux_Integrated = 0.0; - - bool axisymmetric = config->GetAxisymmetric(); + bool axisymmetric = config->GetAxisymmetric(); bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration && (config->GetExtIter()!= 0)) || (config->GetExtIter() == 1)); + + su2double AxiFactor; + + /*-------------------------------------------------------------------------------------------------*/ + /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ + /*--- (there can be only one) streamwise periodic outlet/donor marker. Massflow is obviously ---*/ + /*--- needed for prescribed massflow but also for the additional source and heatflux ---*/ + /*--- boundary terms of the energy equation. Area and the avg-density are used for the ---*/ + /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ + /*-------------------------------------------------------------------------------------------------*/ - /*--- Get the number of outlet markers and check for any mass flow BCs. ---*/ - - nMarker_Outlet = config->GetnMarker_Periodic(); - bool Evaluate_BC = true; - - /*--- If we have a massflow outlet BC, then we need to compute and - communicate the total massflow, density, and area through each outlet - boundary, so that it can be used in the iterative procedure to update - the back pressure until we converge to the desired mass flow. This - routine is called only once per iteration as a preprocessing and the - values for all outlets are stored and retrieved later in the BC_Outlet - routines. ---*/ + su2double Area_Local = 0.0, Area_Global = 0.0, FaceArea, + MassFlow_Local = 0.0, MassFlow_Global = 0.0, + Average_Density_Local = 0.0, Average_Density_Global = 0.0; + + su2double *AreaNormal = new su2double[nDim]; - if (Evaluate_BC) { - - su2double *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Density = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Temperature = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Area = new su2double[config->GetnMarker_All()]; - - /*--- Comute MassFlow, average temp, press, etc. ---*/ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - Outlet_MassFlow[iMarker] = 0.0; - Outlet_Density[iMarker] = 0.0; - Outlet_Temperature[iMarker] = 0.0; - Outlet_Area[iMarker] = 0.0; + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 2) { // outlet/donor periodic marker - if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) ) { + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); - if (geometry->node[iPoint]->GetDomain()) { - - V_outlet = node[iPoint]->GetPrimitive(); - - geometry->vertex[iMarker][iVertex]->GetNormal(Vector); - - if (axisymmetric) { - if (geometry->node[iPoint]->GetCoord(1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); - else - AxiFactor = 1.0; - } else { + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else AxiFactor = 1.0; - } - - Pressure = V_outlet[0]; - Density = V_outlet[nDim+2]; - - Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; - - for (iDim = 0; iDim < nDim; iDim++) { - Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); - Velocity[iDim] = V_outlet[iDim+1]; - Velocity2 += Velocity[iDim] * Velocity[iDim]; - MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; - } - Area = sqrt (Area); - - Temperature = node[iPoint]->GetTemperature_Recovered(); - //cout << iPoint << " " << Temperature << endl; - - Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Density*Area; - Outlet_Temperature[iMarker] += Temperature*Area; - Outlet_Area[iMarker] += Area; - } - } - } - } - - /*--- Copy to the appropriate structure ---*/ - - su2double *Outlet_MassFlow_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_Density_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_Temperature_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_Area_Local = new su2double[nMarker_Outlet]; - - su2double *Outlet_MassFlow_Total = new su2double[nMarker_Outlet]; - su2double *Outlet_Density_Total = new su2double[nMarker_Outlet]; - su2double *Outlet_Temperature_Total = new su2double[nMarker_Outlet]; - su2double *Outlet_Area_Total = new su2double[nMarker_Outlet]; - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; - Outlet_Density_Local[iMarker_Outlet] = 0.0; - Outlet_Temperature_Local[iMarker_Outlet] = 0.0; - Outlet_Area_Local[iMarker_Outlet] = 0.0; - - Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; - Outlet_Density_Total[iMarker_Outlet] = 0.0; - Outlet_Temperature_Total[iMarker_Outlet] = 0.0; - Outlet_Area_Total[iMarker_Outlet] = 0.0; - } - - /*--- Copy the values to the local array for MPI ---*/ - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY)) { - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_Periodic_TagBound(iMarker_Outlet); - cout << Outlet_TagBound << endl; - if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { - Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; - Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; - Outlet_Temperature_Local[iMarker_Outlet] += Outlet_Temperature[iMarker]; - Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; + } else { + AxiFactor = 1.0; } - } - } - } - - /*--- All the ranks to compute the total value ---*/ - -#ifdef HAVE_MPI - - SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - -#else - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; - Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; - Outlet_Temperature_Total[iMarker_Outlet] = Outlet_Temperature_Local[iMarker_Outlet]; - Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; - } - -#endif - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { - Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; - Outlet_Temperature_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; - } - else { - Outlet_Density_Total[iMarker_Outlet] = 0.0; - Outlet_Temperature_Total[iMarker_Outlet] = 0.0; - } - - if (iMesh == MESH_0) { - config->SetPeriodic_MassFlow(iMarker_Outlet, Outlet_MassFlow_Total[iMarker_Outlet]); - config->SetOutlet_Density(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); // TK maybe use own function here, but otherwise no problem - config->SetOutlet_Area(iMarker_Outlet, Outlet_Area_Total[iMarker_Outlet]); // TK maybe use own function here, but otherwise no problem - } - } - - // Subtract the bulk temperature to set Q - // OPTION 3 compute energy Q via inlet and outlet bulk temperature, after FLuent way bulk tmep is not computed correctly - // HARD CODED for 2 markers and the absolutr value should not be here!!! TDE - su2double dT = 0.0; - dT = fabs(Outlet_Temperature_Total[1] - Outlet_Temperature_Total[0]); // TK !! Here was Density before as the container was used for that - - if (iMesh == MESH_0) { - if (config->GetExtIter() == 0) { config->SetPeriodic_HeatfluxIntegrated(3.1415); } // TK HARDCODED starting help with value from BC definition - else { config->SetPeriodic_HeatfluxIntegrated(dT*config->GetPeriodic_MassFlow("outlet")*node[0]->GetSpecificHeatCp());} - } - - /*--- Screen output using the values already stored in the config container ---*/ - - if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { - - cout.precision(5); - cout.setf(ios::fixed, ios::floatfield); - - if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - cout << endl << "---------------------------- Outlet properties Fluent way --------------------------" << endl; - } - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_Periodic_TagBound(iMarker_Outlet); - if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - /*--- Geometry defintion ---*/ - - cout <<"Outlet surface: " << Outlet_TagBound << "." << endl; + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); + MassFlow_Local += AreaNormal[iDim] * AxiFactor * node[iPoint]->GetDensity() * node[iPoint]->GetVelocity(iDim); + } + FaceArea = sqrt(FaceArea); + Area_Local += FaceArea; + Average_Density_Local += FaceArea * node[iPoint]->GetDensity(); - - su2double Outlet_mDot = fabs(config->GetPeriodic_MassFlow(Outlet_TagBound)) * config->GetDensity_Ref() * config->GetVelocity_Ref(); - cout << "Outlet mass flow (kg/s): "; cout << setprecision(5) << Outlet_mDot << endl; - - cout <<"Bulk temperature difference: " << dT * config->GetTemperature_Ref()<< " : Q : " << config->GetPeriodic_HeatfluxIntegrated() * config->GetHeat_Flux_Ref() << endl; + } // if domain + } // loop vertices + } // loop periodic boundaries + } // loop MarkerAll - } - } + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo + SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + + // Set quantity by stringtag + Average_Density_Global /= Area_Global; + config->SetStreamwise_Periodic_MassFlow(MassFlow_Global); + + if (rank == MASTER_NODE) { cout << "MassFlow_Global: " << MassFlow_Global * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } + if (rank == MASTER_NODE) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } + + if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { + /*------------------------------------------------------------------------------------------------*/ + /*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/ + /*--- The Pressure drop is iteratively adapted to result in the prescribed Target-Massflow. ---*/ + /*------------------------------------------------------------------------------------------------*/ + + /*--- Load/define all necessary variables ---*/ + su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); + su2double damping_factor = config->GetInc_Outlet_Damping(); + su2double Pressure_Drop_new, ddP; + + /*--- Compute update to Delta p based on massflow-difference ---*/ + ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); - if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; - cout << "-------------------------------------------------------------------------" << endl << endl; - } + /*--- Store updated pressure difference ---*/ + Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; + config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); - cout.unsetf(ios_base::floatfield); + /*--- Output the new value of Delta P and ddp ---*/ + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK Move whole computation up in front of output - } - + cout.precision(5); + cout.setf(ios::fixed, ios::floatfield); - // BEGIN HEAT FLUX LOOP ===================================== + cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; + cout << "New Delta P: " << Pressure_Drop_new * config->GetPressure_Ref() << endl; - nMarker_Outlet = config->GetnMarker_HeatFlux(); + cout.unsetf(ios_base::floatfield); + } // output + } // if massflow + + if (config->GetEnergy_Equation()) { + /*---------------------------------------------------------------------------------------------*/ + /*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/ + /*--- boundary term and recovered Temperature. The computation is not completely clear. ---*/ + /*--- Here the Heatflux from all Bounary markers in the config-file is used. ---*/ + /*---------------------------------------------------------------------------------------------*/ - /*--- Comute MassFlow, average temp, press, etc. ---*/ + su2double HeatFlux, HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; + string Marker_StringTag; + /*--- Loop over all Marker ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - Outlet_MassFlow[iMarker] = 0.0; - Outlet_Density[iMarker] = 0.0; - Outlet_Temperature[iMarker] = 0.0; - Outlet_Area[iMarker] = 0.0; - - if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ) { // This if-clause can be omitted for OPTION 2 + // Loop over all Heatflux marker + if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { + // Add up Heatflux + /*--- Identify the boundary by string name ---*/ + Marker_StringTag = config->GetMarker_All_TagBound(iMarker); for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -11331,9 +11229,7 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi if (geometry->node[iPoint]->GetDomain()) { - V_outlet = node[iPoint]->GetPrimitive(); - - geometry->vertex[iMarker][iVertex]->GetNormal(Vector); + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); if (axisymmetric) { if (geometry->node[iPoint]->GetCoord(1) != 0.0) @@ -11344,216 +11240,34 @@ void CIncEulerSolver::GetPeriodic_Properties(CGeometry *geometry, CConfig *confi AxiFactor = 1.0; } - Temperature = V_outlet[nDim+1]; - Pressure = V_outlet[0]; - Density = V_outlet[nDim+2]; - - /*--- Identify the boundary by string name ---*/ - - string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - - Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vel_Infty2 = 0.0; + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); + FaceArea = sqrt(FaceArea); - for (iDim = 0; iDim < nDim; iDim++) { - Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); - Velocity[iDim] = V_outlet[iDim+1]; - Velocity2 += Velocity[iDim] * Velocity[iDim]; - MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; - } - Area = sqrt (Area); - - /*--- Get the specified wall heat flux from config ---*/ - su2double Wall_HeatFlux = 0.0; - - /*--- OPTION 2 for Heatflux calculation from computing actual heatflux ---*/ - su2double GradTemperature = 0.0; - // turn off for no energy equation - for (iDim = 0; iDim < nDim; iDim++) // TK This would need to be done with recoverd Temperature!!! - GradTemperature -= node[iPoint]->GetGradient_Primitive(nDim+1, iDim)*Vector[iDim]; // Vector is Area normal TK should it be unit normal here? A test with division by Area showed that the area normal is correct - - su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); - Wall_HeatFlux = -thermal_conductivity*GradTemperature; - /*--- OPTION 1 for Heatflux calculation from config file ---*/ - Wall_HeatFlux = -config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + HeatFlux = -config->GetWall_HeatFlux(Marker_StringTag)/config->GetHeat_Flux_Ref(); /*--- END OPTIONS ---*/ - - Outlet_MassFlow[iMarker] += MassFlow; - Outlet_Density[iMarker] += Density*Area; - Outlet_Temperature[iMarker] += Wall_HeatFlux*Area; // /Area added due to real GradTemperature (Heatflux) computation. - Outlet_Area[iMarker] += Area; - - } - } - } - } - - /*--- Copy to the appropriate structure ---*/ - - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; - Outlet_Density_Local[iMarker_Outlet] = 0.0; - Outlet_Temperature_Local[iMarker_Outlet] = 0.0; - Outlet_Area_Local[iMarker_Outlet] = 0.0; - - Outlet_MassFlow_Total[iMarker_Outlet] = 0.0; - Outlet_Density_Total[iMarker_Outlet] = 0.0; - Outlet_Temperature_Total[iMarker_Outlet] = 0.0; - Outlet_Area_Total[iMarker_Outlet] = 0.0; - } - - /*--- Copy the values to the local array for MPI ---*/ - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX)) { - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_HeatFlux_TagBound(iMarker_Outlet); - cout << Outlet_TagBound << endl; - if (config->GetMarker_All_TagBound(iMarker) == Outlet_TagBound) { - Outlet_MassFlow_Local[iMarker_Outlet] += Outlet_MassFlow[iMarker]; - Outlet_Density_Local[iMarker_Outlet] += Outlet_Density[iMarker]; - Outlet_Temperature_Local[iMarker_Outlet] += Outlet_Temperature[iMarker]; - Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; - } - } - } - } - - /*--- All the ranks to compute the total value ---*/ - -#ifdef HAVE_MPI - - SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - -#else - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; - Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; - Outlet_Temperature_Total[iMarker_Outlet] = Outlet_Temperature_Local[iMarker_Outlet]; - Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; - } - -#endif - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { - Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; - } - else { - Outlet_Density_Total[iMarker_Outlet] = 0.0; - } - - if (iMesh == MESH_0) { - config->SetPeriodic_Heatflux(iMarker_Outlet, Outlet_Density_Total[iMarker_Outlet]); - Heatflux_Integrated += Outlet_Temperature_Total[iMarker_Outlet]; - } - } - - if (iMesh == MESH_0) { - config->SetPeriodic_HeatfluxIntegrated(Heatflux_Integrated); - } - - /*--- Screen output using the values already stored in the config container ---*/ - - if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { - - cout.precision(5); - cout.setf(ios::fixed, ios::floatfield); - - if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - cout << endl << "---------------------------- Outlet properties --------------------------" << endl; - } - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_TagBound = config->GetMarker_HeatFlux_TagBound(iMarker_Outlet); - if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - - /*--- Geometry defintion ---*/ - - cout <<"Heat flux surface: " << Outlet_TagBound << "." << endl; - - cout << setprecision(5) << scientific << "Q on surface: " << config->GetPeriodic_Heatflux(Outlet_TagBound) * config->GetHeat_Flux_Ref() << endl; - } - } + HeatFlow_Local += HeatFlux * FaceArea; // /Area added due to real GradTemperature (Heatflux) computation. + } // if Domain + } // loop Vertices + } // loop Heatflux marker + } // loop AllMarker - cout << "Heatflux_Integrated: " << Heatflux_Integrated * config->GetHeat_Flux_Ref() << endl; + // Mpi Communication sum up integrated Heatfdlux from all processes + SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; - cout << "-------------------------------------------------------------------------" << endl << endl; - } - - cout.unsetf(ios_base::floatfield); - - } - - /*--- Compute Update for Delta P if a massflow is prescribed for streamwise periodic BC ---*/ - - if (config->GetStreamwise_periodic_massflow() != 0.0) { - - /*--- Load/define all necessary variables ---*/ - - su2double Delta_P_old = config->GetDeltaP_BodyForce() / config->GetPressure_Ref(); // Nondimensionalize the dimensional cfg value - su2double Delta_P; - su2double Density_avg = config->GetOutlet_Density("outlet"); - su2double Area = config->GetOutlet_Area("outlet"); - su2double Massflow = config->GetPeriodic_MassFlow("outlet"); - su2double target_Massflow = config->GetStreamwise_periodic_massflow()/(config->GetDensity_Ref() * config->GetVelocity_Ref()); // Nondimensionalize the dimensional cfg value - su2double ddP; - su2double Damping = config->GetInc_Outlet_Damping(); - - /*--- Compute update to Delta p based on massflow-difference ---*/ - ddP = 0.5 / ( Density_avg * Area*Area) * (target_Massflow*target_Massflow - Massflow*Massflow); - - /*--- Store updated pressure difference ---*/ - Delta_P = Delta_P_old + Damping*ddP; - config->SetDeltaP_BodyForce(Delta_P); - - /*--- Output the new value of Delta P and ddp ---*/ - - if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK Move whole computation up in front of output - - cout.precision(5); - cout.setf(ios::fixed, ios::floatfield); - - if (write_heads && Output && !config->GetDiscrete_Adjoint()) { - cout << endl << "---------------------------- Streamwise periodic pressure: massflow update --------------------------" << endl; - } + /*--- Set the Integrated Heatflux ---*/ + if (iMesh == MESH_0) + config->SetStreamwise_Periodic_IntegratedHeatFlow(HeatFlow_Global); - cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; - cout << "New Delta P: " << Delta_P * config->GetPressure_Ref() << endl; - - if (write_heads && Output && !config->GetDiscrete_Adjoint()) {cout << endl; - cout << "-------------------------------------------------------------------------" << endl << endl; - } - - cout.unsetf(ios_base::floatfield); + if (rank == MASTER_NODE) { cout << "HeatFlow_Global: " << HeatFlow_Global * config->GetHeat_Flux_Ref() << endl; } + } // if energy - } - } - - delete [] Outlet_MassFlow_Local; - delete [] Outlet_Density_Local; - delete [] Outlet_Temperature_Local; - delete [] Outlet_Area_Local; - - delete [] Outlet_MassFlow_Total; - delete [] Outlet_Density_Total; - delete [] Outlet_Temperature_Total; - delete [] Outlet_Area_Total; - - delete [] Outlet_MassFlow; - delete [] Outlet_Density; - delete [] Outlet_Temperature; - delete [] Outlet_Area; - - } - + /*--- Free allocated memory. ---*/ + delete [] AreaNormal; + if (rank == MASTER_NODE) { cout << "------------------------------- New Routine End --------------------------" << endl; } } void CIncEulerSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ @@ -12556,6 +12270,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container bool fixed_cl = config->GetFixed_CL_Mode(); bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; bool outlet = ((config->GetnMarker_Outlet() != 0)); + bool energy = config->GetEnergy_Equation(); /*--- Store the original volume for periodic cells on the boundaries, since this will be increased as we complete the CVs during our @@ -12614,19 +12329,27 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- Compute recovered pressure and temperature for streamwise periodic BC ---*/ + /*--- Compute recovered pressure and temperature for streamwise periodic BC + Second conditional is there to avoid a zero (massflow) in the denominator for recovered temperature. ---*/ - if (config->GetPeriodic_BC_Body_Force()) { + if (config->GetKind_Streamwise_Periodic()) { /*--- Define and initialize helping variables ---*/ - su2double norm2_translation = 0.0, dot_product; - su2double Pressure_Recovered, Temperature_Recovered; + su2double norm2_translation = 0.0, + dot_product, + Pressure_Recovered, + Temperature_Recovered; + + su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(), + HeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(), + MassFlow = config->GetStreamwise_Periodic_MassFlow(); + su2double *Reference_node = new su2double[nDim]; /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector and compute square of the distance between the 2 periodic surfaces. ---*/ for (iDim = 0; iDim < nDim; iDim++) { - Reference_node[iDim] = config->GetPeriodicRefNode_BodyForce()[iDim]; + Reference_node[iDim] = config->GetStreamwise_Periodic_RefNode()[iDim]; norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } @@ -12636,25 +12359,21 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) - dot_product += fabs((geometry->node[iPoint]->GetCoord(iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); + dot_product += fabs( (geometry->node[iPoint]->GetCoord(iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ - Pressure_Recovered = node[iPoint]->GetSolution(0) - ( config->GetDeltaP_BodyForce()/config->GetPressure_Ref() ) / norm2_translation * dot_product; - node[iPoint]->SetPressure_Recovered(Pressure_Recovered); - - if (config->GetEnergy_Equation()) { - Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); + Pressure_Recovered = node[iPoint]->GetSolution(0) - delta_p / norm2_translation * dot_product; + node[iPoint]->SetStreamwise_Periodic_RecoveredPressure(Pressure_Recovered); - /*--- Avoid m_dot=0 in 0th iteration, as m_dot is in the denominator ---*/ - if (config->GetExtIter() > 0) - Temperature_Recovered += config->GetPeriodic_HeatfluxIntegrated()/config->GetPeriodic_MassFlow("outlet")/node[iPoint]->GetSpecificHeatCp()*dot_product/norm2_translation; // TK HARDCODED inlet !!!!! - - node[iPoint]->SetTemperature_Recovered(Temperature_Recovered); + if (energy && ExtIter > 0) { + Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); + Temperature_Recovered += HeatFlow / (MassFlow * node[iPoint]->GetSpecificHeatCp() * norm2_translation) * dot_product; + node[iPoint]->SetStreamwise_Periodic_RecoveredTemperature(Temperature_Recovered); } } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - GetPeriodic_Properties(geometry, config, iMesh, Output); + GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Free allocated memory. ---*/ delete [] Reference_node; @@ -13561,7 +13280,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai /*--- With streamwise periodic BC and heatflux walls an additional term is introduced in the boundary formulation ---*/ - if (config->GetPeriodic_BC_Body_Force()) { + if (config->GetKind_Streamwise_Periodic()) { su2double Cp = node[iPoint]->GetSpecificHeatCp(); su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); @@ -13569,16 +13288,16 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai for (iDim = 0; iDim < nDim; iDim++) { norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } - + /*--- Scalar part of the contribution ---*/ - su2double Body_Force_T = config->GetPeriodic_HeatfluxIntegrated()*thermal_conductivity / (config->GetPeriodic_MassFlow("outlet") * Cp * norm2_translation); // TK hardcoded outlet! + su2double scalar_factor = config->GetStreamwise_Periodic_IntegratedHeatFlow()*thermal_conductivity / (config->GetStreamwise_Periodic_MassFlow() * Cp * norm2_translation); /*--- Scalar product ---*/ for (iDim = 0; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } - Res_Visc[nDim+1] -= Body_Force_T*dot_product; + Res_Visc[nDim+1] -= scalar_factor*dot_product; } /*--- Viscous contribution to the residual at the wall ---*/ diff --git a/config_template.cfg b/config_template.cfg index 3eca6677e7ba..7116c955dffa 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -544,6 +544,20 @@ BODY_FORCE= NO % Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= NONE +% +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 1.0 +% +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.0 + % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Euler wall boundary marker(s) (NONE = no marker) From 12998d4a7da39b721ef4adefc837d4894d8c0fb3 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 20 May 2019 07:55:45 +0200 Subject: [PATCH 016/326] Added grad of eddy visc for streamwise per of energy eq with turbulence. --- Common/src/geometry_structure.cpp | 2 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 4 ++-- SU2_CFD/src/variable_direct_mean_inc.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 SU2_CFD/src/numerics_direct_mean_inc.cpp mode change 100644 => 100755 SU2_CFD/src/variable_direct_mean_inc.cpp diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index c62de7faba15..aeee9ff589ef 100755 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -17781,7 +17781,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, unsigned short val_period cout << "Streamwise Periodic Reference Node: ["; for (iDim = 0; iDim < nDim; iDim++) cout << " " << Buffer_Send_RefNode[iDim]; - cout << " " << endl; + cout << " ]" << endl; } /*--- Free allocated memory. ---*/ diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp old mode 100644 new mode 100755 index 6e04244165cc..2e025b7f1735 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -275,6 +275,7 @@ CCentJSTInc_Flow::~CCentJSTInc_Flow(void) { void CCentJSTInc_Flow::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) { + //TK:: PReaccumulation missing! /*--- Primitive variables at point i and j ---*/ Pressure_i = V_i[0]; Pressure_j = V_j[0]; @@ -922,8 +923,7 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) - dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+4][iDim]; // gradient of eddy viscosity, TK not readliy available yet +4 only to prevent out of bound error/segfault - + dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity val_residual[nDim+1] -= Volume * scalar_factor * dot_product; } // turbulent diff --git a/SU2_CFD/src/variable_direct_mean_inc.cpp b/SU2_CFD/src/variable_direct_mean_inc.cpp old mode 100644 new mode 100755 index caebe36c721d..f6f8a87aebfa --- a/SU2_CFD/src/variable_direct_mean_inc.cpp +++ b/SU2_CFD/src/variable_direct_mean_inc.cpp @@ -88,7 +88,7 @@ CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velo /*--- Allocate and initialize the primitive variables and gradients ---*/ - nPrimVar = nDim+9; nPrimVarGrad = nDim+4; + nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu /*--- Allocate residual structures ---*/ @@ -161,7 +161,7 @@ CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velo Primitive = new su2double [nPrimVar]; for (iVar = 0; iVar < nPrimVar; iVar++) Primitive[iVar] = 0.0; - /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta) + /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu) //TK:: for periodic turb EddyMu * We need P, and rho for running the adjoint problem ---*/ Gradient_Primitive = new su2double* [nPrimVarGrad]; @@ -216,7 +216,7 @@ CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val /*--- Allocate and initialize the primitive variables and gradients ---*/ - nPrimVar = nDim+9; nPrimVarGrad = nDim+4; + nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu /*--- Allocate residual structures ---*/ @@ -282,7 +282,7 @@ CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val Primitive = new su2double [nPrimVar]; for (iVar = 0; iVar < nPrimVar; iVar++) Primitive[iVar] = 0.0; - /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta), + /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu), //TK:: for periodic turb EddyMu We need P, and rho for running the adjoint problem ---*/ Gradient_Primitive = new su2double* [nPrimVarGrad]; From 9d2308a7066600065f793c400339d291abb53605 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 11 Jun 2019 09:52:30 +0200 Subject: [PATCH 017/326] Fixed bouancy reg test by dividing body_force and str.per. source term. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 50 ++++++++++++++++++++------ 1 file changed, 40 insertions(+), 10 deletions(-) mode change 100644 => 100755 SU2_CFD/src/solver_direct_mean_inc.cpp diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp old mode 100644 new mode 100755 index 107e34bec596..c2cfb109c8b0 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2033,21 +2033,21 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - if (body_force || streamwise_periodic) { - + if (streamwise_periodic) { + /*--- Loop over all points ---*/ - + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - + /*--- Load the conservative variables ---*/ numerics->SetConservative(node[iPoint]->GetSolution(), node[iPoint]->GetSolution()); - + numerics->SetPrimitive(node[iPoint]->GetPrimitive(), NULL); - + /*--- Set incompressible density ---*/ - + numerics->SetDensity(node[iPoint]->GetDensity(), node[iPoint]->GetDensity()); @@ -2060,13 +2060,43 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->ComputeResidual(Residual, Jacobian_i, config); /*--- Add the source residual to the total ---*/ - + LinSysRes.AddBlock(iPoint, Residual); - + /*--- Add the implicit Jacobian contribution ---*/ - + if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); + + } + } + + if (body_force) { + + /*--- Loop over all points ---*/ + + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Load the conservative variables ---*/ + + numerics->SetConservative(node[iPoint]->GetSolution(), + node[iPoint]->GetSolution()); + + /*--- Set incompressible density ---*/ + + numerics->SetDensity(node[iPoint]->GetDensity(), + node[iPoint]->GetDensity()); + + /*--- Load the volume of the dual mesh cell ---*/ + + numerics->SetVolume(geometry->node[iPoint]->GetVolume()); + + /*--- Compute the body force source residual ---*/ + + numerics->ComputeResidual(Residual, config); + + /*--- Add the source residual to the total ---*/ + LinSysRes.AddBlock(iPoint, Residual); } } From f9a7f69dde18a3a093571b44c6d7009557c9251a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 11 Jun 2019 10:16:18 +0200 Subject: [PATCH 018/326] Sanitized streamwise periodc testcase. --- .travis.yml | 1 - .../half_cylinder/streamwise_periodic.cfg | 24 +++++++++---------- TestCases/parallel_regression.py | 4 ++-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 877568972f71..410717cf9794 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ branches: - feature_periodic_streamwise python: - - 2.7 - 3.6 env: diff --git a/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg b/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg index f31b31048631..675df6b49a84 100644 --- a/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg +++ b/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg @@ -84,22 +84,20 @@ VISCOSITY_MODEL= CONSTANT_VISCOSITY % Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 1e-4 % -% ----------------------- BODY FORCE DEFINITION -------------------------------% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Apply a body force as a source term (NO, YES) -BODY_FORCE= NO +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP % -% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) -BODY_FORCE_VECTOR= ( 1000.0, 0.0, 0.0 ) -% -% ----------------------- BODY FORCE FOR PERIODIC DEFINITION -------------------------------% -% -% Apply a body force as a source term (NO, YES) -PERIODIC_BC_BODY_FORCE= YES -% -% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) -DELTA_P_BODY_FORCE= 8.0 +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 8.0 % +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.0 + % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 108ae4b4bb03..7b96b9b8b4fc 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -350,11 +350,11 @@ def main(): test_list.append(inc_buoyancy) # Laminar cylinder in channel, streamwise periodic - streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') + streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/half_cylinder" streamwise_periodic_cylinder.cfg_file = "streamwise_periodic.cfg" streamwise_periodic_cylinder.test_iter = 10 - streamwise_periodic_cylinder.test_vals = [-7.024390, -5.517378, 0.015077, 0.016414] #last 4 lines + streamwise_periodic_cylinder.test_vals = [-6.984615, -6.126544, 0.016574, 0.016927] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 From 410e1a46979d364dbba17168f5358efa859bd063 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 9 Jul 2019 11:08:43 +0200 Subject: [PATCH 019/326] Total Pressure Obj function adapted to use recovered pressure for streamwise periodic cases. --- SU2_CFD/src/output_structure.cpp | 7 ++++++- SU2_CFD/src/solver_direct_mean_inc.cpp | 2 +- config_template.cfg | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) mode change 100644 => 100755 SU2_CFD/src/output_structure.cpp mode change 100644 => 100755 config_template.cfg diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp old mode 100644 new mode 100755 index e392e500a9fc..a0abd4ba698f --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output_structure.cpp @@ -19015,6 +19015,9 @@ void COutput::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, if (AxiFactor == 0.0) Vn = 0.0; else Vn /= Area; Vn2 = Vn * Vn; Pressure = solver->node[iPoint]->GetPressure(); + /*--- TK:: In streamwise periodic cases the (working variable) pressure difference shoul be zero. ---*/ + if(config->GetKind_Streamwise_Periodic() != NONE) + Pressure = solver->node[iPoint]->GetStreamwise_Periodic_RecoveredPressure(); SoundSpeed = solver->node[iPoint]->GetSoundSpeed(); for (iDim = 0; iDim < nDim; iDim++) { @@ -19309,7 +19312,9 @@ void COutput::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { if (nMarker_Analyze == 2) { - su2double Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref(); + //su2double Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref(); + //TK:: Like that total pressure drop is taken + su2double Pressure_Drop = (Surface_TotalPressure_Total[1]-Surface_TotalPressure_Total[0]) * config->GetPressure_Ref(); config->SetSurface_PressureDrop(iMarker_Analyze, Pressure_Drop); } else { config->SetSurface_PressureDrop(iMarker_Analyze, 0.0); diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index c2cfb109c8b0..4c4c98bc5700 100755 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -6463,7 +6463,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo Average_Density_Global /= Area_Global; config->SetStreamwise_Periodic_MassFlow(MassFlow_Global); - if (rank == MASTER_NODE) { cout << "MassFlow_Global: " << MassFlow_Global * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } + if (rank == MASTER_NODE) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } if (rank == MASTER_NODE) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { diff --git a/config_template.cfg b/config_template.cfg old mode 100644 new mode 100755 index 404d4248ef2b..9b18f707a1aa --- a/config_template.cfg +++ b/config_template.cfg @@ -304,6 +304,12 @@ UNST_INT_ITER= 200 % % Iteration number to begin unsteady restarts UNST_RESTART_ITER= 0 +% +% +UNST_ADJOINT_ITER= 0 +% +% +ITER_AVERAGE_OBJ= 0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % From 4defd96d0f45e577b3456023979953bd09650a9a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 15 Jul 2019 16:52:31 +0200 Subject: [PATCH 020/326] Added 3D 1slice pipe Testcase. --- TestCases/.gitignore | 1 - .../streamwise_periodic/README.md | 9 + .../half_cylinder_2D/half_cylinder_2D.cfg} | 2 +- .../pipe_slice_3D/pipe3Dslice.cfg | 263 ++++++++++++++++++ .../pipe_slice_3D/tricontourf.py | 70 +++++ 5 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/README.md rename TestCases/incomp_navierstokes/{half_cylinder/streamwise_periodic.cfg => streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg} (99%) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg create mode 100755 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py diff --git a/TestCases/.gitignore b/TestCases/.gitignore index 6ee7dd18cdce..bbf17aef58e0 100644 --- a/TestCases/.gitignore +++ b/TestCases/.gitignore @@ -20,7 +20,6 @@ *.cgns *.tgz COPYING -README.md *.autotest config_*.cfg *.eqn diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md new file mode 100644 index 000000000000..836deae373b0 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/README.md @@ -0,0 +1,9 @@ +# Streamwise Periodicity testcases + +## `half_cylinder_2D` +half cylinder massflow prescribed heated cylinder + +## `pipe_slice_3D` +analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed, heated walls + +`Re = rho * v * L / mu = 1.0 * ? * 5e-3 / 1.8e-5` bei v -> averaged (mass or area weighted?) velocity the critical Re ~= 2300 (v = 0.6 for now) makes Re=167 diff --git a/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg similarity index 99% rename from TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 675df6b49a84..60d6ee03869f 100644 --- a/TestCases/incomp_navierstokes/half_cylinder/streamwise_periodic.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -226,7 +226,7 @@ SOLUTION_FLOW_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +OUTPUT_FORMAT= TECPLOT_BINARY % % Output file convergence history (w/o extension) CONV_FILENAME= history diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg new file mode 100644 index 000000000000..1a5ef13dc37d --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -0,0 +1,263 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Poiseuille flow case for testing a body force/periodicity % +% Author: Thomas D. Economon % +% Institution: Stanford University % +% Date: 2017.02.27 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +% +% Regime type (COMPRESSIBLE, INCOMPRESSIBLE, FREESURFACE) +REGIME_TYPE= INCOMPRESSIBLE +% +% If Navier-Stokes, kind of turbulent model (NONE, SA) +KIND_TURB_MODEL= NONE +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= NO +% +% Write binary restart files (YES, NO) +WRT_BINARY_RESTART= NO +% +% Read binary restart files (YES, NO) +READ_BINARY_RESTART= NO + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +% Reference origin for moment computation (m or in) +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +% +% Reference length for pitching, rolling, and yawing non-dimensional +% moment (m or in) +REF_LENGTH= 0.001 +% +% Reference area for force coefficients (0 implies automatic +% calculation) (m^2 or in^2) +REF_AREA= 1.0 +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. +INC_DENSITY_MODEL= CONSTANT +% +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = NO +% +% Initial density for incompressible flows +% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) +INC_DENSITY_INIT= 1.0 +% +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= ( 0.0, 0.0, 1.0 ) +% +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +%INC_NONDIM= INITIAL_VALUES +INC_NONDIM= DIMENSIONAL +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) +FLUID_MODEL= CONSTANT_DENSITY +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.8e-5 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +%KIND_STREAMWISE_PERIODIC= MASSFLOW +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +% +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 0.001 +% +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. +STREAMWISE_PERIODIC_MASSFLOW= 0.00270 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= (wall, 0.0) +% +% Symmetry boundary marker(s) (NONE = no marker) +%MARKER_SYM= ( fluid_sym ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( inlet, outlet, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0005 ) +% +% Marker(s) of the surface to be plotted or designed +MARKER_PLOTTING= ( inlet ) +% +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= (wall) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( oulet ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = AREA + +% Kind of adaptation (needed to create the initial periodic mesh) +%KIND_ADAPT= PERIODIC + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +% Courant-Friedrichs-Lewy condition of the finest grid +CFL_NUMBER= 50000 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) +% +% Number of total iterations +EXT_ITER= 20000 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver for implicit formulations (BCGSTAB, FGMRES) +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-15 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 20 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= FDS +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +% +% Coefficient for the limiter (smooth regions) +VENKAT_LIMITER_COEFF= 0.03 +% +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.5, 0.04 ) +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (CAUCHY, RESIDUAL) +% +CONV_CRITERIA= RESIDUAL +% +% Residual reduction (order of magnitude with respect to the initial value) +RESIDUAL_REDUCTION= 18 +% +% Min value of the residual (log10 of the residual) +RESIDUAL_MINVAL= -24 +% +% Start convergence criteria at iteration number +STARTCONV_ITER= 10 +% +% Number of elements to apply the criteria +CAUCHY_ELEMS= 100 +% +% Epsilon to control the series convergence +CAUCHY_EPS= 1E-6 +% +% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, +% SENS_MACH, DELTA_LIFT, DELTA_DRAG) +CAUCHY_FUNC_FLOW= DRAG + +% ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 +% +% Mesh input file +MESH_FILENAME= pipe1cell3D.su2 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FLOW_FILENAME= solution_flow.dat +% +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= solution_adj.dat +% +% Output file format (PARAVIEW, TECPLOT, STL) +OUTPUT_FORMAT= TECPLOT +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FLOW_FILENAME= solution_flow.dat +% +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat +% +% Output file flow (w/o extension) variables +VOLUME_FLOW_FILENAME= flow +% +% Output file adjoint (w/o extension) variables +VOLUME_ADJ_FILENAME= adjoint +% +% Output objective function gradient (using continuous adjoint) +GRAD_OBJFUNC_FILENAME= of_grad.dat +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FLOW_FILENAME= surface_flow +% +% Output file surface adjoint coefficient (w/o extension) +SURFACE_ADJ_FILENAME= surface_adjoint +% +% Writing solution file frequency +WRT_SOL_FREQ= 200 +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +WRT_RESIDUALS= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py new file mode 100755 index 000000000000..d07ab53d1ff1 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py @@ -0,0 +1,70 @@ +# --------------------------------------------------------------------------- # +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +from mpl_toolkits.mplot3d import Axes3D +from scipy.spatial import Delaunay +from matplotlib.colors import LightSource + +# --------------------------------------------------------------------------- # +# implort .dat surface file solution +data = pd.read_csv("surface_flow.dat", nrows=4264, skiprows=3, sep='\t', header=None) +x = data[0][:] +y = data[1][:] +vel_z = data[6][:] + +# create surface triangulation +points2D = np.vstack([x,y]).T +tri = Delaunay(points2D) + +# --------------------------------------------------------------------------- # +analytic_sol = -1/(4*1.8e-5) * (-0.001/5e-4) * (5e-3**2 - ((x**2 + y**2)**(0.5))**2 ) +# plot the percentage of deviation '(analytic - sim)/sim*100' for each point +perc_devi_from_anal = abs(analytic_sol - vel_z) / max(analytic_sol) * 100 + +# get absolute maximum of dataset +maxvel = max(abs(perc_devi_from_anal)) +# --------------------------------------------------------------------------- # + +fig, ax = plt.subplots(2,2) +# --------------------------------------------------------------------------- # +# 1. analytical solution +ax[0,0].set_title("Analytical solution") +ax[0,0].set_aspect('equal') +tcf1 = ax[0,0].tricontourf(x, y, abs(analytic_sol)) +ax[0,0].scatter(x,y, s=0.1, color='black', marker='.') + +print(min(analytic_sol)) + +fig.colorbar(tcf1, ax=ax[0,0]) +# --------------------------------------------------------------------------- # +# 2. simulated solution +ax[0,1].set_title("Simulated solution") +ax[0,1].set_aspect('equal') +tcf = ax[0,1].tricontourf(x, y, vel_z) +ax[0,1].scatter(x,y, s=0.1, color='black', marker='.') + +fig.colorbar(tcf, ax=ax[0,1]) +# --------------------------------------------------------------------------- # +# 3. absolute value deviation between analytic and simulated +ax[1,0].set_title("abs(analytic-simulated)") +ax[1,0].set_aspect('equal') +tcf = ax[1,0].tricontourf(x, y, abs(analytic_sol-vel_z), cmap=plt.cm.Greys) +ax[1,0].scatter(x,y, s=0.1, color='black', marker='.') + +fig.colorbar(tcf, ax=ax[1,0]) +# --------------------------------------------------------------------------- #a +# 4. percentual deviation scaled by the maximal value +ax[1,1].set_title("abs(analytic-simulated) / max(analytic) * 100") +#tcf = ax.tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.seismic, vmin=-maxvel, vmax=maxvel) +ax[1,1].set_aspect('equal') +tcf = ax[1,1].tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.Greys, vmin=0.0, vmax=maxvel) +ax[1,1].scatter(x,y, s=0.1, color='black', marker='.') + +fig.colorbar(tcf, ax=ax[1,1]) +# --------------------------------------------------------------------------- #a + +#plt.savefig('foo.png', dpi=500) +plt.show() + From ee06990ff85cb8807a6ba938b3d9d79faaa20f7e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 16 Jul 2019 16:44:18 +0200 Subject: [PATCH 021/326] Streamwise periodic pipe case added py script for visualization and gmsh script for the mesh. --- .../streamwise_periodic/README.md | 5 +- .../pipe_slice_3D/pipeslice.geo | 112 ++++++++++++ .../pipe_slice_3D/plots.py | 161 ++++++++++++++++++ .../pipe_slice_3D/tricontourf.py | 70 -------- 4 files changed, 277 insertions(+), 71 deletions(-) mode change 100644 => 100755 TestCases/incomp_navierstokes/streamwise_periodic/README.md create mode 100755 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py delete mode 100755 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md old mode 100644 new mode 100755 index 836deae373b0..14ecbec447df --- a/TestCases/incomp_navierstokes/streamwise_periodic/README.md +++ b/TestCases/incomp_navierstokes/streamwise_periodic/README.md @@ -1,9 +1,12 @@ # Streamwise Periodicity testcases -## `half_cylinder_2D` +## `half_cylinder_2D` half cylinder massflow prescribed heated cylinder ## `pipe_slice_3D` analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed, heated walls `Re = rho * v * L / mu = 1.0 * ? * 5e-3 / 1.8e-5` bei v -> averaged (mass or area weighted?) velocity the critical Re ~= 2300 (v = 0.6 for now) makes Re=167 + +It would nice to have a Re ~= 1500 to have a better testcase (achieve that with v~5 or 6 i.e. scale Delta P by factor 10 from 0.001 to 0.01) + diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo new file mode 100755 index 000000000000..214739f03472 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo @@ -0,0 +1,112 @@ +//-------------------------------------------------------------------------------------// +//Kattmann, 13.05.2018, 3D Butterfly mesh in a circular pipe +//-------------------------------------------------------------------------------------// + +// Evoque Meshing Algorithm? +Do_Meshing= 1; // 0=false, 1=true +// Write Mesh files in .su2 format +Write_mesh= 1; // 0=false, 1=true + +//Geometric inputs, ch: channel, Pin center is origin +Radius= 0.5e-2; // Pipe Radius +InnerBox= Radius/2; // Distance to the inner Block of the butterfly mesh + +//Mesh inputs +gridsize = 0.1; // unimportant once everything is structured + +//ch_box +Nbox = 30; // Inner Box points in x direction + +Ncircu = 30; // Outer ring circu. points +Rcircu = 0.9; // Spacing towards wall + +sqrtTwo = Cos(45*Pi/180); + +//-------------------------------------------------------------------------------------// +//Points +// Inner Box +Point(1) = {-InnerBox, -InnerBox, 0, gridsize}; +Point(2) = {-InnerBox, InnerBox, 0, gridsize}; +Point(3) = {InnerBox, InnerBox, 0, gridsize}; +Point(4) = {InnerBox, -InnerBox, 0, gridsize}; + +// Outer Ring +Point(5) = {-Radius*sqrtTwo, -Radius*sqrtTwo, 0, gridsize}; +Point(6) = {-Radius*sqrtTwo, Radius*sqrtTwo, 0, gridsize}; +Point(7) = {Radius*sqrtTwo, Radius*sqrtTwo, 0, gridsize}; +Point(8) = {Radius*sqrtTwo, -Radius*sqrtTwo, 0, gridsize}; + +Point(9) = {0,0,0,gridsize}; // Helper Point for circles + +//-------------------------------------------------------------------------------------// +//Lines +//Inner Box (clockwise) +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; + +//Walls (clockwise) +Circle(5) = {5, 9, 6}; +Circle(6) = {6, 9, 7}; +Circle(7) = {7, 9, 8}; +Circle(8) = {8, 9, 5}; + +//Connecting lines (outward facing) +Line(9) = {1, 5}; +Line(10) = {2, 6}; +Line(11) = {3, 7}; +Line(12) = {4, 8}; + +//-------------------------------------------------------------------------------------// +//Lineloops and surfaces +// Inner Box (clockwise) +Line Loop(1) = {1,2,3,4}; Plane Surface(1) = {1}; + +// Ring sections (clockwise starting at 9 o'clock) +Line Loop(2) = {5, -10, -1, 9}; Plane Surface(2) = {2}; +Line Loop(3) = {10, 6, -11, -2}; Plane Surface(3) = {3}; +Line Loop(4) = {-3, 11, 7, -12}; Plane Surface(4) = {4}; +Line Loop(5) = {12, 8, -9, -4}; Plane Surface(5) = {5}; + +//make structured mesh with transfinite lines +//radial +Transfinite Line{1, 2, 3, 4, 5, 6, 7, 8} = Nbox; +//circumferential +Transfinite Line{9, 10, 11, 12} = Ncircu Using Progression Rcircu; + +Transfinite Surface{1,2,3,4,5}; +Recombine Surface{1,2,3,4,5}; + +//Extrude 1 mesh layer +Extrude {0, 0, 0.0005} { + Surface{1}; Surface{2}; Surface{3}; Surface{4}; Surface{5}; + Layers{1}; + Recombine; +} +Coherence; + +//Physical groups made with GUI +Physical Surface("inlet") = {4, 1, 5, 3, 2}; +Physical Surface("outlet") = {100, 122, 56, 78, 34}; +Physical Surface("wall") = {69, 95, 113, 43}; +Physical Volume("fluid") = {1, 2, 3, 4, 5}; + +// ----------------------------------------------------------------------------------- // +// Meshing +Transfinite Surface "*"; +Recombine Surface "*"; + +If (Do_Meshing == 1) + Mesh 1; Mesh 2; Mesh 3; +EndIf + +// ----------------------------------------------------------------------------------- // +// Write .su2 meshfile +If (Write_mesh == 1) + + Mesh.Format = 42; // .su2 mesh format, + Save "pipe1cell3D.su2"; + +EndIf + diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py new file mode 100644 index 000000000000..26ffcdc15240 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py @@ -0,0 +1,161 @@ +# --------------------------------------------------------------------------- # +# Kattmann, 16.07.2019 +# This python script provides some plots to test the match between analytical +# and simulated solution for a 3D circular laminar pipe flow, either from +# streamwise periodic simulation or the outlet of a suitable long pipe. +# +# requires: surface_flow.dat in current directory +# +# output: plots (opened in separate window, not saved) +# +# optional: which plots to show +showLineplot = True +show2Dsurfaceplots = True +show3Dplots = True +# --------------------------------------------------------------------------- # +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from mpl_toolkits.mplot3d import Axes3D +from scipy.spatial import Delaunay +from scipy.interpolate import LinearNDInterpolator + +# --------------------------------------------------------------------------- # +# Import data from surface_flow.dat into pandas dataframe +data = pd.read_csv("surface_flow.dat", nrows=4264, skiprows=3, sep='\t', header=None) +x = data[0][:] +y = data[1][:] +vel_z = data[6][:] + +# Create Delaunay surface triangulation from scatterd dataset +points2D = np.vstack([x,y]).T +tri = Delaunay(points2D) + +# --------------------------------------------------------------------------- # +# Create analytic solution vector on the same points as the imported data +dynanmic_vsicosity = 1.8e-5 +pressure_drop = 1e-3 +domain_length = 5e-4 +radius = 5e-3 + +analytic_sol = -1/(4*dynanmic_vsicosity) * (-pressure_drop/domain_length) * \ + (radius**2 - ((x**2 + y**2)**(0.5))**2 ) + +perc_devi_from_anal = abs(analytic_sol - vel_z) / max(analytic_sol) * 100 +maxvel = max(abs(perc_devi_from_anal)) # get absolute maximum of dataset + +# --------------------------------------------------------------------------- # +# Plot velocity on line from domain midpoint to wall +if showLineplot: + plt.close() + + # interpolator (ip) for simulated and analytical dataset + ip_sim = LinearNDInterpolator(tri, vel_z) + ip_ana = LinearNDInterpolator(tri, analytic_sol) + # line (which lies on the x-axis) where values will be interpolated + n_sample_points = 30 + x_line = np.linspace(0, radius-5e-6, n_sample_points) + y_line = np.zeros(n_sample_points) + ip_pos = np.vstack((x_line,y_line)).T + + ax = plt.axes() + plt.plot(ip_sim(ip_pos), x_line, color='b', marker='', linestyle='--', linewidth=3, label='simulated') + plt.plot(ip_ana(ip_pos), x_line, color='r', marker='', linestyle=':' , linewidth=3, label='analytical') + plt.legend() + plt.title('Velocity profile: analytic vs simulated (interpolated values)') + plt.xlabel('velocity [m/s]') + plt.ylabel('radius [m]') + ax.set_aspect(aspect=max(ip_sim(ip_pos)) / max(x_line)) # make plot square + plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0)) + plt.grid(True, linestyle='--') + plt.show() + +# --------------------------------------------------------------------------- # +# Plot various 2D surface plots of sim. and analy. data +if show2Dsurfaceplots: + plt.close() + + fig, ax = plt.subplots(2,2) + + # 1. analytical solution + ax_tmp = ax[0,0] + + tcf = ax_tmp.tricontourf(x, y, abs(analytic_sol)) + ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') + + ax_tmp.set_title("Analytical solution") + ax_tmp.set_aspect('equal') + fig.colorbar(tcf, ax=ax_tmp) + + # 2. simulated solution + ax_tmp = ax[1,0] + + tcf = ax_tmp.tricontourf(x, y, vel_z) + ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') + + ax_tmp.set_title("Simulated solution") + ax_tmp.set_aspect('equal') + fig.colorbar(tcf, ax=ax_tmp) + + # 3. absolute value deviation between analytic and simulated + ax_tmp = ax[0,1] + + tcf = ax_tmp.tricontourf(x, y, abs(analytic_sol-vel_z), cmap=plt.cm.Greys) + ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') + + ax_tmp.set_title("abs(analytic-simulated)") + ax_tmp.set_aspect('equal') + fig.colorbar(tcf, ax=ax_tmp) + + # 4. percentual deviation scaled by the maximal value + ax_tmp = ax[1,1] + + tcf = ax_tmp.tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.Greys, vmin=0.0, vmax=maxvel) + ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') + + ax_tmp.set_title("abs(analytic-simulated) / max(analytic) * 100") + ax_tmp.set_aspect('equal') + fig.colorbar(tcf, ax=ax_tmp) + + plt.show() + +# --------------------------------------------------------------------------- # +if show3Dplots: + # Plot 3D surfaces of sim. and analy. data + plt.close() + + # Scatter plot deviation + fig = plt.figure() + ax = fig.gca(projection='3d') + + ax.scatter(x, y, perc_devi_from_anal) + ax.set_xlabel('x [m]') + ax.set_ylabel('y [m]') + ax.set_zlabel('z-Velocity deviation [%]') + + plt.show() + + # Surface plot deviation + fig = plt.figure() + ax = fig.gca(projection='3d') + + surf = ax.plot_trisurf(x, y, perc_devi_from_anal, triangles=tri.simplices, cmap='jet', linewidth=0) + ax.set_xlabel('x [m]') + ax.set_ylabel('y [m]') + ax.set_zlabel('z-Velocity deviation [%]') + fig.colorbar(surf) + + plt.show() + + # Surface plot of velocity + fig = plt.figure() + ax = fig.gca(projection='3d') + + surf = ax.plot_trisurf(x, y, vel_z, triangles=tri.simplices, cmap='jet', linewidth=0) + ax.set_xlabel('x [m]') + ax.set_ylabel('y [m]') + ax.set_zlabel('z-Velocity [m/s]') + fig.colorbar(surf) + + plt.show() diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py deleted file mode 100755 index d07ab53d1ff1..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/tricontourf.py +++ /dev/null @@ -1,70 +0,0 @@ -# --------------------------------------------------------------------------- # -import matplotlib.pyplot as plt -import numpy as np -import pandas as pd - -from mpl_toolkits.mplot3d import Axes3D -from scipy.spatial import Delaunay -from matplotlib.colors import LightSource - -# --------------------------------------------------------------------------- # -# implort .dat surface file solution -data = pd.read_csv("surface_flow.dat", nrows=4264, skiprows=3, sep='\t', header=None) -x = data[0][:] -y = data[1][:] -vel_z = data[6][:] - -# create surface triangulation -points2D = np.vstack([x,y]).T -tri = Delaunay(points2D) - -# --------------------------------------------------------------------------- # -analytic_sol = -1/(4*1.8e-5) * (-0.001/5e-4) * (5e-3**2 - ((x**2 + y**2)**(0.5))**2 ) -# plot the percentage of deviation '(analytic - sim)/sim*100' for each point -perc_devi_from_anal = abs(analytic_sol - vel_z) / max(analytic_sol) * 100 - -# get absolute maximum of dataset -maxvel = max(abs(perc_devi_from_anal)) -# --------------------------------------------------------------------------- # - -fig, ax = plt.subplots(2,2) -# --------------------------------------------------------------------------- # -# 1. analytical solution -ax[0,0].set_title("Analytical solution") -ax[0,0].set_aspect('equal') -tcf1 = ax[0,0].tricontourf(x, y, abs(analytic_sol)) -ax[0,0].scatter(x,y, s=0.1, color='black', marker='.') - -print(min(analytic_sol)) - -fig.colorbar(tcf1, ax=ax[0,0]) -# --------------------------------------------------------------------------- # -# 2. simulated solution -ax[0,1].set_title("Simulated solution") -ax[0,1].set_aspect('equal') -tcf = ax[0,1].tricontourf(x, y, vel_z) -ax[0,1].scatter(x,y, s=0.1, color='black', marker='.') - -fig.colorbar(tcf, ax=ax[0,1]) -# --------------------------------------------------------------------------- # -# 3. absolute value deviation between analytic and simulated -ax[1,0].set_title("abs(analytic-simulated)") -ax[1,0].set_aspect('equal') -tcf = ax[1,0].tricontourf(x, y, abs(analytic_sol-vel_z), cmap=plt.cm.Greys) -ax[1,0].scatter(x,y, s=0.1, color='black', marker='.') - -fig.colorbar(tcf, ax=ax[1,0]) -# --------------------------------------------------------------------------- #a -# 4. percentual deviation scaled by the maximal value -ax[1,1].set_title("abs(analytic-simulated) / max(analytic) * 100") -#tcf = ax.tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.seismic, vmin=-maxvel, vmax=maxvel) -ax[1,1].set_aspect('equal') -tcf = ax[1,1].tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.Greys, vmin=0.0, vmax=maxvel) -ax[1,1].scatter(x,y, s=0.1, color='black', marker='.') - -fig.colorbar(tcf, ax=ax[1,1]) -# --------------------------------------------------------------------------- #a - -#plt.savefig('foo.png', dpi=500) -plt.show() - From 99ca27408ff891e0920c074f6acd062becba5093 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 1 Aug 2019 18:05:08 +0200 Subject: [PATCH 022/326] Corrected path in regression file. --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index d553a30715e5..085cc18e0990 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -351,7 +351,7 @@ def main(): # Laminar cylinder in channel, streamwise periodic streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') - streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/half_cylinder" + streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" streamwise_periodic_cylinder.cfg_file = "streamwise_periodic.cfg" streamwise_periodic_cylinder.test_iter = 10 streamwise_periodic_cylinder.test_vals = [-6.984615, -6.126544, 0.016574, 0.016927] #last 4 lines From d83cc0c9234149e58d491e0d78b7ba183c177216 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 2 Aug 2019 13:06:15 +0200 Subject: [PATCH 023/326] Turbulent term removed for heat eq. --- SU2_CFD/src/numerics_direct_mean_inc.cpp | 2 +- .../streamwise_periodic/pipe_slice_3D/plots.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 2e025b7f1735..fd2395968889 100755 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -915,7 +915,7 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity gradient is added. ---*/ - if(turbulent) { + if(turbulent && false) { /*--- Compute the scalar factor ---*/ scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py index 26ffcdc15240..583c39545679 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py @@ -10,8 +10,8 @@ # # optional: which plots to show showLineplot = True -show2Dsurfaceplots = True -show3Dplots = True +show2Dsurfaceplots = False +show3Dplots = False # --------------------------------------------------------------------------- # import numpy as np import pandas as pd From 12f25406470645a9f08c52969e15aea68ffe2d99 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 7 Aug 2019 08:45:03 +0200 Subject: [PATCH 024/326] Changed .cfg filename in parallel_regression file. --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 085cc18e0990..04afd15a0379 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -352,7 +352,7 @@ def main(): # Laminar cylinder in channel, streamwise periodic streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" - streamwise_periodic_cylinder.cfg_file = "streamwise_periodic.cfg" + streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D" streamwise_periodic_cylinder.test_iter = 10 streamwise_periodic_cylinder.test_vals = [-6.984615, -6.126544, 0.016574, 0.016927] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" From 256a1562bf81c94fb102c45ed2cc873f745e29b8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 7 Aug 2019 13:25:28 +0200 Subject: [PATCH 025/326] Fixed singel name in parallel_reg.py. --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 04afd15a0379..8bfb0734315c 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -352,7 +352,7 @@ def main(): # Laminar cylinder in channel, streamwise periodic streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" - streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D" + streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" streamwise_periodic_cylinder.test_iter = 10 streamwise_periodic_cylinder.test_vals = [-6.984615, -6.126544, 0.016574, 0.016927] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" From 2ab0411f10cb413028416c49eb877e39ddd442f6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 8 Aug 2019 10:01:12 +0200 Subject: [PATCH 026/326] Readded forgotton source term initialization. --- SU2_CFD/src/drivers/CDriver.cpp | 4 +++- SU2_CFD/src/numerics_direct_mean_inc.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 SU2_CFD/src/drivers/CDriver.cpp diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp old mode 100644 new mode 100755 index ed25d59cd2fc..c2da16fcbc59 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2127,13 +2127,15 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CSolver ***solver, CNumeri if (config->GetBody_Force() == YES) if (incompressible) numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBodyForce(nDim, nVar_Flow, config); + else if (incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) + numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceBoussinesq(nDim, nVar_Flow, config); else if (config->GetRotating_Frame() == YES) numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceRotatingFrame_Flow(nDim, nVar_Flow, config); else if (config->GetAxisymmetric() == YES) if (incompressible) numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncAxisymmetric_Flow(nDim, nVar_Flow, config); - else numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceAxisymmetric_Flow(nDim, nVar_Flow, config); + else numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceAxisymmetric_Flow(nDim, nVar_Flow, config); else if (config->GetGravityForce() == YES) numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceGravity(nDim, nVar_Flow, config); else if (config->GetWind_Gust() == YES) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index fd2395968889..553a7baada64 100755 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -915,7 +915,7 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity gradient is added. ---*/ - if(turbulent && false) { + if(turbulent && false) {//TK:: fix that /*--- Compute the scalar factor ---*/ scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); From 02fa28e2d19e8fb5fa1ca18a7c04f7aef4e53603 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 9 Aug 2019 14:19:42 +0200 Subject: [PATCH 027/326] Some variable changes. Added pipe slice Testcase for streamwise periodicity. --- SU2_CFD/include/numerics_structure.hpp | 13 +++++++++--- SU2_CFD/src/numerics_direct_mean_inc.cpp | 21 +++++++------------ SU2_CFD/src/solver_direct_mean_inc.cpp | 9 ++++++++ SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- .../half_cylinder_2D/half_cylinder_2D.cfg | 8 +++++++ TestCases/parallel_regression.py | 11 ++++++++++ 6 files changed, 46 insertions(+), 18 deletions(-) mode change 100644 => 100755 SU2_CFD/include/numerics_structure.hpp diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp old mode 100644 new mode 100755 index 1d41cd81cc60..2c6871c9509f --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5245,22 +5245,29 @@ class CSourceIncBodyForce : public CNumerics { /*! * \class CSourceIncStreamwise_Periodic - * \brief Class for the source term integration of a body force in the incompressible solver. Used for periodic BC. + * \brief Class for the source term integration of a streamwise periodic body force in the incompressible solver. * \ingroup SourceDiscr * \author T. Kattmann * \version 6.1.0 "Falcon" */ class CSourceIncStreamwise_Periodic : public CNumerics { +private: + bool implicit, /*!< \brief Implicit calculation. */ turbulent, /*!< \brief Turbulence model used. */ energy; /*!< \brief Energy equation on. */ - su2double *Streamwise_Coord_Vector; /*!< \brief Translation vector between periodic surfaces. */ + vector Streamwise_Coord_Vector; /*!< \brief Translation vector between streamwise periodic surfaces. */ su2double norm2_translation, /*!< \brief Square of distance between the 2 periodic surfaces. */ integrated_heatflow, /*!< \brief Total heat added intto the domain via heatflux marker. */ massflow, /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ - delta_p; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + delta_p, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + dot_product, /*!< \brief Container for various dot-products. */ + scalar_factor; /*!< brief Holds scalar factors to simplify final equations. */ + + unsigned short iDim, /*!< brief Counts over Dimensions. */ + iVar, jVar; /*!< brief Count over Variables. */ public: diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 553a7baada64..dfeb56476d38 100755 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -856,28 +856,21 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); energy = config->GetEnergy_Equation(); - Streamwise_Coord_Vector = new su2double[nDim]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + Streamwise_Coord_Vector.resize(nDim); + for (iDim = 0; iDim < nDim; iDim++) Streamwise_Coord_Vector[iDim] = config->GetPeriodicTranslation(0)[iDim]; /*--- Compute square of the distance between the 2 periodic surfaces ---*/ norm2_translation = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (iDim = 0; iDim < nDim; iDim++) norm2_translation += pow(Streamwise_Coord_Vector[iDim],2); } -CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { - - if (Streamwise_Coord_Vector != NULL) delete [] Streamwise_Coord_Vector; - -} +CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { } void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { - unsigned short iDim, iVar, jVar; - su2double dot_product, scalar_factor; - delta_p = config->GetStreamwise_Periodic_PressureDrop(); massflow = config->GetStreamwise_Periodic_MassFlow(); integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); @@ -925,14 +918,14 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 for (iDim = 0; iDim < nDim; iDim++) dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity val_residual[nDim+1] -= Volume * scalar_factor * dot_product; - } // turbulent + }//if turbulent /*--- Jacobian contribution of energy equation periodic source term ---*/ if (implicit) { for (iDim = 0; iDim < nDim; iDim++) Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * scalar_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why - } - } // Energy + }//if implicit + }//if energy } diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 24efa4475c8a..9cb9d1073ac2 100755 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2090,6 +2090,15 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->SetVolume(geometry->node[iPoint]->GetVolume()); + /*--- If viscous, we need gradients for extra terms. ---*/ + + if (viscous) { //TK:: copied from below + + /*--- Gradient of the primitive variables ---*/ + + numerics->SetPrimVarGradient(node[iPoint]->GetGradient_Primitive(), NULL); + + } /*--- Compute the body force source residual ---*/ numerics->ComputeResidual(Residual, config); diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index a35d961da9d7..29e9113e87f5 100755 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -280,7 +280,7 @@ CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val Primitive = new su2double [nPrimVar]; for (iVar = 0; iVar < nPrimVar; iVar++) Primitive[iVar] = 0.0; - /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu), //TK:: for periodic turb EddyMu + /*--- Incompressible flow, gradients primitive variables nDim+4+2, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu), //TK:: for periodic turb EddyMu We need P, and rho for running the adjoint problem ---*/ Gradient_Primitive = new su2double* [nPrimVarGrad]; diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 60d6ee03869f..777405baac88 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -183,6 +183,14 @@ JST_SENSOR_COEFF= ( 0.5, 0.04 ) % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT + % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Convergence criteria (CAUCHY, RESIDUAL) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 8bfb0734315c..2e901054ff9e 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -360,6 +360,17 @@ def main(): streamwise_periodic_cylinder.tol = 0.00001 test_list.append(streamwise_periodic_cylinder) + # 3D laminar channnel with 1 cell in flow direction, streamwise periodic + streamwise_periodic_PipeSlice = TestCase('streamwise_periodic_PipeSlice') + streamwise_periodic_PipeSlice.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipe_slice_3D" + streamwise_periodic_PipeSlice.cfg_file = "pipe3Dslice.cfg" + streamwise_periodic_PipeSlice.test_iter = 10 + streamwise_periodic_PipeSlice.test_vals = [-10.352122, -10.185236, 0.000000, 0.000007] #last 4 lines + streamwise_periodic_PipeSlice.su2_exec = "parallel_computation.py -f" + streamwise_periodic_PipeSlice.timeout = 1600 + streamwise_periodic_PipeSlice.tol = 0.00001 + test_list.append(streamwise_periodic_PipeSlice) + # Laminar heated cylinder with polynomial fluid model inc_poly_cylinder = TestCase('inc_poly_cylinder') inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" From b68e119b1c079163793aea4408bfd472752bdfe0 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 13 Aug 2019 08:25:00 +0200 Subject: [PATCH 028/326] Moved some vars to std::vector and used inner_product for some computations. --- Common/include/config_structure.hpp | 16 +-- Common/include/config_structure.inl | 6 +- Common/src/config_structure.cpp | 8 +- Common/src/geometry_structure.cpp | 15 +-- SU2_CFD/src/numerics_direct_mean_inc.cpp | 26 ++-- SU2_CFD/src/solver_direct_mean_fem.cpp | 2 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 156 ++++++++++++----------- 7 files changed, 112 insertions(+), 117 deletions(-) mode change 100644 => 100755 Common/src/config_structure.cpp mode change 100644 => 100755 SU2_CFD/src/solver_direct_mean_fem.cpp diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 5cc30fdee4c8..0a6d9443f578 100755 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1034,11 +1034,11 @@ class CConfig { su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ - su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ - su2double Streamwise_Periodic_TargetMassFlow; /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ - su2double Streamwise_Periodic_MassFlow; /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ - su2double Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - su2double *Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ @@ -3013,7 +3013,7 @@ class CConfig { unsigned short GetnMarker_Periodic(void); /*! - * \brief Get the total number of heat flux markers. (per partition or globally) + * \brief Get the total (local) number of heat flux markers. * \return Total number of heat flux markers. */ unsigned short GetnMarker_HeatFlux(void); @@ -6016,13 +6016,13 @@ class CConfig { * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - su2double* GetStreamwise_Periodic_RefNode(void); + vector GetStreamwise_Periodic_RefNode(void); /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - void SetStreamwise_Periodic_RefNode(su2double* RefNode, unsigned short nDim); + void SetStreamwise_Periodic_RefNode(vector RefNode); /*! * \brief Get the massflow of the streamwise periodic donor/outlet boundary. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index af5ba958dc5f..6f1d217ec8b3 100755 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1636,11 +1636,9 @@ inline void CConfig::SetStreamwise_Periodic_PressureDrop(su2double delta_p) { St inline su2double CConfig::GetStreamwise_Periodic_TargetMassFlow(void) { return Streamwise_Periodic_TargetMassFlow; } -inline su2double* CConfig::GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } +inline vector CConfig::GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } -inline void CConfig::SetStreamwise_Periodic_RefNode(su2double* RefNode, unsigned short nDim) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) Streamwise_Periodic_RefNode[iDim] = RefNode[iDim]; -} +inline void CConfig::SetStreamwise_Periodic_RefNode(vector RefNode) { Streamwise_Periodic_RefNode = RefNode; } inline void CConfig::SetStreamwise_Periodic_MassFlow(su2double val_massflow) { Streamwise_Periodic_MassFlow = val_massflow; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp old mode 100644 new mode 100755 index 035e1a23d04e..8be457dde4e6 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -596,8 +596,6 @@ void CConfig::SetPointersNull(void) { Weight_ObjFunc = NULL; - Streamwise_Periodic_RefNode = NULL; - /*--- Moving mesh pointers ---*/ nKind_SurfaceMovement = 0; @@ -826,7 +824,7 @@ void CConfig::SetConfig_Options() { addBoolOption("WEAKLY_COUPLED_HEAT_EQUATION", Weakly_Coupled_Heat, NO); /*\brief AXISYMMETRIC \n DESCRIPTION: Axisymmetric simulation \n DEFAULT: false \ingroup Config */ - addBoolOption("AXISYMMETRIC", Axisymmetric, false); + addBoolOption("AXISYMMETRIC", Axisymmetric, false); /* DESCRIPTION: Add the gravity force */ addBoolOption("GRAVITY_FORCE", GravityForce, false); /* DESCRIPTION: Apply a body force as a source term (NO, YES) */ @@ -4294,7 +4292,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Energy_Equation && nMarker_Isothermal != 0) SU2_MPI::Error("No isothermal marker allowed with streamwise periodicity, only heatflux..", CURRENT_FUNCTION); /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ - Streamwise_Periodic_RefNode = new su2double[val_nDim]; + Streamwise_Periodic_RefNode.resize(val_nDim); } /*--- Handle default options for topology optimization ---*/ @@ -7221,8 +7219,6 @@ CConfig::~CConfig(void) { if (Periodic_Rotation != NULL) delete[] Periodic_Rotation; if (Periodic_Translate != NULL) delete[] Periodic_Translate; - if (Streamwise_Periodic_RefNode != NULL) delete[] Streamwise_Periodic_RefNode; - if (MG_CorrecSmooth != NULL) delete[] MG_CorrecSmooth; if (PlaneTag != NULL) delete[] PlaneTag; if (CFL != NULL) delete[] CFL; diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index 6c35caec6075..d39a9055ba13 100755 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -14590,11 +14590,8 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, unsigned long iPoint; su2double norm, min_norm = 0.0; - su2double *Buffer_Send_RefNode = new su2double[nDim]; - su2double *Buffer_Recv_RefNode = new su2double[size*nDim]; - - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = 1e300; + vector Buffer_Send_RefNode(nDim, 1e300), + Buffer_Recv_RefNode(size*nDim); /*-------------------------------------------------------------------------------------------*/ /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ @@ -14633,7 +14630,8 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, } // marker loop /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ - SU2_MPI::Allgather(Buffer_Send_RefNode, nDim, MPI_DOUBLE, Buffer_Recv_RefNode, nDim, MPI_DOUBLE, MPI_COMM_WORLD); + SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, + Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ @@ -14660,7 +14658,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, } /*--- Store the final reference node. ---*/ - config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode, nDim); + config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode); /*--- Print the reference node. ---*/ if (rank == MASTER_NODE) { @@ -14670,9 +14668,6 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, cout << " ]" << endl; } - /*--- Free allocated memory. ---*/ - delete [] Buffer_Send_RefNode; - delete [] Buffer_Recv_RefNode; } } diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index dfeb56476d38..45d4b3f50603 100755 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -860,11 +860,11 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ for (iDim = 0; iDim < nDim; iDim++) Streamwise_Coord_Vector[iDim] = config->GetPeriodicTranslation(0)[iDim]; - /*--- Compute square of the distance between the 2 periodic surfaces ---*/ - norm2_translation = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(Streamwise_Coord_Vector[iDim],2); - + /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: + dot_prod(t*t) = (|t|_2)^2 ---*/ + norm2_translation = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), + Streamwise_Coord_Vector.begin(), 0.0); + } CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { } @@ -899,24 +899,22 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); - /*--- Compute scalar-product v*t ---*/ - dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - dot_product += V_i[iDim+1] * Streamwise_Coord_Vector[iDim]; - } + /*--- Compute scalar-product dot_prod(v*t) ---*/ + dot_product = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), + V_i+1, 0.0 ); + val_residual[nDim+1] = Volume * scalar_factor * dot_product; /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity gradient is added. ---*/ - if(turbulent && false) {//TK:: fix that + if(turbulent) { /*--- Compute the scalar factor ---*/ scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ - dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity + dot_product = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), + PrimVar_Grad_i[nDim+5], 0.0); // gradient of eddy viscosity val_residual[nDim+1] -= Volume * scalar_factor * dot_product; }//if turbulent diff --git a/SU2_CFD/src/solver_direct_mean_fem.cpp b/SU2_CFD/src/solver_direct_mean_fem.cpp old mode 100644 new mode 100755 index fd6c22f63dd9..0a1b82629504 --- a/SU2_CFD/src/solver_direct_mean_fem.cpp +++ b/SU2_CFD/src/solver_direct_mean_fem.cpp @@ -14862,7 +14862,7 @@ void CFEM_DG_NSSolver::BC_Sym_Plane(CConfig *config, GradCartNormMomL[0] = ULGradCart[1][0]*normals[0] + ULGradCart[2][0]*normals[1]; GradCartNormMomL[1] = ULGradCart[1][1]*normals[0] + ULGradCart[2][1]*normals[1]; - const su2double GradNormNormMomL = ULGradNorm[1]*normals[0] + ULGradNorm[2]*normals[1]; // why not GradCartNormMomL here instead of ULGradNorm...same but makes more sense + const su2double GradNormNormMomL = ULGradNorm[1]*normals[0] + ULGradNorm[2]*normals[1]; /* Abbreviate twice the normal vector. */ const su2double tnx = 2.0*normals[0], tny = 2.0*normals[1]; diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 9cb9d1073ac2..abf28e0ffd68 100755 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2020,13 +2020,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont unsigned short iVar; unsigned long iPoint; - bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool rotating_frame = config->GetRotating_Frame(); - bool axisymmetric = config->GetAxisymmetric(); - bool body_force = config->GetBody_Force(); + bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + bool rotating_frame = config->GetRotating_Frame(); + bool axisymmetric = config->GetAxisymmetric(); + bool body_force = config->GetBody_Force(); + bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); + bool viscous = config->GetViscous(); bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); - bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); - bool viscous = config->GetViscous(); /*--- Initialize the source residual to zero ---*/ @@ -2036,35 +2036,37 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (streamwise_periodic) { /*--- Loop over all points ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Load the conservative variables ---*/ - - numerics->SetConservative(node[iPoint]->GetSolution(), - node[iPoint]->GetSolution()); - - numerics->SetPrimitive(node[iPoint]->GetPrimitive(), NULL); + numerics->SetConservative(node[iPoint]->GetSolution(), + NULL); + numerics->SetPrimitive(node[iPoint]->GetPrimitive(), + NULL); /*--- Set incompressible density ---*/ - - numerics->SetDensity(node[iPoint]->GetDensity(), + numerics->SetDensity(node[iPoint]->GetDensity(), node[iPoint]->GetDensity()); /*--- Load the volume of the dual mesh cell ---*/ - numerics->SetVolume(geometry->node[iPoint]->GetVolume()); - /*--- Compute the streamwise periodic source residual ---*/ + /*--- If viscous, we need gradients for extra terms. ---*/ + if (viscous) { + + /*--- Gradient of the primitive variables ---*/ + numerics->SetPrimVarGradient(node[iPoint]->GetGradient_Primitive(), + NULL); + + } + /*--- Compute the streamwise periodic source residual ---*/ numerics->ComputeResidual(Residual, Jacobian_i, config); /*--- Add the source residual to the total ---*/ - LinSysRes.AddBlock(iPoint, Residual); /*--- Add the implicit Jacobian contribution ---*/ - if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); } @@ -2090,15 +2092,6 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->SetVolume(geometry->node[iPoint]->GetVolume()); - /*--- If viscous, we need gradients for extra terms. ---*/ - - if (viscous) { //TK:: copied from below - - /*--- Gradient of the primitive variables ---*/ - - numerics->SetPrimVarGradient(node[iPoint]->GetGradient_Primitive(), NULL); - - } /*--- Compute the body force source residual ---*/ numerics->ComputeResidual(Residual, config); @@ -6442,8 +6435,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo su2double Area_Local = 0.0, Area_Global = 0.0, FaceArea, MassFlow_Local = 0.0, MassFlow_Global = 0.0, Average_Density_Local = 0.0, Average_Density_Global = 0.0; - - su2double *AreaNormal = new su2double[nDim]; + + vector AreaNormal(nDim); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -6455,7 +6448,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo if (geometry->node[iPoint]->GetDomain()) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { if (geometry->node[iPoint]->GetCoord(1) != 0.0) @@ -6465,16 +6458,20 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo } else { AxiFactor = 1.0; } - - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); - MassFlow_Local += AreaNormal[iDim] * AxiFactor * node[iPoint]->GetDensity() * node[iPoint]->GetVelocity(iDim); - } - FaceArea = sqrt(FaceArea); + + /*--- m_dot = dot_prod(n*v) * A * rho * Axifactor, with n beeing unit normal. ---*/ + MassFlow_Local = inner_product(AreaNormal.begin(), AreaNormal.end(), + node[iPoint]->GetSolution()+1, MassFlow_Local); + MassFlow_Local *= node[iPoint]->GetDensity() * AxiFactor; + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + FaceArea += sqrt(AxiFactor * inner_product(AreaNormal.begin(), AreaNormal.end(), + AreaNormal.begin(), 0.0) ); Area_Local += FaceArea; + Average_Density_Local += FaceArea * node[iPoint]->GetDensity(); + } // if domain } // loop vertices } // loop periodic boundaries @@ -6498,32 +6495,33 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo /*--- The Pressure drop is iteratively adapted to result in the prescribed Target-Massflow. ---*/ /*------------------------------------------------------------------------------------------------*/ - /*--- Load/define all necessary variables ---*/ - su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); - su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); - su2double damping_factor = config->GetInc_Outlet_Damping(); - su2double Pressure_Drop_new, ddP; - - /*--- Compute update to Delta p based on massflow-difference ---*/ - ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); + /*--- Load/define all necessary variables ---*/ + su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(), + TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()), + damping_factor = config->GetInc_Outlet_Damping(), + Pressure_Drop_new, + ddP; + + /*--- Compute update to Delta p based on massflow-difference ---*/ + ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); + + /*--- Store updated pressure difference ---*/ + Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; + config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); + + /*--- Output the new value of Delta P and ddp ---*/ + if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK:: Move whole computation up in front of output + + cout.precision(5); + cout.setf(ios::fixed, ios::floatfield); - /*--- Store updated pressure difference ---*/ - Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; - config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); + cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; + cout << "New Delta P: " << Pressure_Drop_new * config->GetPressure_Ref() << endl; - /*--- Output the new value of Delta P and ddp ---*/ - if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK Move whole computation up in front of output + cout.unsetf(ios_base::floatfield); - cout.precision(5); - cout.setf(ios::fixed, ios::floatfield); - - cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; - cout << "New Delta P: " << Pressure_Drop_new * config->GetPressure_Ref() << endl; - - cout.unsetf(ios_base::floatfield); - - } // output - } // if massflow + } // output + } // if massflow if (config->GetEnergy_Equation()) { /*---------------------------------------------------------------------------------------------*/ @@ -6532,7 +6530,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo /*--- Here the Heatflux from all Bounary markers in the config-file is used. ---*/ /*---------------------------------------------------------------------------------------------*/ - su2double HeatFlux, HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; + su2double HeatFlux, + HeatFlow_Local = 0.0, + HeatFlow_Global = 0.0; string Marker_StringTag; /*--- Loop over all Marker ---*/ @@ -6549,7 +6549,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo if (geometry->node[iPoint]->GetDomain()) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal); + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { if (geometry->node[iPoint]->GetCoord(1) != 0.0) @@ -6585,8 +6585,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo if (rank == MASTER_NODE) { cout << "HeatFlow_Global: " << HeatFlow_Global * config->GetHeat_Flux_Ref() << endl; } } // if energy - /*--- Free allocated memory. ---*/ - delete [] AreaNormal; if (rank == MASTER_NODE) { cout << "------------------------------- New Routine End --------------------------" << endl; } } @@ -8611,6 +8609,19 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool grid_movement = config->GetGrid_Movement(); bool energy = config->GetEnergy_Equation(); + bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + + su2double Cp, + thermal_conductivity, + dot_product, + norm2_translation = 0.0, + scalar_factor, + massflow = config->GetStreamwise_Periodic_MassFlow(), + integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + + for (iDim = 0; iDim < nDim; iDim++) { + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + } /*--- Identify the boundary by string name ---*/ @@ -8648,7 +8659,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai /*--- Initialize the convective & viscous residuals to zero ---*/ for (iVar = 0; iVar < nVar; iVar++) { - Res_Conv[iVar] = 0.0; // TK Not used after that in this function ?? + Res_Conv[iVar] = 0.0; Res_Visc[iVar] = 0.0; if (implicit) { for (jVar = 0; jVar < nVar; jVar++) @@ -8685,25 +8696,22 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai /*--- With streamwise periodic BC and heatflux walls an additional term is introduced in the boundary formulation ---*/ - if (config->GetKind_Streamwise_Periodic()) { + if (streamwise_periodic) { - su2double Cp = node[iPoint]->GetSpecificHeatCp(); - su2double thermal_conductivity = node[iPoint]->GetThermalConductivity(); - su2double norm2_translation = 0.0, dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - } + Cp = node[iPoint]->GetSpecificHeatCp(); + thermal_conductivity = node[iPoint]->GetThermalConductivity(); /*--- Scalar part of the contribution ---*/ - su2double scalar_factor = config->GetStreamwise_Periodic_IntegratedHeatFlow()*thermal_conductivity / (config->GetStreamwise_Periodic_MassFlow() * Cp * norm2_translation); + su2double scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); /*--- Scalar product ---*/ + dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } Res_Visc[nDim+1] -= scalar_factor*dot_product; - } + }//if streamwise_periodic /*--- Viscous contribution to the residual at the wall ---*/ From a63436efb7d115660bac244727fa79db00d7bf85 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 21 Aug 2019 18:51:55 +0200 Subject: [PATCH 029/326] STL inner_product vs AD-builds fix. Failing Inc Reg due to BC_Heatfluxwall fixed. --- SU2_CFD/src/numerics_direct_mean_inc.cpp | 16 ++++++---- SU2_CFD/src/solver_direct_mean_inc.cpp | 40 ++++++++++++++++-------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 45d4b3f50603..6ecc25268d4e 100755 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -862,8 +862,9 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: dot_prod(t*t) = (|t|_2)^2 ---*/ - norm2_translation = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), - Streamwise_Coord_Vector.begin(), 0.0); + norm2_translation = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + norm2_translation += Streamwise_Coord_Vector[iDim] * Streamwise_Coord_Vector[iDim]; } @@ -900,8 +901,9 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); /*--- Compute scalar-product dot_prod(v*t) ---*/ - dot_product = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), - V_i+1, 0.0 ); + dot_product = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + dot_product += Streamwise_Coord_Vector[iDim] * V_i[iDim+1]; val_residual[nDim+1] = Volume * scalar_factor * dot_product; @@ -913,8 +915,10 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2 scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ - dot_product = inner_product(Streamwise_Coord_Vector.begin(), Streamwise_Coord_Vector.end(), - PrimVar_Grad_i[nDim+5], 0.0); // gradient of eddy viscosity + dot_product = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity + val_residual[nDim+1] -= Volume * scalar_factor * dot_product; }//if turbulent diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index abf28e0ffd68..4af3a944d66f 100755 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -6460,13 +6460,17 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo } /*--- m_dot = dot_prod(n*v) * A * rho * Axifactor, with n beeing unit normal. ---*/ - MassFlow_Local = inner_product(AreaNormal.begin(), AreaNormal.end(), - node[iPoint]->GetSolution()+1, MassFlow_Local); + MassFlow_Local = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + MassFlow_Local += AreaNormal[iDim] * node[iPoint]->GetSolution()[iDim+1]; + MassFlow_Local *= node[iPoint]->GetDensity() * AxiFactor; /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea += sqrt(AxiFactor * inner_product(AreaNormal.begin(), AreaNormal.end(), - AreaNormal.begin(), 0.0) ); + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); + FaceArea = sqrt(FaceArea); Area_Local += FaceArea; Average_Density_Local += FaceArea * node[iPoint]->GetDensity(); @@ -8606,22 +8610,32 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai su2double *GridVel, *Normal, Area, Wall_HeatFlux; - bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool grid_movement = config->GetGrid_Movement(); - bool energy = config->GetEnergy_Equation(); + bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + bool grid_movement = config->GetGrid_Movement(); + bool energy = config->GetEnergy_Equation(); bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + /*--- Variable allocation for streamwise periodicity ---*/ su2double Cp, thermal_conductivity, dot_product, - norm2_translation = 0.0, + norm2_translation, scalar_factor, - massflow = config->GetStreamwise_Periodic_MassFlow(), - integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); - - for (iDim = 0; iDim < nDim; iDim++) { - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + massflow, + integratedHeatFlow; + + /*--- Variable initialization for streamwise periodicity ---*/ + if(energy && streamwise_periodic) { + massflow = config->GetStreamwise_Periodic_MassFlow(); + integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + + norm2_translation = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + } } + + /*--- Identify the boundary by string name ---*/ From 4d709a125ec4213772553c7518e52a12ac270f46 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 26 Aug 2019 11:47:10 +0200 Subject: [PATCH 030/326] Split overlong lines. Revert exec bits. Only cosmetic stuff. --- Common/include/config_structure.hpp | 10 +++--- Common/include/config_structure.inl | 33 ++++++++++++------- Common/src/config_structure.cpp | 14 +++++--- Common/src/geometry_structure.cpp | 2 +- SU2_CFD/include/numerics_structure.hpp | 12 +++++-- SU2_CFD/include/solver_structure.hpp | 14 +++++--- SU2_CFD/include/solver_structure.inl | 5 ++- SU2_CFD/include/variables/CEulerVariable.hpp | 0 .../include/variables/CIncEulerVariable.hpp | 17 ++++++---- SU2_CFD/include/variables/CVariable.hpp | 0 SU2_CFD/src/drivers/CDriver.cpp | 0 SU2_CFD/src/numerics_direct_mean_inc.cpp | 10 ++++-- SU2_CFD/src/output_structure.cpp | 0 SU2_CFD/src/solver_direct_mean_fem.cpp | 0 SU2_CFD/src/solver_direct_mean_inc.cpp | 15 ++++++--- SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- .../streamwise_periodic/README.md | 0 .../half_cylinder_2D/half_cylinder_2D.cfg | 5 +-- .../pipe_slice_3D/pipe3Dslice.cfg | 5 +-- .../pipe_slice_3D/pipeslice.geo | 0 .../poiseuille/lam_poiseuille.cfg | 2 +- TestCases/parallel_regression.py | 0 config_template.cfg | 4 +-- 23 files changed, 95 insertions(+), 55 deletions(-) mode change 100755 => 100644 Common/include/config_structure.hpp mode change 100755 => 100644 Common/include/config_structure.inl mode change 100755 => 100644 Common/src/config_structure.cpp mode change 100755 => 100644 Common/src/geometry_structure.cpp mode change 100755 => 100644 SU2_CFD/include/numerics_structure.hpp mode change 100755 => 100644 SU2_CFD/include/variables/CEulerVariable.hpp mode change 100755 => 100644 SU2_CFD/include/variables/CIncEulerVariable.hpp mode change 100755 => 100644 SU2_CFD/include/variables/CVariable.hpp mode change 100755 => 100644 SU2_CFD/src/drivers/CDriver.cpp mode change 100755 => 100644 SU2_CFD/src/numerics_direct_mean_inc.cpp mode change 100755 => 100644 SU2_CFD/src/output_structure.cpp mode change 100755 => 100644 SU2_CFD/src/solver_direct_mean_fem.cpp mode change 100755 => 100644 SU2_CFD/src/solver_direct_mean_inc.cpp mode change 100755 => 100644 SU2_CFD/src/variables/CIncEulerVariable.cpp mode change 100755 => 100644 TestCases/incomp_navierstokes/streamwise_periodic/README.md mode change 100755 => 100644 TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo mode change 100755 => 100644 TestCases/parallel_regression.py mode change 100755 => 100644 config_template.cfg diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp old mode 100755 new mode 100644 index bcc8a5fbceb4..7a04bc4cc320 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1033,12 +1033,12 @@ class CConfig { bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ - unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ - su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ - Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ + unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ + su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl old mode 100755 new mode 100644 index 6f1d217ec8b3..c88e32754211 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1626,27 +1626,38 @@ inline bool CConfig::GetBody_Force(void) { return Body_Force; } inline su2double* CConfig::GetBody_Force_Vector(void) { return Body_Force_Vector; } -inline su2double* CConfig::GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } +inline su2double* CConfig::GetPeriodicTranslation(unsigned short val_index) { + return Periodic_Translation[val_index]; } -inline unsigned short CConfig::GetKind_Streamwise_Periodic(void) { return Kind_Streamwise_Periodic; } +inline unsigned short CConfig::GetKind_Streamwise_Periodic(void) { + return Kind_Streamwise_Periodic; } -inline su2double CConfig::GetStreamwise_Periodic_PressureDrop(void) { return Streamwise_Periodic_PressureDrop; } +inline su2double CConfig::GetStreamwise_Periodic_PressureDrop(void) { + return Streamwise_Periodic_PressureDrop; } -inline void CConfig::SetStreamwise_Periodic_PressureDrop(su2double delta_p) { Streamwise_Periodic_PressureDrop = delta_p; } +inline void CConfig::SetStreamwise_Periodic_PressureDrop(su2double delta_p) { + Streamwise_Periodic_PressureDrop = delta_p; } -inline su2double CConfig::GetStreamwise_Periodic_TargetMassFlow(void) { return Streamwise_Periodic_TargetMassFlow; } +inline vector CConfig::GetStreamwise_Periodic_RefNode(void) { + return Streamwise_Periodic_RefNode; } -inline vector CConfig::GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } +inline void CConfig::SetStreamwise_Periodic_RefNode(vector RefNode) { + Streamwise_Periodic_RefNode = RefNode; } -inline void CConfig::SetStreamwise_Periodic_RefNode(vector RefNode) { Streamwise_Periodic_RefNode = RefNode; } +inline su2double CConfig::GetStreamwise_Periodic_TargetMassFlow(void) { + return Streamwise_Periodic_TargetMassFlow; } -inline void CConfig::SetStreamwise_Periodic_MassFlow(su2double val_massflow) { Streamwise_Periodic_MassFlow = val_massflow; } +inline void CConfig::SetStreamwise_Periodic_MassFlow(su2double val_massflow) { + Streamwise_Periodic_MassFlow = val_massflow; } -inline su2double CConfig::GetStreamwise_Periodic_MassFlow() { return Streamwise_Periodic_MassFlow; } +inline su2double CConfig::GetStreamwise_Periodic_MassFlow() { + return Streamwise_Periodic_MassFlow; } -inline void CConfig::SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow) { Streamwise_Periodic_IntegratedHeatFlow = val_heatflow; } +inline void CConfig::SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow) { + Streamwise_Periodic_IntegratedHeatFlow = val_heatflow; } -inline su2double CConfig::GetStreamwise_Periodic_IntegratedHeatFlow() { return Streamwise_Periodic_IntegratedHeatFlow; } +inline su2double CConfig::GetStreamwise_Periodic_IntegratedHeatFlow() { + return Streamwise_Periodic_IntegratedHeatFlow; } inline bool CConfig::GetSmoothNumGrid(void) { return SmoothNumGrid; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp old mode 100755 new mode 100644 index 23c9c10c7aa3..5917747f665b --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -835,7 +835,7 @@ void CConfig::SetConfig_Options() { addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); /* DESCRIPTION: Delta pressure on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); - /* DESCRIPTION: Massflow basis body (via Delta P) force will be computed */ + /* DESCRIPTION: Target Massflow, Delta P will be adapted until m_dot is met. */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ @@ -4247,10 +4247,14 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Check for Streamwise Periodic Boundary conditions ---*/ if (Kind_Streamwise_Periodic != NONE) { - if (Kind_Solver == EULER) SU2_MPI::Error("Didn't test dat shit yet.", CURRENT_FUNCTION); - if (Kind_Regime != INCOMPRESSIBLE) SU2_MPI::Error("Streamwise Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); - if (nMarker_PerBound != 2) SU2_MPI::Error("Streamwise Periodic BC currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible.", CURRENT_FUNCTION); - if (Energy_Equation && nMarker_Isothermal != 0) SU2_MPI::Error("No isothermal marker allowed with streamwise periodicity, only heatflux..", CURRENT_FUNCTION); + if (Kind_Solver == EULER) + SU2_MPI::Error("Streamwise_Periodic+Inc_Euler: Not tested yet.", CURRENT_FUNCTION); + if (Kind_Regime != INCOMPRESSIBLE) + SU2_MPI::Error("Streamwise Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); + if (nMarker_PerBound != 2) + SU2_MPI::Error("Streamwise Periodic BC currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible yet.", CURRENT_FUNCTION); + if (Energy_Equation && nMarker_Isothermal != 0) + SU2_MPI::Error("No isothermal marker allowed with streamwise periodicity, only heatflux.", CURRENT_FUNCTION); /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ Streamwise_Periodic_RefNode.resize(val_nDim); diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp old mode 100755 new mode 100644 index 136c62776c1d..2ff63fce0187 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -14550,7 +14550,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, cout << "Bad matches found. Computation will continue, but be cautious.\n"; } } - + /*--- Free local memory for communications. ---*/ delete[] Buffer_Send_Coord; diff --git a/SU2_CFD/include/numerics_structure.hpp b/SU2_CFD/include/numerics_structure.hpp old mode 100755 new mode 100644 index eb3851b9546f..870280912efe --- a/SU2_CFD/include/numerics_structure.hpp +++ b/SU2_CFD/include/numerics_structure.hpp @@ -5247,6 +5247,7 @@ class CSourceIncBodyForce : public CNumerics { }; + /*! * \class CSourceIncStreamwise_Periodic * \brief Class for the source term integration of a streamwise periodic body force in the incompressible solver. @@ -5280,7 +5281,9 @@ class CSourceIncStreamwise_Periodic : public CNumerics { * \param[in] val_nVar - Number of variables of the problem. * \param[in] config - Definition of the particular problem. */ - CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config); + CSourceIncStreamwise_Periodic(unsigned short val_nDim, + unsigned short val_nVar, + CConfig *config); /*! * \brief Destructor of the class. @@ -5293,10 +5296,13 @@ class CSourceIncStreamwise_Periodic : public CNumerics { * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). * \param[in] config - Definition of the particular problem. */ - void ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config); - + void ComputeResidual(su2double *val_residual, + su2double **Jacobian_i, + CConfig *config); + }; + /*! * \class CSourceBoussinesq * \brief Class for the source term integration of the Boussinesq approximation for incompressible flow. diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp index b595421fe8b5..e1e27ada36b7 100644 --- a/SU2_CFD/include/solver_structure.hpp +++ b/SU2_CFD/include/solver_structure.hpp @@ -2000,7 +2000,10 @@ class CSolver { /*! * \brief A virtual member. */ - virtual void GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + virtual void GetStreamwise_Periodic_Properties(CGeometry *geometry, + CConfig *config, + unsigned short iMesh, + bool Output); /*! * \brief A virtual member. @@ -8206,11 +8209,14 @@ class CIncEulerSolver : public CSolver { */ void ComputeVerificationError(CGeometry *geometry, CConfig *config); - /*! - * \brief Compute necessary quantities (massflow, integrated heatflux, ...) for streamwise periodic cases. + * \brief Compute necessary quantities (massflow, integrated heatflux, avg density) + * for streamwise periodic cases. Also sets new delta P for prescribed massflow. */ - void GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + void GetStreamwise_Periodic_Properties(CGeometry *geometry, + CConfig *config, + unsigned short iMesh, + bool Output); }; diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl index 0d1b02d4e7eb..1e66dd271208 100644 --- a/SU2_CFD/include/solver_structure.inl +++ b/SU2_CFD/include/solver_structure.inl @@ -772,7 +772,10 @@ inline void CSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, u inline void CSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } -inline void CSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } +inline void CSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, + CConfig *config, + unsigned short iMesh, + bool Output) { } inline void CSolver::GetEllipticSpanLoad_Diff(CGeometry *geometry, CConfig *config) { } diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp old mode 100755 new mode 100644 diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp old mode 100755 new mode 100644 index 610f9af5a5aa..3bdf0e826416 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -330,31 +330,36 @@ class CIncEulerVariable : public CVariable { * \brief Get the value of the solution in the previous BGS subiteration. * \param[out] val_solution - solution in the previous BGS subiteration. */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} + inline su2double Get_BGSSolution_k(unsigned short iDim) { + return Solution_BGS_k[iDim]; } - /*! + /*! * \brief Set the recovered pressure for streamwise periodic flow. * \param[in] val_pressure - pressure value. */ - inline void SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure) {Streamwise_Periodic_RecoveredPressure = val_pressure;} + inline void SetStreamwise_Periodic_RecoveredPressure(su2double val_pressure) { + Streamwise_Periodic_RecoveredPressure = val_pressure; } /*! * \brief Get the recovered pressure for streamwise periodic flow. * \return Recovered/Physical pressure for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredPressure(void) {return Streamwise_Periodic_RecoveredPressure;} + inline su2double GetStreamwise_Periodic_RecoveredPressure(void) { + return Streamwise_Periodic_RecoveredPressure; } /*! * \brief Set the recovered pressure for streamwise periodic flow. * \param[in] val_temperature - temperature value. */ - inline void SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature) {Streamwise_Periodic_RecoveredTemperature = val_temperature;} + inline void SetStreamwise_Periodic_RecoveredTemperature(su2double val_temperature) { + Streamwise_Periodic_RecoveredTemperature = val_temperature; } /*! * \brief Get the recovered temperature for streamwise periodic flow. * \return Recovered/Physical temperature for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredTemperature(void) {return Streamwise_Periodic_RecoveredTemperature;} + inline su2double GetStreamwise_Periodic_RecoveredTemperature(void) { + return Streamwise_Periodic_RecoveredTemperature; } inline void SetVelocity(su2double *val_velocity) { for (unsigned short iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp old mode 100755 new mode 100644 diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp old mode 100755 new mode 100644 diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp old mode 100755 new mode 100644 index 6ecc25268d4e..3ed8324cf206 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -850,7 +850,11 @@ void CSourceIncBodyForce::ComputeResidual(su2double *val_residual, CConfig *conf } -CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { +CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, + unsigned short val_nVar, + CConfig *config) : CNumerics(val_nDim, + val_nVar, + config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); @@ -870,7 +874,9 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { } -void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, su2double **Jacobian_i, CConfig *config) { +void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, + su2double **Jacobian_i, + CConfig *config) { delta_p = config->GetStreamwise_Periodic_PressureDrop(); massflow = config->GetStreamwise_Periodic_MassFlow(); diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output_structure.cpp old mode 100755 new mode 100644 diff --git a/SU2_CFD/src/solver_direct_mean_fem.cpp b/SU2_CFD/src/solver_direct_mean_fem.cpp old mode 100755 new mode 100644 diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp old mode 100755 new mode 100644 index 6d7da456df52..9cbdbde76fd9 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2045,7 +2045,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Set incompressible density ---*/ numerics->SetDensity(node[iPoint]->GetDensity(), - node[iPoint]->GetDensity()); + 0.0); /*--- Load the volume of the dual mesh cell ---*/ numerics->SetVolume(geometry->node[iPoint]->GetVolume()); @@ -6403,7 +6403,11 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { +void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, + CConfig *config, + unsigned short iMesh, + bool Output) { + if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } /*---------------------------------------------------------------------------------------------*/ // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results @@ -6438,7 +6442,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CCo for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 2) { // outlet/donor periodic marker + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 2) { // outlet/donor periodic marker for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -7734,7 +7739,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Compute recovered pressure and temperature for streamwise periodic BC Second conditional is there to avoid a zero (massflow) in the denominator for recovered temperature. ---*/ - if (config->GetKind_Streamwise_Periodic()) { + if (config->GetKind_Streamwise_Periodic() != NONE) { /*--- Define and initialize helping variables ---*/ su2double norm2_translation = 0.0, @@ -7767,7 +7772,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container Pressure_Recovered = node[iPoint]->GetSolution(0) - delta_p / norm2_translation * dot_product; node[iPoint]->SetStreamwise_Periodic_RecoveredPressure(Pressure_Recovered); - if (energy && ExtIter > 0) { + if (energy && ExtIter > 0) { //ExtIter > 0, hen egg problem Temperature_Recovered = node[iPoint]->GetSolution(nDim+1); Temperature_Recovered += HeatFlow / (MassFlow * node[iPoint]->GetSpecificHeatCp() * norm2_translation) * dot_product; node[iPoint]->SetStreamwise_Periodic_RecoveredTemperature(Temperature_Recovered); diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp old mode 100755 new mode 100644 index 29e9113e87f5..06bdc32d295e --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -85,7 +85,7 @@ CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velo nSecondaryVarGrad = 0; /*--- Allocate and initialize the primitive variables and gradients ---*/ - + nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu /*--- Allocate residual structures ---*/ diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md old mode 100755 new mode 100644 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 777405baac88..8cf24056e025 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -14,10 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -PHYSICAL_PROBLEM= NAVIER_STOKES -% -% Regime type (COMPRESSIBLE, INCOMPRESSIBLE, FREESURFACE) -REGIME_TYPE= INCOMPRESSIBLE +PHYSICAL_PROBLEM= INC_NAVIER_STOKES % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= NONE diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg index 1a5ef13dc37d..08dd1df89f51 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -14,10 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -PHYSICAL_PROBLEM= NAVIER_STOKES -% -% Regime type (COMPRESSIBLE, INCOMPRESSIBLE, FREESURFACE) -REGIME_TYPE= INCOMPRESSIBLE +PHYSICAL_PROBLEM= INC_NAVIER_STOKES % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= NONE diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo old mode 100755 new mode 100644 diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index b54983a2a437..fd4e26e965e9 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -202,7 +202,7 @@ CONV_CRITERIA= RESIDUAL RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number STARTCONV_ITER= 10 diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py old mode 100755 new mode 100644 diff --git a/config_template.cfg b/config_template.cfg old mode 100755 new mode 100644 index da3d109e1f4f..f636c70cc20b --- a/config_template.cfg +++ b/config_template.cfg @@ -297,10 +297,10 @@ UNST_INT_ITER= 200 % Iteration number to begin unsteady restarts UNST_RESTART_ITER= 0 % -% +% TK:: Add explanation here UNST_ADJOINT_ITER= 0 % -% +% TK:: Add explanation here ITER_AVERAGE_OBJ= 0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% From 67c9b2757ae1a48ce242f205feab04f52b877bc0 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 26 Aug 2019 12:44:33 +0200 Subject: [PATCH 031/326] Small change in .tavis.yml to trigger Draft PR 773 builds. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8245229e8474..c56ae199e134 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ notifications: branches: only: - - feature_periodic_streamwise + - develop virtualenv: system_site_packages: true From e71b86fa9f07f418fdd259023c3d349b191bb52c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Aug 2019 14:06:06 +0200 Subject: [PATCH 032/326] Massflow bugfix in streamwise periodic. Adapted Reg test. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 35 ++++++++---------- .../half_cylinder_2D/half_cylinder_2D.cfg | 36 ++++++++++++------- .../pipe_slice_3D/pipe3Dslice.cfg | 2 +- TestCases/parallel_regression.py | 4 +-- config_template.cfg | 2 +- 5 files changed, 43 insertions(+), 36 deletions(-) diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 9cbdbde76fd9..51a924aed356 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -6403,10 +6403,10 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, - CConfig *config, +void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, + CConfig *config, unsigned short iMesh, - bool Output) { + bool Output) { if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } /*---------------------------------------------------------------------------------------------*/ @@ -6424,8 +6424,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, && (config->GetExtIter()!= 0)) || (config->GetExtIter() == 1)); - su2double AxiFactor; - /*-------------------------------------------------------------------------------------------------*/ /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ /*--- (there can be only one) streamwise periodic outlet/donor marker. Massflow is obviously ---*/ @@ -6434,16 +6432,18 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ /*-------------------------------------------------------------------------------------------------*/ - su2double Area_Local = 0.0, Area_Global = 0.0, FaceArea, - MassFlow_Local = 0.0, MassFlow_Global = 0.0, - Average_Density_Local = 0.0, Average_Density_Global = 0.0; + su2double Area_Local = 0.0, Area_Global = 0.0, + MassFlow_Local = 0.0, MassFlow_Global = 0.0, + Average_Density_Local = 0.0, Average_Density_Global = 0.0, + FaceArea, AxiFactor; vector AreaNormal(nDim); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + /*--- Only "outlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 2) { // outlet/donor periodic marker + config->GetMarker_All_PerBound(iMarker) == 2) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -6462,22 +6462,17 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, AxiFactor = 1.0; } - /*--- m_dot = dot_prod(n*v) * A * rho * Axifactor, with n beeing unit normal. ---*/ - MassFlow_Local = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - MassFlow_Local += AreaNormal[iDim] * node[iPoint]->GetSolution()[iDim+1]; - - MassFlow_Local *= node[iPoint]->GetDensity() * AxiFactor; - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + /*--- m_dot = dot_prod(n*v) * A * rho * Axifactor, with n beeing unit normal. ---*/ FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); + for (iDim = 0; iDim < nDim; iDim++) { + FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); + MassFlow_Local += AreaNormal[iDim] * node[iPoint]->GetVelocity(iDim) * node[iPoint]->GetDensity() * AxiFactor; + } FaceArea = sqrt(FaceArea); Area_Local += FaceArea; - - Average_Density_Local += FaceArea * node[iPoint]->GetDensity(); + Average_Density_Local += FaceArea * node[iPoint]->GetDensity(); } // if domain } // loop vertices diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 8cf24056e025..1902c909ee11 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -PHYSICAL_PROBLEM= INC_NAVIER_STOKES +SOLVER= INC_NAVIER_STOKES % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= NONE @@ -31,6 +31,20 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% ---------------------------- ENERGY EQUATION -------------------------------% +% +INC_ENERGY_EQUATION= YES +% +SPECIFIC_HEAT_CP= 3540.0 +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +PRANDTL_LAM= 1.17 +% +%TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +% +%PRANDTL_TURB= 0.90 +% % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -53,9 +67,6 @@ REF_AREA= 1.0 % an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT % -% Solve the energy equation in the incompressible flow solver -INC_ENERGY_EQUATION = NO -% % Initial density for incompressible flows % (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) INC_DENSITY_INIT= 1.0 @@ -84,7 +95,7 @@ MU_CONSTANT= 1e-4 % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % % Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) -KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +KIND_STREAMWISE_PERIODIC= MASSFLOW % % Delta P value that drives the flow as a source term in the momentum equations. % Defaults to 1.0. @@ -93,13 +104,14 @@ STREAMWISE_PERIODIC_PRESSURE_DROP= 8.0 % Target massflow. Necessary pressure drop is determined iteratively. % Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. % Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.0 - +STREAMWISE_PERIODIC_MASSFLOW= 0.0027 +% +INC_OUTLET_DAMPING= 0.1 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) % Format: ( marker name, constant heat flux (J/m^2), ... ) -MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_pin_interface, 0.0 ) +MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_pin_interface, 5e5 ) % % Symmetry boundary marker(s) (NONE = no marker) MARKER_SYM= ( fluid_sym ) @@ -108,7 +120,7 @@ MARKER_SYM= ( fluid_sym ) % Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, % rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, % rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) -MARKER_PERIODIC= ( inlet, outlet, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.008, 0.0, 0.0 ) +MARKER_PERIODIC= ( inlet, outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.008,0.0,0.0 ) % % Marker(s) of the surface to be plotted or designed MARKER_PLOTTING= ( inlet ) @@ -117,7 +129,7 @@ MARKER_PLOTTING= ( inlet ) MARKER_MONITORING= ( fluid_pin_interface ) % % Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) -%MARKER_ANALYZE = ( inlet ) +MARKER_ANALYZE = ( inlet, outlet ) % % Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). %MARKER_ANALYZE_AVERAGE = AREA @@ -131,7 +143,7 @@ MARKER_MONITORING= ( fluid_pin_interface ) NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES % % Courant-Friedrichs-Lewy condition of the finest grid -CFL_NUMBER= 1e5 +CFL_NUMBER= 1e4 % % Adaptive CFL number (NO, YES) CFL_ADAPT= NO @@ -258,7 +270,7 @@ SURFACE_FLOW_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint % % Writing solution file frequency -WRT_SOL_FREQ= 200 +WRT_SOL_FREQ= 400 % % Writing convergence history frequency WRT_CON_FREQ= 1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg index 08dd1df89f51..be3e7ae9ab05 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -PHYSICAL_PROBLEM= INC_NAVIER_STOKES +SOLVER= INC_NAVIER_STOKES % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= NONE diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index fc8e2a03a8b3..4828bda51a65 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -375,8 +375,8 @@ def main(): streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" - streamwise_periodic_cylinder.test_iter = 10 - streamwise_periodic_cylinder.test_vals = [-6.984615, -6.126544, 0.016574, 0.016927] #last 4 lines + streamwise_periodic_cylinder.test_iter = 30 + streamwise_periodic_cylinder.test_vals = [-7.852372, -0.944669, 0.016752, 0.019021] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 diff --git a/config_template.cfg b/config_template.cfg index f636c70cc20b..ffaeff1defd2 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -569,7 +569,7 @@ KIND_STREAMWISE_PERIODIC= NONE STREAMWISE_PERIODIC_PRESSURE_DROP= 1.0 % % Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. % Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. STREAMWISE_PERIODIC_MASSFLOW= 0.0 From 40066c112b9516275a84c00d8eb3ed3fc47747e7 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Oct 2019 16:54:15 +0200 Subject: [PATCH 033/326] Remove double config_structure function. --- Common/include/config_structure.hpp | 6 ------ Common/include/config_structure.inl | 2 -- 2 files changed, 8 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 11a08e192f0a..26ea4426b063 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -2963,12 +2963,6 @@ class CConfig { * \return Total number of boundary markers. */ unsigned short GetnMarker_Max(void); - - /*! - * \brief Get the total number of boundary markers in the cfg file. - * \return Total number of boundary markers. - */ - unsigned short GetnMarker_CfgFile(void); /*! * \brief Get the total number of boundary markers. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index f8ac0f95a494..6e055308c93c 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1442,8 +1442,6 @@ inline unsigned short CConfig::GetnMarker_SymWall(void) { return nMarker_SymWall inline unsigned short CConfig::GetnMarker_Max(void) { return nMarker_Max; } -inline unsigned short CConfig::GetnMarker_CfgFile(void) { return nMarker_CfgFile; } - inline unsigned short CConfig::GetnMarker_EngineInflow(void) { return nMarker_EngineInflow; } inline unsigned short CConfig::GetnMarker_EngineExhaust(void) { return nMarker_EngineExhaust; } From 3a913c91d5bab82ffb7ddf4d1bae7273f7b80cc6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 13 Oct 2019 22:54:05 +0200 Subject: [PATCH 034/326] Adapting Reg.tests to new cfg names. --- .../half_cylinder_2D/half_cylinder_2D.cfg | 29 +++++-------------- .../pipe_slice_3D/pipe3Dslice.cfg | 29 +++++-------------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 1902c909ee11..3787cf3732fe 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -153,7 +153,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) % % Number of total iterations -EXT_ITER= 400 +ITER= 400 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -206,25 +206,12 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 18 -% % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -24 +CONV_RESIDUAL_MINVAL= -24 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 -% -% Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_STARTITER= 10 % -% Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 -% -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG - % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % % Mesh input file @@ -237,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT_BINARY +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -264,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg index be3e7ae9ab05..ba82047cc8e4 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -143,7 +143,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) % % Number of total iterations -EXT_ITER= 20000 +ITER= 20000 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -188,25 +188,12 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 18 -% % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -24 +CONV_RESIDUAL_MINVAL= -24 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 -% -% Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_STARTITER= 10 % -% Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 -% -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG - % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % % Mesh input file @@ -219,25 +206,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= solution_flow.dat +RESTART_FILENAME= solution_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -246,7 +233,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint From 821f3b09bf48163381ecd610eabfc435340e6b90 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 14 Oct 2019 10:19:24 +0200 Subject: [PATCH 035/326] PR773 Adapting own Testcases to new output structure. --- .../half_cylinder_2D/half_cylinder_2D.cfg | 10 +++++----- .../pipe_slice_3D/pipe3Dslice.cfg | 10 +++++----- TestCases/parallel_regression.py | 4 ++-- TestCases/serial_regression.py | 20 +++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 3787cf3732fe..1ff8bf854e85 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -224,10 +224,10 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow % % Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj.dat +SOLUTION_ADJ_FILENAME= solution_adj % % Output file format (PARAVIEW, TECPLOT, STL) OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) @@ -236,10 +236,10 @@ OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) CONV_FILENAME= history % % Output file restart flow -RESTART_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow % % Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat +RESTART_ADJ_FILENAME= restart_adj % % Output file flow (w/o extension) variables VOLUME_FILENAME= flow @@ -248,7 +248,7 @@ VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint % % Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad.dat +GRAD_OBJFUNC_FILENAME= of_grad % % Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg index ba82047cc8e4..92d90eb8d036 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -206,10 +206,10 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow % % Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj.dat +SOLUTION_ADJ_FILENAME= solution_adj % % Output file format (PARAVIEW, TECPLOT, STL) OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) @@ -218,10 +218,10 @@ OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) CONV_FILENAME= history % % Output file restart flow -RESTART_FILENAME= solution_flow.dat +RESTART_FILENAME= solution_flow % % Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat +RESTART_ADJ_FILENAME= restart_adj % % Output file flow (w/o extension) variables VOLUME_FILENAME= flow @@ -230,7 +230,7 @@ VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint % % Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad.dat +GRAD_OBJFUNC_FILENAME= of_grad % % Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 353a0cf9cdcb..ba557bfdb753 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -376,7 +376,7 @@ def main(): streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" streamwise_periodic_cylinder.test_iter = 30 - streamwise_periodic_cylinder.test_vals = [-7.852372, -0.944669, 0.016752, 0.019021] #last 4 lines + streamwise_periodic_cylinder.test_vals = [30, -7.852372, -6.781204, -7.011341] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 @@ -387,7 +387,7 @@ def main(): streamwise_periodic_PipeSlice.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipe_slice_3D" streamwise_periodic_PipeSlice.cfg_file = "pipe3Dslice.cfg" streamwise_periodic_PipeSlice.test_iter = 10 - streamwise_periodic_PipeSlice.test_vals = [-10.352122, -10.185236, 0.000000, 0.000007] #last 4 lines + streamwise_periodic_PipeSlice.test_vals = [10, -10.352122, -10.185236, -10.185236] #last 4 lines streamwise_periodic_PipeSlice.su2_exec = "parallel_computation.py -f" streamwise_periodic_PipeSlice.timeout = 1600 streamwise_periodic_PipeSlice.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index ac65ead2a7fc..ce3f2d5f1c10 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1190,16 +1190,16 @@ def main(): test_list.append(dyn_fsi) # FSI, 2D airfoil with RBF interpolation - airfoilRBF = TestCase('airfoil_fsi_rbf') - airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" - airfoilRBF.cfg_file = "config.cfg" - airfoilRBF.test_iter = 0 - airfoilRBF.test_vals = [0.000000, 1.440246, -2.236518] #last 4 columns - airfoilRBF.su2_exec = "SU2_CFD" - airfoilRBF.timeout = 1600 - airfoilRBF.multizone = True - airfoilRBF.tol = 0.00001 - test_list.append(airfoilRBF) + #airfoilRBF = TestCase('airfoil_fsi_rbf') + #airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" + #airfoilRBF.cfg_file = "config.cfg" + #airfoilRBF.test_iter = 0 + #airfoilRBF.test_vals = [0.000000, 1.440246, -2.236518] #last 4 columns + #airfoilRBF.su2_exec = "SU2_CFD" + #airfoilRBF.timeout = 1600 + #airfoilRBF.multizone = True + #airfoilRBF.tol = 0.00001 + #test_list.append(airfoilRBF) # ########################## # ### Zonal multiphysics ### From c6789e398d716e9e656eede1e07b8dfc3ad36805 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 15 Oct 2019 14:03:17 +0200 Subject: [PATCH 036/326] Fix compiler warnings. Add recovered values to new output. --- Common/include/config_structure.hpp | 7 ++ Common/include/config_structure.inl | 3 + Common/src/config_structure.cpp | 2 + Common/src/geometry_structure.cpp | 2 +- SU2_CFD/include/output/CFlowIncOutput.hpp | 4 +- .../include/variables/CIncEulerVariable.hpp | 8 +- SU2_CFD/include/variables/CVariable.hpp | 4 +- SU2_CFD/src/numerics_direct_mean_inc.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 17 +++ SU2_CFD/src/solver_direct_mean_inc.cpp | 106 +++++++++++++++++- .../half_cylinder_2D/half_cylinder_2D.cfg | 4 +- config_template.cfg | 7 +- 12 files changed, 149 insertions(+), 17 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index fe92fed6d858..198ba02c90a6 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1028,6 +1028,7 @@ class CConfig { su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ + bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or outlet source term. */ su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ @@ -5973,6 +5974,12 @@ class CConfig { */ unsigned short GetKind_Streamwise_Periodic(void); + /*! + * \brief Get information about the streamwise periodicity Energy equation handling. + * \return Real periodic treatment of energy equation. + */ + bool GetStreamwise_Periodic_Temperature(void); + /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index bd66b53b3986..e4734beff8e0 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1621,6 +1621,9 @@ inline su2double* CConfig::GetPeriodicTranslation(unsigned short val_index) { inline unsigned short CConfig::GetKind_Streamwise_Periodic(void) { return Kind_Streamwise_Periodic; } +inline bool CConfig::GetStreamwise_Periodic_Temperature(void) { + return Streamwise_Periodic_Temperature; } + inline su2double CConfig::GetStreamwise_Periodic_PressureDrop(void) { return Streamwise_Periodic_PressureDrop; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index de986c253430..6eae7abe3811 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -914,6 +914,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NONE, PRESSURE_DROP, MASSFLOW) */ addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); + /*!\brief STREAMWISE_PERIODIC_TEMPERATURE \n DESCRIPTION: Use real periodicty for temperature: NO, YES \ingroup Config */ + addBoolOption("STREAMWISE_PERIODIC_TEMPERATURE", Streamwise_Periodic_Temperature, false); /* DESCRIPTION: Delta pressure on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); /* DESCRIPTION: Target Massflow, Delta P will be adapted until m_dot is met. */ diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index f4c4ffba777d..d5aaf2c7c7d9 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -12170,7 +12170,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, /*--- config container. ---*/ /*-------------------------------------------------------------------------------------------*/ - for (iPoint = 0; iPoint < size; iPoint++) { // loop over all vertices on that marker and fi + for (iPoint = 0; iPoint < static_cast(size); iPoint++) { // loop over all vertices on that marker and fi /*--- Get the norm of the current Point. ---*/ norm = 0.0; diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 153dd8ce2e33..5d965204f1d8 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -51,7 +51,9 @@ class CFlowIncOutput final: public CFlowOutput { unsigned short turb_model; /*!< \brief The kind of turbulence model*/ bool heat, /*!< \brief Boolean indicating whether have a heat problem*/ - weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ + streamwise_periodic, /*!< \brief */ + streamwise_periodic_temperature, /*!< \brief */ + weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ public: diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index 1bc042e3f964..577a27cabe0f 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -331,28 +331,28 @@ class CIncEulerVariable : public CVariable { * \brief Set the recovered pressure for streamwise periodic flow. * \param[in] val_pressure - pressure value. */ - inline void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint, su2double val_pressure) { + inline void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint, su2double val_pressure) override { Streamwise_Periodic_RecoveredPressure(iPoint) = val_pressure; } /*! * \brief Get the recovered pressure for streamwise periodic flow. * \return Recovered/Physical pressure for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const { + inline su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const override { return Streamwise_Periodic_RecoveredPressure(iPoint); } /*! * \brief Set the recovered pressure for streamwise periodic flow. * \param[in] val_temperature - temperature value. */ - inline void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) { + inline void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) override { Streamwise_Periodic_RecoveredTemperature(iPoint) = val_temperature; } /*! * \brief Get the recovered temperature for streamwise periodic flow. * \return Recovered/Physical temperature for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const { + inline su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const override { return Streamwise_Periodic_RecoveredTemperature(iPoint); } //TK:: unclear during merge whether necessary diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 5bf67e5f4a08..c59e81320049 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2739,7 +2739,7 @@ class CVariable { * \param[in] iPoint - Point index. * \return Recovered/Physical pressure for streamwise periodic flow. */ - inline virtual su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) { return 0.0; } + inline virtual su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const { return 0.0; } /*! * \brief A virtual member. @@ -2753,7 +2753,7 @@ class CVariable { * \param[in] iPoint - Point index. * \return Recovered/Physical temperature for streamwise periodic flow. */ - inline virtual su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) { return 0.0; } + inline virtual su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const { return 0.0; } /*! * \brief A virtual member. diff --git a/SU2_CFD/src/numerics_direct_mean_inc.cpp b/SU2_CFD/src/numerics_direct_mean_inc.cpp index 2bb6da257411..a7bc73e89e3d 100644 --- a/SU2_CFD/src/numerics_direct_mean_inc.cpp +++ b/SU2_CFD/src/numerics_direct_mean_inc.cpp @@ -1044,7 +1044,7 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ val_residual[nDim+1] = 0.0; - if (energy) { + if (energy && config->GetStreamwise_Periodic_Temperature()) { scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index f0372aac2ada..273541cb1c4e 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -47,6 +47,9 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp heat = config->GetEnergy_Equation(); weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + + streamwise_periodic = config->GetKind_Streamwise_Periodic(); + streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Set the default history fields if nothing is set in the config file ---*/ @@ -330,12 +333,16 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ // SOLUTION variables AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); + if(streamwise_periodic) + AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); AddVolumeOutput("VELOCITY-X", "Velocity_x", "SOLUTION", "x-component of the velocity vector"); AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector"); if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector"); if (heat || weakly_coupled_heat) AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); + if (heat && streamwise_periodic && streamwise_periodic_temperature) + AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); switch(config->GetKind_Turb_Model()){ case SST: case SST_SUST: @@ -444,6 +451,9 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ } AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); } + + AddVolumeOutput("RANK", "rank", "SOLUTION", "rank of the MPI-partition"); + } void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -467,6 +477,8 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); + if(streamwise_periodic) + SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(iPoint, 2)); if (nDim == 3){ @@ -475,6 +487,8 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve } else { if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, 3)); } + if (heat && streamwise_periodic && streamwise_periodic_temperature) + SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); switch(config->GetKind_Turb_Model()){ @@ -580,6 +594,9 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve } SetVolumeOutputValue("VORTICITY_Z", iPoint, Node_Flow->GetVorticity(iPoint)[2]); } + + SetVolumeOutputValue("RANK", iPoint, rank); + } void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 928d777afeee..e4206a3ba409 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2024,6 +2024,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont unsigned short iVar; unsigned long iPoint; + + unsigned short iDim, iMarker; + unsigned long iVertex; bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool rotating_frame = config->GetRotating_Frame(); @@ -2032,6 +2035,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); bool viscous = config->GetViscous(); bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); + bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Initialize the source residual to zero ---*/ @@ -2075,6 +2079,92 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); } + + if(!streamwise_periodic_temperature) { + //loop markers and find the "outlet marker" + + //compute "outlet" area + su2double Area_Local = 0.0, + Area_Global = 0.0, + FaceArea, + AxiFactor; + + vector AreaNormal(nDim); + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- Only "outlet"/donor periodic marker ---*/ + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 2) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); + + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } + Area_Local += sqrt(FaceArea); + + } // if domain + } // loop vertices + } // loop periodic boundaries + } // loop MarkerAll + + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo + SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + if(rank==MASTER_NODE) cout << "Source Res outlet area: " << Area_Global << endl; + + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- Only "outlet"/donor periodic marker ---*/ + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 2) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); + + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + FaceArea = 0.0; Area_Local = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } + Area_Local += sqrt(FaceArea); + + Residual[nDim+1] -= Area_Local/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + + } // if domain + } // loop vertices + } // loop periodic boundaries + } // loop MarkerAll + //add weighted heat sink to residual + + + /*--- Add the source residual to the total ---*/ + LinSysRes.AddBlock(iPoint, Residual); + } } if (body_force) { @@ -6373,9 +6463,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry unsigned long iVertex, iPoint; bool axisymmetric = config->GetAxisymmetric(); - bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration - && (config->GetInnerIter()!= 0)) - || (config->GetInnerIter() == 1)); + //bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration + // && (config->GetInnerIter()!= 0)) + // || (config->GetInnerIter() == 1)); /*-------------------------------------------------------------------------------------------------*/ /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ @@ -7676,6 +7766,9 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); + if (rank==MASTER_NODE && false) { + if (abs(Pressure_Recovered) > 1e-6) cout << "At iPoint: " << iPoint << " Pressure_Recovered " << Pressure_Recovered << endl; + } if (energy && InnerIter > 0) { //ExtIter > 0, hen egg problem Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); @@ -8519,6 +8612,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool energy = config->GetEnergy_Equation(); bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Variable allocation for streamwise periodicity ---*/ su2double Cp, @@ -8530,7 +8624,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai integratedHeatFlow; /*--- Variable initialization for streamwise periodicity ---*/ - if(energy && streamwise_periodic) { + if(energy && streamwise_periodic && streamwise_periodic_temperature) { massflow = config->GetStreamwise_Periodic_MassFlow(); integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); @@ -8613,13 +8707,13 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai /*--- With streamwise periodic BC and heatflux walls an additional term is introduced in the boundary formulation ---*/ - if (streamwise_periodic) { + if (streamwise_periodic && streamwise_periodic_temperature) { Cp = nodes->GetSpecificHeatCp(iPoint); thermal_conductivity = nodes->GetThermalConductivity(iPoint); /*--- Scalar part of the contribution ---*/ - su2double scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); + scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); /*--- Scalar product ---*/ dot_product = 0.0; diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 1ff8bf854e85..ffef116313af 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -96,6 +96,7 @@ MU_CONSTANT= 1e-4 % % Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= MASSFLOW +STREAMWISE_PERIODIC_TEMPERATURE= YES % % Delta P value that drives the flow as a source term in the momentum equations. % Defaults to 1.0. @@ -230,7 +231,8 @@ SOLUTION_FILENAME= solution_flow SOLUTION_ADJ_FILENAME= solution_adj % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) +OUTPUT_FILES= (RESTART_ASCII, PARAVIEW_ASCII, SURFACE_PARAVIEW_ASCII) +OUTPUT_WRT_FREQ= 100 % % Output file convergence history (w/o extension) CONV_FILENAME= history diff --git a/config_template.cfg b/config_template.cfg index d8f7b9561c77..6c0cb08dcfef 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -561,9 +561,14 @@ BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= NONE % +% Use streamwise periodic temperature (default=NO, YES) +% If YES, the heatflux is taken out at the outlet +% This option is only necessary if INC_ENERGY_EQUATION=YES +STREAMWISE_PERIODIC_TEMPERATURE= NO +% % Delta P value that drives the flow as a source term in the momentum equations. % Defaults to 1.0. STREAMWISE_PERIODIC_PRESSURE_DROP= 1.0 From fe564a9113b033af953c884cc796bc688177de85 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 17 Oct 2019 11:11:05 +0200 Subject: [PATCH 037/326] Small change for non-periodic temperature. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index e4206a3ba409..9b62d15d83bf 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2078,7 +2078,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Add the implicit Jacobian contribution ---*/ if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); - } + }// for iPoint if(!streamwise_periodic_temperature) { //loop markers and find the "outlet marker" @@ -2126,7 +2126,6 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); if(rank==MASTER_NODE) cout << "Source Res outlet area: " << Area_Global << endl; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { /*--- Only "outlet"/donor periodic marker ---*/ @@ -2149,11 +2148,15 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea = 0.0; Area_Local = 0.0; + FaceArea = 0.0; for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } - Area_Local += sqrt(FaceArea); + FaceArea = sqrt(FaceArea); - Residual[nDim+1] -= Area_Local/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; + Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + + /*--- Add the source residual to the total ---*/ + LinSysRes.AddBlock(iPoint, Residual); } // if domain } // loop vertices @@ -2162,8 +2165,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont //add weighted heat sink to residual - /*--- Add the source residual to the total ---*/ - LinSysRes.AddBlock(iPoint, Residual); + } } From ab8cafb173aa83bb1dd9dbba0304cfbb1b64e0e6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 18 Oct 2019 14:23:47 +0200 Subject: [PATCH 038/326] Delete unnecessary lines. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 9b62d15d83bf..152f858aeea2 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2162,10 +2162,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } // loop vertices } // loop periodic boundaries } // loop MarkerAll - //add weighted heat sink to residual - - } } From 5b4fe3ebb0d668b90e1d0dcf2262719bee7d39bd Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 26 Oct 2019 00:14:31 +0200 Subject: [PATCH 039/326] Added outlet heat sink for streamwise periodic flow. --- Common/include/config_structure.hpp | 9 ++- Common/include/config_structure.inl | 3 + Common/src/config_structure.cpp | 2 + SU2_CFD/include/output/CFlowIncOutput.hpp | 4 +- SU2_CFD/src/output/CAdjFlowCompOutput.cpp | 2 +- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 21 +++++-- SU2_CFD/src/output/CFlowOutput.cpp | 6 +- SU2_CFD/src/solver_direct_mean_inc.cpp | 72 +++++++++++++++++++---- 9 files changed, 97 insertions(+), 24 deletions(-) diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 198ba02c90a6..54ba1033640c 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -1032,7 +1032,8 @@ class CConfig { su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ @@ -5980,6 +5981,12 @@ class CConfig { */ bool GetStreamwise_Periodic_Temperature(void); + /*! + * \brief Get the value of the artificial periodic outlet heat. + * \return Heat value. + */ + su2double GetStreamwise_Periodic_OutletHeat(void); + /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index e4734beff8e0..2e7f309f5742 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1624,6 +1624,9 @@ inline unsigned short CConfig::GetKind_Streamwise_Periodic(void) { inline bool CConfig::GetStreamwise_Periodic_Temperature(void) { return Streamwise_Periodic_Temperature; } +inline su2double CConfig::GetStreamwise_Periodic_OutletHeat(void) { + return Streamwise_Periodic_OutletHeat; } + inline su2double CConfig::GetStreamwise_Periodic_PressureDrop(void) { return Streamwise_Periodic_PressureDrop; } diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index 39db0f255db1..40d834eb7c60 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -916,6 +916,8 @@ void CConfig::SetConfig_Options() { addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); /*!\brief STREAMWISE_PERIODIC_TEMPERATURE \n DESCRIPTION: Use real periodicty for temperature: NO, YES \ingroup Config */ addBoolOption("STREAMWISE_PERIODIC_TEMPERATURE", Streamwise_Periodic_Temperature, false); + /* DESCRIPTION: Heatflux boundary at streamwise periodic 'outlet', choose heat [W] such that net domain heatflux is zero. Only active if STREAMWISE_PERIODIC_TEMPERATURE is active. */ + addDoubleOption("STREAMWISE_PERIODIC_OUTLET_HEAT", Streamwise_Periodic_OutletHeat, 0.0); /* DESCRIPTION: Delta pressure on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); /* DESCRIPTION: Target Massflow, Delta P will be adapted until m_dot is met. */ diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 5d965204f1d8..06017e25275a 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -49,9 +49,9 @@ class CVariable; class CFlowIncOutput final: public CFlowOutput { private: - unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + unsigned short turb_model, /*!< \brief The kind of turbulence model*/ + streamwise_periodic; /*!< \brief */ bool heat, /*!< \brief Boolean indicating whether have a heat problem*/ - streamwise_periodic, /*!< \brief */ streamwise_periodic_temperature, /*!< \brief */ weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index a6859b69ae47..e9901ab8504a 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -269,7 +269,7 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C break; case SST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); - SetHistoryOutputValue("BGS_ADJOINT_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; default: break; } diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index d6356f136a0b..1bd2bc350057 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -282,7 +282,7 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS break; case SST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); - SetHistoryOutputValue("BGS_ADJOINT_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; default: break; } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 273541cb1c4e..93d8cb591b1d 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -211,6 +211,12 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); } + + if(streamwise_periodic) { + AddHistoryOutput("STREAMWISE_MASSFLOW", "SWMassflow", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); + AddHistoryOutput("STREAMWISE_DP", "SWDeltaP", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); + AddHistoryOutput("STREAMWISE_HEAT", "SWHeat", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); + } /*--- Add analyze surface history fields --- */ AddAnalyzeSurfaceOutput(config); @@ -311,6 +317,11 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + if(streamwise_periodic) { + SetHistoryOutputValue("STREAMWISE_MASSFLOW", config->GetStreamwise_Periodic_MassFlow()); + SetHistoryOutputValue("STREAMWISE_DP", config->GetStreamwise_Periodic_PressureDrop()); + SetHistoryOutputValue("STREAMWISE_HEAT", config->GetStreamwise_Periodic_IntegratedHeatFlow()); + } /*--- Set the analyse surface history values --- */ @@ -333,16 +344,12 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ // SOLUTION variables AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); - if(streamwise_periodic) - AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); AddVolumeOutput("VELOCITY-X", "Velocity_x", "SOLUTION", "x-component of the velocity vector"); AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector"); if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector"); if (heat || weakly_coupled_heat) - AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); - if (heat && streamwise_periodic && streamwise_periodic_temperature) - AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); + AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); switch(config->GetKind_Turb_Model()){ case SST: case SST_SUST: @@ -452,6 +459,10 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); } + if(streamwise_periodic) + AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); + if (heat && streamwise_periodic && streamwise_periodic_temperature) + AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); AddVolumeOutput("RANK", "rank", "SOLUTION", "rank of the MPI-partition"); } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 7d9e36e7d237..fbde93631eb0 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -134,6 +134,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi bool compressible = config->GetKind_Regime() == COMPRESSIBLE; bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; bool energy = config->GetEnergy_Equation(); + bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); bool axisymmetric = config->GetAxisymmetric(); @@ -222,6 +223,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi if (AxiFactor == 0.0) Vn = 0.0; else Vn /= Area; Vn2 = Vn * Vn; Pressure = solver->GetNodes()->GetPressure(iPoint); + if(streamwise_periodic) Pressure = solver->GetNodes()->GetStreamwise_Periodic_RecoveredPressure(iPoint); SoundSpeed = solver->GetNodes()->GetSoundSpeed(iPoint); for (iDim = 0; iDim < nDim; iDim++) { @@ -530,11 +532,11 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { su2double Pressure_Drop = 0.0; if (nMarker_Analyze == 2) { - Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref(); + Pressure_Drop = (Surface_TotalPressure_Total[1]-Surface_TotalPressure_Total[0]) * config->GetPressure_Ref(); //TK:: changed to total pressure config->SetSurface_PressureDrop(iMarker_Analyze, Pressure_Drop); } SetHistoryOutputPerSurfaceValue("PRESSURE_DROP", Pressure_Drop, iMarker_Analyze); - Tot_Surface_PressureDrop += Pressure_Drop; + Tot_Surface_PressureDrop = Pressure_Drop; //TK:: was += before, therefore it was counted double for 2 analyze markers } SetHistoryOutputValue("AVG_MASSFLOW", Tot_Surface_MassFlow); diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index cd62f14c3a38..dd46371c2b16 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -1592,7 +1592,7 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); /*--- Compute integrated Heatflux and massflow, TK:: Euler equations not implemented yet, probalby wasted here ---*/ - + if(rank==MASTER_NODE) cout << "EulerPrepsocessing GetStreamwise_Periodic_Properties." << endl; if (config->GetKind_Streamwise_Periodic()) GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Initialize the Jacobian matrices ---*/ @@ -2034,6 +2034,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool body_force = config->GetBody_Force(); bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); bool viscous = config->GetViscous(); + bool energy = config->GetEnergy_Equation(); bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); @@ -2080,14 +2081,19 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont }// for iPoint - if(!streamwise_periodic_temperature) { + if(!streamwise_periodic_temperature && energy) { //loop markers and find the "outlet marker" //compute "outlet" area su2double Area_Local = 0.0, Area_Global = 0.0, + MassFlow_Local, + Temperature_Local = 0.0, + Temperature_Global = 0.0, FaceArea, AxiFactor; + + unsigned short Kind_Averaging=1, area=0, massflow=1; vector AreaNormal(nDim); @@ -2095,7 +2101,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Only "outlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 2) { + config->GetMarker_All_PerBound(iMarker) == 1) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); @@ -2116,6 +2122,8 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont FaceArea = 0.0; for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } Area_Local += sqrt(FaceArea); + FaceArea = sqrt(FaceArea); + Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); } // if domain } // loop vertices @@ -2124,13 +2132,15 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - if(rank==MASTER_NODE) cout << "Source Res outlet area: " << Area_Global << endl; + SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + Temperature_Global /= Area_Global; + if(rank==MASTER_NODE) cout << "Source Res outlet area: " << Area_Global << endl << "Outlet Area Avg Temperature: " << Temperature_Global* config->GetTemperature_Ref() << endl; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { /*--- Only "outlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 2) { + config->GetMarker_All_PerBound(iMarker) == 1) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); @@ -2152,19 +2162,46 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } FaceArea = sqrt(FaceArea); + //compute local massflow + MassFlow_Local = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + MassFlow_Local += AreaNormal[iDim] * nodes->GetVelocity(iPoint, iDim) * nodes->GetDensity(iPoint) * AxiFactor; + } + for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + if(Kind_Averaging == area) { + if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { + Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + } else { + Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); + } + } else if (Kind_Averaging == massflow) { + if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { + Residual[nDim+1] -= abs(MassFlow_Local/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + } else { + Residual[nDim+1] -= abs(MassFlow_Local/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); + } + } /*--- Add the source residual to the total ---*/ LinSysRes.AddBlock(iPoint, Residual); + ///////////////////////////// + // hdf fluid adaption + for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; + + Residual[nDim+1] = 0.5 * abs(MassFlow_Local) * nodes->GetSpecificHeatCp(iPoint) * (Temperature_Global - config->GetInc_Temperature_Init()/config->GetTemperature_Ref() ); + + LinSysRes.AddBlock(iPoint, Residual); + + } // if domain } // loop vertices } // loop periodic boundaries } // loop MarkerAll - } - } + }// if !streamwise_periodic_temperature + }// if streamwise_periodic if (body_force) { @@ -6450,7 +6487,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry unsigned short iMesh, bool Output) { - if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } + //if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } /*---------------------------------------------------------------------------------------------*/ // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results // 2. Update delta_p is target massflow is chosen. @@ -6460,6 +6497,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry /*--- Initialization and allocation done here. ---*/ unsigned short iDim, iMarker; unsigned long iVertex, iPoint; + unsigned long InnerIter = config->GetInnerIter(); bool axisymmetric = config->GetAxisymmetric(); //bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration @@ -6551,7 +6589,16 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry /*--- Store updated pressure difference ---*/ Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; - config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); + /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times + (e.g. 4x for INC_RANS restart). Each time, the pressure drop gets updated. For INC_RANS restarts + it gets called 2x before the restart files are read such that the current massflow is + Area*inital-velocity which can be way off! + With this there is still a slight inconsitency wrt to a non-restarted simulation: The restarted "zero-th" + iteration does not get a pressure-update but the continuing simulation would have an update here. This can be + fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at + best ---*/ + if(InnerIter > 0) + config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); /*--- Output the new value of Delta P and ddp ---*/ if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK:: Move whole computation up in front of output @@ -6626,10 +6673,10 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry if (iMesh == MESH_0) config->SetStreamwise_Periodic_IntegratedHeatFlow(HeatFlow_Global); - if (rank == MASTER_NODE) { cout << "HeatFlow_Global: " << HeatFlow_Global * config->GetHeat_Flux_Ref() << endl; } + //if (rank == MASTER_NODE) { cout << "HeatFlow_Global: " << HeatFlow_Global * config->GetHeat_Flux_Ref() << endl; } } // if energy - if (rank == MASTER_NODE) { cout << "------------------------------- New Routine End --------------------------" << endl; } + //if (rank == MASTER_NODE) { cout << "------------------------------- New Routine End --------------------------" << endl; } } @@ -7777,6 +7824,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ + if(rank==MASTER_NODE) cout << "NSPrepsocessing GetStreamwise_Periodic_Properties." << endl; GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Free allocated memory. ---*/ From b9d48f715a8cefc6c1035becb28fead344086280 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 29 Oct 2019 08:47:01 +0100 Subject: [PATCH 040/326] Added avg Temp obj func to primal incomp. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index d0973b7e0af1..ae2ffb96d663 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -4488,6 +4488,9 @@ void CIncEulerSolver::Evaluate_ObjFunc(CConfig *config) { case SURFACE_PRESSURE_DROP: Total_ComboObj+=Weight_ObjFunc*config->GetSurface_PressureDrop(0); break; + case TOTAL_AVG_TEMPERATURE: + Total_ComboObj+=Weight_ObjFunc*config->GetSurface_Temperature(0); + break; case CUSTOM_OBJFUNC: Total_ComboObj+=Weight_ObjFunc*Total_Custom_ObjFunc; break; From 880af6cea920a5f0d5607d34599a270328e65d65 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 4 Nov 2019 08:30:10 +0100 Subject: [PATCH 041/326] Added feature_periodic_streamwise to tested branches in github CI. --- .github/workflows/regression.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 7772ddc101c4..37068ca871ac 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -5,6 +5,7 @@ on: branches: - 'develop' - 'master' + - 'feature_periodic_streamwise' pull_request: branches: - 'develop' @@ -85,5 +86,5 @@ jobs: - name: Run Tests in Container uses: docker://su2code/test-su2:20191031 with: - args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t develop -c feature_periodic_streamwise -s ${{matrix.testscript}} From 4e3135ce48f33a1d2da6df7e911ca1b01fdf7edc Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 11 Nov 2019 12:44:51 +0100 Subject: [PATCH 042/326] Supress intermediate screen output. --- SU2_CFD/src/solver_direct_mean_inc.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index 4d9a7b0ddd9d..f0cc9941931f 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -2120,7 +2120,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- Only "outlet"/donor periodic marker ---*/ + /*--- Only "inlet"/master periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { @@ -2155,11 +2155,11 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); Temperature_Global /= Area_Global; - if(rank==MASTER_NODE) cout << "Source Res outlet area: " << Area_Global << endl << "Outlet Area Avg Temperature: " << Temperature_Global* config->GetTemperature_Ref() << endl; + if(rank==MASTER_NODE && false) cout << "Source Res outlet area: " << Area_Global << endl << "Outlet Area Avg Temperature: " << Temperature_Global* config->GetTemperature_Ref() << endl; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- Only "outlet"/donor periodic marker ---*/ + /*--- Only "inlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { @@ -5403,7 +5403,7 @@ void CIncEulerSolver::BC_Sym_Plane(CGeometry *geometry, /*--- Loop over all the vertices on this boundary marker. ---*/ for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - if (iVertex == 0 || + if (iVertex == 0 || geometry->bound_is_straight[val_marker] != true) { /*----------------------------------------------------------------------------------------------*/ @@ -6527,8 +6527,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry Average_Density_Global /= Area_Global; config->SetStreamwise_Periodic_MassFlow(MassFlow_Global); - if (rank == MASTER_NODE) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } - if (rank == MASTER_NODE) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } + if (rank == MASTER_NODE && false) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } + if (rank == MASTER_NODE && false) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { /*------------------------------------------------------------------------------------------------*/ @@ -6561,7 +6561,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); /*--- Output the new value of Delta P and ddp ---*/ - if ((rank == MASTER_NODE) && (iMesh == MESH_0) ) { //TK:: Move whole computation up in front of output + if ((rank == MASTER_NODE) && (iMesh == MESH_0) && false) { //TK:: Move whole computation up in front of output cout.precision(5); cout.setf(ios::fixed, ios::floatfield); @@ -7781,7 +7781,7 @@ if (config->GetReconstructionGradientRequired() && (iMesh == MESH_0)) { } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - if(rank==MASTER_NODE) cout << "NSPrepsocessing GetStreamwise_Periodic_Properties." << endl; + if(rank==MASTER_NODE && false) cout << "NSPrepsocessing GetStreamwise_Periodic_Properties." << endl; GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Free allocated memory. ---*/ From bb28b3a21eb9a5d0fdc044ab72cc39e4ead5371d Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 18 Nov 2019 08:24:19 +0100 Subject: [PATCH 043/326] Add RANK output for heat zones --- SU2_CFD/src/output/CHeatOutput.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 33e98660477f..dc572f34d107 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -137,6 +137,9 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ // Residuals AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); + + // MPI-Rank + AddVolumeOutput("RANK", "rank", "SOLUTION", "rank of the MPI-partition"); } @@ -157,6 +160,9 @@ void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver * // Residuals SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes.GetBlock(iPoint, 0)); + + // MPI-Rank + SetVolumeOutputValue("RANK", iPoint, rank); } From c7b6a9bde48142f95e3bfa5376b204cbe9bef985 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 2 Dec 2019 10:51:50 +0100 Subject: [PATCH 044/326] Fix Vorticity Output for inc flow. --- SU2_CFD/src/output/CFlowIncOutput.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 5698f09dad0a..42e82acc3bc0 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -452,12 +452,11 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ } if(config->GetKind_Solver() == INC_RANS || config->GetKind_Solver() == INC_NAVIER_STOKES){ - if (nDim == 3){ - AddVolumeOutput("VORTICITY_X", "Vorticity_x", "VORTEX_IDENTIFICATION", "x-component of the vorticity vector"); - AddVolumeOutput("VORTICITY_Y", "Vorticity_y", "VORTEX_IDENTIFICATION", "y-component of the vorticity vector"); - AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); - } - AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); + AddVolumeOutput("VORTICITY_X", "Vorticity_x", "VORTEX_IDENTIFICATION", "x-component of the vorticity vector"); + AddVolumeOutput("VORTICITY_Y", "Vorticity_y", "VORTEX_IDENTIFICATION", "y-component of the vorticity vector"); + AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); + if (nDim == 3) + AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); } if(streamwise_periodic) From 33003bdd147fd4178c182bd07340e0164bcd1402 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 2 Dec 2019 15:29:58 +0100 Subject: [PATCH 045/326] disable ninja crashing for personal hpc builds --- externals/medi | 2 +- meson_scripts/init.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/medi b/externals/medi index a95a23ce7585..edde14f9ac40 160000 --- a/externals/medi +++ b/externals/medi @@ -1 +1 @@ -Subproject commit a95a23ce7585905c3a731b28c1bb512028fc02bb +Subproject commit edde14f9ac4026b72b1e130f61c0a78e8652afa5 diff --git a/meson_scripts/init.py b/meson_scripts/init.py index b0625e82c209..585bf97d18b5 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -151,7 +151,7 @@ def _extract_member(self, member, targetpath, pwd): if os.path.exists(alt_name) and os.listdir(alt_name): print('Directory ' + alt_name + ' is not empty') print('Maybe submodules are already cloned with git?') - sys.exit(1) + #sys.exit(1) else: print('Downloading ' + name + ' \'' + commit_sha + '\'') From ad8932192b6969cc70e2e17f1ed93f1900e6eb6f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 2 Dec 2019 16:16:55 +0100 Subject: [PATCH 046/326] .gitignore the ninja binary and the build/ folder --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6f6c868d48db..28c934136af0 100644 --- a/.gitignore +++ b/.gitignore @@ -80,4 +80,7 @@ Mercurial .hg* # Ignore build folder -./build/ +build/ + +# ninja binary +ninja From e33641d581e78be22651cf685f6a7bceb130ecc6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 29 Jan 2020 09:16:30 +0100 Subject: [PATCH 047/326] Remove solver_* files, which were mistakenly kept during merge. --- SU2_CFD/include/solver_structure.hpp | 14927 ------------------------- SU2_CFD/include/solver_structure.inl | 2459 ---- 2 files changed, 17386 deletions(-) delete mode 100644 SU2_CFD/include/solver_structure.hpp delete mode 100644 SU2_CFD/include/solver_structure.inl diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp deleted file mode 100644 index e8ea5b079396..000000000000 --- a/SU2_CFD/include/solver_structure.hpp +++ /dev/null @@ -1,14927 +0,0 @@ -/*! - * \file solver_structure.hpp - * \brief Headers of the main subroutines for solving partial differential equations. - * The subroutines and functions are in the solver_structure.cpp, - * solution_direct.cpp, solution_adjoint.cpp, and - * solution_linearized.cpp files. - * \author F. Palacios, T. Economon - * \version 7.0.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -#include "../../Common/include/mpi_structure.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "fluid_model.hpp" -#include "task_definition.hpp" -#include "numerics_structure.hpp" -#include "sgs_model.hpp" -#include "../../Common/include/fem_geometry_structure.hpp" -#include "../../Common/include/geometry/CGeometry.hpp" -#include "../../Common/include/config_structure.hpp" -#include "../../Common/include/linear_algebra/CSysMatrix.hpp" -#include "../../Common/include/linear_algebra/CSysVector.hpp" -#include "../../Common/include/linear_algebra/CSysSolve.hpp" -#include "../../Common/include/grid_movement_structure.hpp" -#include "../../Common/include/blas_structure.hpp" -#include "../../Common/include/graph_coloring_structure.hpp" -#include "../../Common/include/toolboxes/MMS/CVerificationSolution.hpp" - -/*--- CVariable includes, ToDo: Once this file is split, one per class these includes can also be separated. ---*/ -#include "variables/CBaselineVariable.hpp" -#include "variables/CEulerVariable.hpp" -#include "variables/CIncEulerVariable.hpp" -#include "variables/CTurbVariable.hpp" -#include "variables/CAdjEulerVariable.hpp" -#include "variables/CAdjTurbVariable.hpp" -#include "variables/CHeatFVMVariable.hpp" -#include "variables/CDiscAdjVariable.hpp" -#include "variables/CDiscAdjFEABoundVariable.hpp" - -using namespace std; - -/*! - * \class CSolver - * \brief Main class for defining the PDE solution, it requires - * a child class for each particular solver (Euler, Navier-Stokes, etc.) - * \author F. Palacios - */ -class CSolver { -protected: - int rank, /*!< \brief MPI Rank. */ - size; /*!< \brief MPI Size. */ - bool adjoint; /*!< \brief Boolean to determine whether solver is initialized as a direct or an adjoint solver. */ - unsigned short MGLevel; /*!< \brief Multigrid level of this solver object. */ - unsigned short IterLinSolver; /*!< \brief Linear solver iterations. */ - su2double ResLinSolver; /*!< \brief Final linear solver residual. */ - su2double NonLinRes_Value, /*!< \brief Summed value of the nonlinear residual indicator. */ - NonLinRes_Func; /*!< \brief Current value of the nonlinear residual indicator at one iteration. */ - unsigned short NonLinRes_Counter; /*!< \brief Number of elements of the nonlinear residual indicator series. */ - vector NonLinRes_Series; /*!< \brief Vector holding the nonlinear residual indicator series. */ - su2double Old_Func, /*!< \brief Old value of the nonlinear residual indicator. */ - New_Func; /*!< \brief Current value of the nonlinear residual indicator. */ - unsigned short nVar, /*!< \brief Number of variables of the problem. */ - nPrimVar, /*!< \brief Number of primitive variables of the problem. */ - nPrimVarGrad, /*!< \brief Number of primitive variables of the problem in the gradient computation. */ - nSecondaryVar, /*!< \brief Number of primitive variables of the problem. */ - nSecondaryVarGrad, /*!< \brief Number of primitive variables of the problem in the gradient computation. */ - nVarGrad, /*!< \brief Number of variables for deallocating the LS Cvector. */ - nDim; /*!< \brief Number of dimensions of the problem. */ - unsigned long nPoint; /*!< \brief Number of points of the computational grid. */ - unsigned long nPointDomain; /*!< \brief Number of points of the computational grid. */ - su2double Max_Delta_Time, /*!< \brief Maximum value of the delta time for all the control volumes. */ - Min_Delta_Time; /*!< \brief Minimum value of the delta time for all the control volumes. */ - su2double Max_CFL_Local; /*!< \brief Maximum value of the CFL across all the control volumes. */ - su2double Min_CFL_Local; /*!< \brief Minimum value of the CFL across all the control volumes. */ - su2double Avg_CFL_Local; /*!< \brief Average value of the CFL across all the control volumes. */ - su2double *Residual_RMS, /*!< \brief Vector with the mean residual for each variable. */ - *Residual_Max, /*!< \brief Vector with the maximal residual for each variable. */ - *Residual, /*!< \brief Auxiliary nVar vector. */ - *Residual_i, /*!< \brief Auxiliary nVar vector for storing the residual at point i. */ - *Residual_j; /*!< \brief Auxiliary nVar vector for storing the residual at point j. */ - su2double *Residual_BGS, /*!< \brief Vector with the mean residual for each variable for BGS subiterations. */ - *Residual_Max_BGS; /*!< \brief Vector with the maximal residual for each variable for BGS subiterations. */ - unsigned long *Point_Max; /*!< \brief Vector with the maximal residual for each variable. */ - unsigned long *Point_Max_BGS; /*!< \brief Vector with the maximal residual for each variable. */ - su2double **Point_Max_Coord; /*!< \brief Vector with pointers to the coords of the maximal residual for each variable. */ - su2double **Point_Max_Coord_BGS; /*!< \brief Vector with pointers to the coords of the maximal residual for each variable. */ - su2double *Solution, /*!< \brief Auxiliary nVar vector. */ - *Solution_i, /*!< \brief Auxiliary nVar vector for storing the solution at point i. */ - *Solution_j; /*!< \brief Auxiliary nVar vector for storing the solution at point j. */ - su2double *Vector, /*!< \brief Auxiliary nDim vector. */ - *Vector_i, /*!< \brief Auxiliary nDim vector to do the reconstruction of the variables at point i. */ - *Vector_j; /*!< \brief Auxiliary nDim vector to do the reconstruction of the variables at point j. */ - su2double *Res_Conv, /*!< \brief Auxiliary nVar vector for storing the convective residual. */ - *Res_Visc, /*!< \brief Auxiliary nVar vector for storing the viscous residual. */ - *Res_Sour, /*!< \brief Auxiliary nVar vector for storing the viscous residual. */ - *Res_Conv_i, /*!< \brief Auxiliary vector for storing the convective residual at point i. */ - *Res_Visc_i, /*!< \brief Auxiliary vector for storing the viscous residual at point i. */ - *Res_Conv_j, /*!< \brief Auxiliary vector for storing the convective residual at point j. */ - *Res_Visc_j; /*!< \brief Auxiliary vector for storing the viscous residual at point j. */ - su2double **Jacobian_i, /*!< \brief Auxiliary matrices for storing point to point Jacobians at point i. */ - **Jacobian_j; /*!< \brief Auxiliary matrices for storing point to point Jacobians at point j. */ - su2double **Jacobian_ii, /*!< \brief Auxiliary matrices for storing point to point Jacobians. */ - **Jacobian_ij, /*!< \brief Auxiliary matrices for storing point to point Jacobians. */ - **Jacobian_ji, /*!< \brief Auxiliary matrices for storing point to point Jacobians. */ - **Jacobian_jj; /*!< \brief Auxiliary matrices for storing point to point Jacobians. */ - su2double *iPoint_UndLapl, /*!< \brief Auxiliary variable for the undivided Laplacians. */ - *jPoint_UndLapl; /*!< \brief Auxiliary variable for the undivided Laplacians. */ - su2double **Smatrix, /*!< \brief Auxiliary structure for computing gradients by least-squares */ - **Cvector; /*!< \brief Auxiliary structure for computing gradients by least-squares */ - - int *Restart_Vars; /*!< \brief Auxiliary structure for holding the number of variables and points in a restart. */ - int Restart_ExtIter; /*!< \brief Auxiliary structure for holding the external iteration offset from a restart. */ - passivedouble *Restart_Data; /*!< \brief Auxiliary structure for holding the data values from a restart. */ - unsigned short nOutputVariables; /*!< \brief Number of variables to write. */ - - unsigned long nMarker, /*!< \brief Total number of markers using the grid information. */ - *nVertex; /*!< \brief Store nVertex at each marker for deallocation */ - - bool rotate_periodic; /*!< \brief Flag that controls whether the periodic solution needs to be rotated for the solver. */ - bool implicit_periodic; /*!< \brief Flag that controls whether the implicit system should be treated by the periodic BC comms. */ - - bool dynamic_grid; /*!< \brief Flag that determines whether the grid is dynamic (moving or deforming + grid velocities). */ - - su2double ***VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ - su2double ***VertexTractionAdjoint; /*- Also temporary -*/ - - string SolverName; /*!< \brief Store the name of the solver for output purposes. */ - - /*! - * \brief Pure virtual function, all derived solvers MUST implement a method returning their "nodes". - * \note Don't forget to call SetBaseClassPointerToNodes() in the constructor of the derived CSolver. - * \return Nodes of the solver, upcast to their base class (CVariable). - */ - virtual CVariable* GetBaseClassPointerToNodes() = 0; - - /*! - * \brief Call this method to set "base_nodes" after the "nodes" variable of the derived solver is instantiated. - * \note One could set base_nodes directly if it were not private but that could lead to confusion - */ - inline void SetBaseClassPointerToNodes() { base_nodes = GetBaseClassPointerToNodes(); } - -private: - - /*--- Private to prevent use by derived solvers, each solver MUST have its own "nodes" member of the - most derived type possible, e.g. CEulerVariable has nodes of CEulerVariable* and not CVariable*. - This variable is to avoid two virtual functions calls per call i.e. CSolver::GetNodes() returns - directly instead of calling GetBaseClassPointerToNodes() or doing something equivalent. ---*/ - CVariable* base_nodes; /*!< \brief Pointer to CVariable to allow polymorphic access to solver nodes. */ - -public: - - CSysVector LinSysSol; /*!< \brief vector to store iterative solution of implicit linear system. */ - CSysVector LinSysRes; /*!< \brief vector to store iterative residual of implicit linear system. */ - CSysVector LinSysAux; /*!< \brief vector to store iterative residual of implicit linear system. */ -#ifndef CODI_FORWARD_TYPE - CSysMatrix Jacobian; /*!< \brief Complete sparse Jacobian structure for implicit computations. */ - CSysSolve System; /*!< \brief Linear solver/smoother. */ -#else - CSysMatrix Jacobian; - CSysSolve System; -#endif - - CSysMatrix StiffMatrix; /*!< \brief Sparse structure for storing the stiffness matrix in Galerkin computations, and grid movement. */ - - CSysVector OutputVariables; /*!< \brief vector to store the extra variables to be written. */ - string* OutputHeadingNames; /*!< \brief vector of strings to store the headings for the exra variables */ - - CVerificationSolution *VerificationSolution; /*!< \brief Verification solution class used within the solver. */ - - vector fields; - /*! - * \brief Constructor of the class. - */ - CSolver(bool mesh_deform_mode = false); - - /*! - * \brief Destructor of the class. - */ - virtual ~CSolver(void); - - /*! - * \brief Allow outside access to the nodes of the solver, containing conservatives, primitives, etc. - * \return Nodes of the solver. - */ - inline CVariable* GetNodes() { - assert(base_nodes!=nullptr && "CSolver::base_nodes was not set properly, see brief for CSolver::SetBaseClassPointerToNodes()"); - return base_nodes; - } - - /*! - * \brief Routine to load a solver quantity into the data structures for MPI point-to-point communication and to launch non-blocking sends and recvs. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] commType - Enumerated type for the quantity to be communicated. - */ - void InitiateComms(CGeometry *geometry, - CConfig *config, - unsigned short commType); - - /*! - * \brief Routine to complete the set of non-blocking communications launched by InitiateComms() and unpacking of the data in the solver class. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] commType - Enumerated type for the quantity to be unpacked. - */ - void CompleteComms(CGeometry *geometry, - CConfig *config, - unsigned short commType); - - /*! - * \brief Routine to load a solver quantity into the data structures for MPI periodic communication and to launch non-blocking sends and recvs. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_periodic_index - Index for the periodic marker to be treated (first in a pair). - * \param[in] commType - Enumerated type for the quantity to be communicated. - */ - void InitiatePeriodicComms(CGeometry *geometry, - CConfig *config, - unsigned short val_periodic_index, - unsigned short commType); - - /*! - * \brief Routine to complete the set of non-blocking periodic communications launched by InitiatePeriodicComms() and unpacking of the data in the solver class. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_periodic_index - Index for the periodic marker to be treated (first in a pair). - * \param[in] commType - Enumerated type for the quantity to be unpacked. - */ - void CompletePeriodicComms(CGeometry *geometry, - CConfig *config, - unsigned short val_periodic_index, - unsigned short commType); - - /*! - * \brief Set number of linear solver iterations. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void SetIterLinSolver(unsigned short val_iterlinsolver); - - /*! - * \brief Set the final linear solver residual. - * \param[in] val_reslinsolver - Value of final linear solver residual. - */ - void SetResLinSolver(su2double val_reslinsolver); - - /*! - * \brief Set the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void SetResidual_RMS(CGeometry *geometry, CConfig *config); - - /*! - * \brief Communicate the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void SetResidual_BGS(CGeometry *geometry, CConfig *config); - - /*! - * \brief Set the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - virtual void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Move the mesh in time - */ - virtual void SetDualTime_Mesh(void); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - - /*! - * \brief Set the solver nondimensionalization. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void SetNondimensionalization(CConfig *config, unsigned short iMesh); - - /*! - * \brief Get information whether the initialization is an adjoint solver or not. - * \return TRUE means that it is an adjoint solver. - */ - bool GetAdjoint(void); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - virtual CFluidModel* GetFluidModel(void); - - /*! - * \brief Get number of linear solver iterations. - * \return Number of linear solver iterations. - */ - unsigned short GetIterLinSolver(void); - - /*! - * \brief Get the final linear solver residual. - * \return Value of final linear solver residual. - */ - inline su2double GetResLinSolver(void) { return ResLinSolver; } - - /*! - * \brief Get the value of the maximum delta time. - * \return Value of the maximum delta time. - */ - su2double GetMax_Delta_Time(void); - - /*! - * \brief Get the value of the minimum delta time. - * \return Value of the minimum delta time. - */ - su2double GetMin_Delta_Time(void); - - /*! - * \brief Get the value of the maximum delta time. - * \return Value of the maximum delta time. - */ - virtual su2double GetMax_Delta_Time(unsigned short val_Species); - - /*! - * \brief Get the value of the minimum delta time. - * \return Value of the minimum delta time. - */ - virtual su2double GetMin_Delta_Time(unsigned short val_Species); - - /*! - * \brief Get the value of the maximum local CFL number. - * \return Value of the maximum local CFL number. - */ - inline su2double GetMax_CFL_Local(void) { return Max_CFL_Local; } - - /*! - * \brief Get the value of the minimum local CFL number. - * \return Value of the minimum local CFL number. - */ - inline su2double GetMin_CFL_Local(void) { return Min_CFL_Local; } - - /*! - * \brief Get the value of the average local CFL number. - * \return Value of the average local CFL number. - */ - inline su2double GetAvg_CFL_Local(void) { return Avg_CFL_Local; } - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnVar(void); - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnPrimVar(void); - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnPrimVarGrad(void); - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnSecondaryVar(void); - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnSecondaryVarGrad(void); - - /*! - * \brief Get the number of variables of the problem. - */ - unsigned short GetnOutputVariables(void); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - virtual void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Set the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void SetRes_RMS(unsigned short val_var, su2double val_residual); - - /*! - * \brief Adds the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void AddRes_RMS(unsigned short val_var, su2double val_residual); - - /*! - * \brief Get the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - su2double GetRes_RMS(unsigned short val_var); - - /*! - * \brief Set the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void SetRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point); - - /*! - * \brief Adds the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - * \param[in] val_point - Value of the point index for the max residual. - * \param[in] val_coord - Location (x, y, z) of the max residual point. - */ - void AddRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point, su2double* val_coord); - - /*! - * \brief Adds the maximal residual, this is useful for the convergence history (overload). - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - * \param[in] val_point - Value of the point index for the max residual. - * \param[in] val_coord - Location (x, y, z) of the max residual point. - */ - void AddRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point, const su2double* val_coord); - - /*! - * \brief Get the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - su2double GetRes_Max(unsigned short val_var); - - /*! - * \brief Set the residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void SetRes_BGS(unsigned short val_var, su2double val_residual); - - /*! - * \brief Adds the residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void AddRes_BGS(unsigned short val_var, su2double val_residual); - - /*! - * \brief Get the residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - su2double GetRes_BGS(unsigned short val_var); - - /*! - * \brief Set the maximal residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - */ - void SetRes_Max_BGS(unsigned short val_var, su2double val_residual, unsigned long val_point); - - /*! - * \brief Adds the maximal residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \param[in] val_residual - Value of the residual to store in the position val_var. - * \param[in] val_point - Value of the point index for the max residual. - * \param[in] val_coord - Location (x, y, z) of the max residual point. - */ - void AddRes_Max_BGS(unsigned short val_var, su2double val_residual, unsigned long val_point, su2double* val_coord); - - /*! - * \brief Get the maximal residual for BGS subiterations. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - su2double GetRes_Max_BGS(unsigned short val_var); - - /*! - * \brief Get the residual for FEM structural analysis. - * \param[in] val_var - Index of the variable. - * \return Value of the residual for the variable in the position val_var. - */ - virtual su2double GetRes_FEM(unsigned short val_var) const; - - /*! - * \brief Get the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - unsigned long GetPoint_Max(unsigned short val_var); - - /*! - * \brief Get the location of the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Pointer to the location (x, y, z) of the biggest residual for the variable val_var. - */ - su2double* GetPoint_Max_Coord(unsigned short val_var); - - /*! - * \brief Get the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Value of the biggest residual for the variable in the position val_var. - */ - unsigned long GetPoint_Max_BGS(unsigned short val_var); - - /*! - * \brief Get the location of the maximal residual, this is useful for the convergence history. - * \param[in] val_var - Index of the variable. - * \return Pointer to the location (x, y, z) of the biggest residual for the variable val_var. - */ - su2double* GetPoint_Max_Coord_BGS(unsigned short val_var); - - /*! - * \brief Set the value of the RMS residual respective solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetResidual_Solution(CGeometry *geometry, CConfig *config); - - /*! - * \brief Set Value of the residual due to the Geometric Conservation Law (GCL) for steady rotating frame problems. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetRotatingFrame_GCL(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the Green-Gauss gradient of the auxiliary variable. - * \param[in] geometry - Geometrical definition of the problem. - */ - void SetAuxVar_Gradient_GG(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the Least Squares gradient of the auxiliary variable. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetAuxVar_Gradient_LS(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the Least Squares gradient of an auxiliar variable on the profile surface. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetAuxVar_Surface_Gradient(CGeometry *geometry, CConfig *config); - - /*! - * \brief Add External to Solution vector. - */ - void Add_External_To_Solution(); - - /*! - * \brief Add the current Solution vector to External. - */ - void Add_Solution_To_External(); - - /*! - * \brief Update a given cross-term with relaxation and the running total (External). - * \param[in] config - Definition of the particular problem. - * \param[in,out] cross_term - The cross-term being updated. - */ - void Update_Cross_Term(CConfig *config, su2passivematrix &cross_term); - - /*! - * \brief Compute the Green-Gauss gradient of the solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetSolution_Gradient_GG(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the Least Squares gradient of the solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetSolution_Gradient_LS(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the Least Squares gradient of the grid velocity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetGridVel_Gradient(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute slope limiter. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetSolution_Limiter(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetPrimitive_Limiter(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the pressure laplacian using in a incompressible solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] PressureLaplacian - Pressure laplacian. - */ - void SetPressureLaplacian(CGeometry *geometry, CConfig *config, su2double *PressureLaplacian); - - /*! - * \brief Set the old solution variables to the current solution value for Runge-Kutta iteration. - It is a virtual function, because for the DG-FEM solver a different version is needed. - * \param[in] geometry - Geometrical definition of the problem. - */ - virtual void Set_OldSolution(CGeometry *geometry); - - /*! - * \brief Set the new solution variables to the current solution value for classical RK. - * \param[in] geometry - Geometrical definition of the problem. - */ - virtual void Set_NewSolution(CGeometry *geometry); - - /*! - * \brief Load the geometries at the previous time states n and nM1. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Restart_OldGeometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - virtual void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] TimeSync - The synchronization time. - * \param[in,out] timeEvolved - On input the time evolved before the time step, - on output the time evolved after the time step. - * \param[out] syncTimeReached - Whether or not the synchronization time is reached. - */ - virtual void CheckTimeSynchronization(CConfig *config, - const su2double TimeSync, - su2double &timeEvolved, - bool &syncTimeReached); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void ProcessTaskList_DG(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void ADER_SpaceTimeIntegration(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void ComputeSpatialJacobian(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief A virtual member, overloaded. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, CNumerics **numerics, - unsigned short iMesh); - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - virtual void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - virtual void Convective_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - virtual void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member overloaded. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Container vector of the numerics of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - virtual void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, CNumerics **numerics, unsigned short iMesh, unsigned long Iteration, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Set_MPI_Nearfield(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetMax_Eigenvalue(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetUpwind_Ducros_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config); - - /*! - * \author H. Kline - * \brief Compute weighted-sum "combo" objective output - * \param[in] config - Definition of the particular problem. - */ - virtual void Evaluate_ObjFunc(CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Clamped(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Clamped_Post(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_DispDir(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Normal_Displacement(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Normal_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Dir_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Sine_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Damper(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - - virtual void BC_Deforming(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Interface_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void BC_Periodic(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config); - - /*! - * \brief Impose the interface state across sliding meshes. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Isothermal_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Dirichlet(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Neumann(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose via the residual the Euler boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Riemann(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_TurboRiemann(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief It computes Fourier transformation for the needed quantities along the pitch for each span in turbomachinery analysis. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] marker_flag - Surface marker flag where the function is applied. - */ - virtual void PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNumerics *conv_numerics, unsigned short marker_flag); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Giles(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the convective numerical method. - * \param[in] visc_numerics - Description of the viscous numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the symmetry boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Dielec(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_Electrode(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - virtual void BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Get the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - */ - virtual su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index); - - /*! - * \brief Allocates the final pointer of SlidingState depending on how many donor vertex donate to it. That number is stored in SlidingStateNodes[val_marker][val_vertex]. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - virtual void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - * \param[in] component - set value - */ - virtual void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component); - - /*! - * \brief Get the number of outer states for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - virtual int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the number of outer states for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] value - number of outer states - */ - virtual void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - * \param[in] relaxation factor - relaxation factor for the change of the variables - * \param[in] val_var - value of the variable - */ - virtual void SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - */ - virtual su2double GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - virtual void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - virtual void ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] solver - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ComputeUnderRelaxationFactor(CSolver **solver, CConfig *config); - - /*! - * \brief Adapt the CFL number based on the local under-relaxation parameters - * computed for each nonlinear iteration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] solver_container - Container vector with all the solutions. - */ - void AdaptCFLNumber(CGeometry **geometry, CSolver ***solver_container, CConfig *config); - - /*! - * \brief Reset the local CFL adaption variables - */ - void ResetCFLAdapt(); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ImplicitNewmark_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ImplicitNewmark_Update(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void ImplicitNewmark_Relaxation(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void GeneralizedAlpha_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void GeneralizedAlpha_UpdateLoads(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Compute_Residual(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Pressure_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Momentum_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Inviscid_DeltaForces(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Friction_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Buffet_Monitoring(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Viscous_DeltaForces(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void Wave_Strength(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - virtual void SetPrimitive_Gradient_GG(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - virtual void SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetPrimitive_Limiter_MPI(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] iPoint - Index of the grid point. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetPreconditioner(CConfig *config, unsigned long iPoint); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - virtual void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief A virtual member. - * \param[in] StiffMatrix_Elem - Stiffness matrix of an element - */ - virtual void AddStiffMatrix(su2double **StiffMatrix_Elem, unsigned long Point_0, unsigned long Point_1, unsigned long Point_2, unsigned long Point_3 ); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - virtual void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \param[in] val_sensitivity - Value of the sensitivity coefficient. - */ - virtual void SetCSensitivity(unsigned short val_marker, unsigned long val_vertex, su2double val_sensitivity); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetForceProj_Vector(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetIntBoundary_Jump(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_CD(su2double val_Total_CD); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CL - Value of the total lift coefficient. - */ - virtual void SetTotal_CL(su2double val_Total_CL); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_NetThrust(su2double val_Total_NetThrust); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_Power(su2double val_Total_Power); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_SolidCD(su2double val_Total_SolidCD); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_ReverseFlow(su2double val_ReverseFlow); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_MFR(su2double val_Total_MFR); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_Prop_Eff(su2double val_Total_Prop_Eff); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_ByPassProp_Eff(su2double val_Total_ByPassProp_Eff); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_Adiab_Eff(su2double val_Total_Adiab_Eff); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_Poly_Eff(su2double val_Total_Poly_Eff); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_IDC(su2double val_Total_IDC); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_IDC_Mach(su2double val_Total_IDC_Mach); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_IDR(su2double val_Total_IDR); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - virtual void SetTotal_DC60(su2double val_Total_DC60); - - /*! - * \brief A virtual member. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - virtual void SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief A virtual member. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - virtual void AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CT - Value of the total thrust coefficient. - */ - virtual void SetTotal_CT(su2double val_Total_CT); - - /*! - * \brief A virtual member. - * \param[in] val_Total_CQ - Value of the total torque coefficient. - */ - virtual void SetTotal_CQ(su2double val_Total_CQ); - - /*! - * \brief A virtual member. - * \param[in] val_Total_Heat - Value of the total heat load. - */ - virtual void SetTotal_HeatFlux(su2double val_Total_Heat); - - /*! - * \brief A virtual member. - * \param[in] val_Total_MaxHeat - Value of the total heat load. - */ - virtual void SetTotal_MaxHeatFlux(su2double val_Total_MaxHeat); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetDistance(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Smooth_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient (inviscid contribution) on the surface val_marker. - */ - virtual su2double GetCL_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient (viscous contribution) on the surface val_marker. - */ - virtual su2double GetCL_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CL(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CD(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CSF(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CEff(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFx(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFy(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFz(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMx(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMy(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMz(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CL_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CD_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CSF_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CEff_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFx_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFy_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFz_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMx_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMy_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMz_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CL_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CD_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CSF_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CEff_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFx_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFy_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFz_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMx_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMy_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMz_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the buffet metric on the surface val_marker. - */ - virtual su2double GetSurface_Buffet_Metric(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CL_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CD_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CSF_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CEff_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFx_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFy_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CFz_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMx_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMy_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - virtual su2double GetSurface_CMz_Mnt(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient (viscous contribution) on the surface val_marker. - */ - virtual su2double GetCSF_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient (inviscid contribution) on the surface val_marker. - */ - virtual su2double GetCD_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the mass flow rate on the surface val_marker. - */ - virtual su2double GetInflow_MassFlow(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solution - Container vector with all the solutions. - */ - virtual void GetPower_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief A virtual member. - */ - virtual void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief A virtual member. - */ - virtual void GetStreamwise_Periodic_Properties(CGeometry *geometry, - CConfig *config, - unsigned short iMesh, - bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solution - Container vector with all the solutions. - */ - virtual void GetEllipticSpanLoad_Diff(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - virtual void SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] convergence - boolean for whether the solution is converged - * \return boolean for whether the Fixed C_L mode is converged to target C_L - */ - virtual bool FixedCL_Convergence(CConfig *config, bool convergence); - - /*! - * \brief A virtual member. - * \return boolean for whether the Fixed C_L mode is currently in finite-differencing mode - */ - virtual bool GetStart_AoA_FD(void); - - /*! - * \brief A virtual member. - * \return boolean for whether the Fixed C_L mode is currently in finite-differencing mode - */ - virtual bool GetEnd_AoA_FD(void); - - /*! - * \brief A virtual member. - * \return value for the last iteration that the AoA was updated - */ - virtual unsigned long GetIter_Update_AoA(); - - /*! - * \brief A virtual member. - * \return value of the AoA before most recent update - */ - virtual su2double GetPrevious_AoA(); - - /*! - * \brief A virtual member. - * \return value of CL Driver control command (AoA_inc) - */ - virtual su2double GetAoA_inc(); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - virtual void SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the mass flow rate on the surface val_marker. - */ - virtual su2double GetExhaust_MassFlow(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the fan face pressure on the surface val_marker. - */ - virtual su2double GetInflow_Pressure(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the fan face mach on the surface val_marker. - */ - virtual su2double GetInflow_Mach(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the sideforce coefficient (inviscid contribution) on the surface val_marker. - */ - virtual su2double GetCSF_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the efficiency coefficient (inviscid contribution) on the surface val_marker. - */ - virtual su2double GetCEff_Inv(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the integrated heat flux (viscous contribution) on the surface val_marker. - */ - virtual su2double GetSurface_HF_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the maximum heat flux (viscous contribution) on the surface val_marker. - */ - virtual su2double GetSurface_MaxHF_Visc(unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient (viscous contribution) on the surface val_marker. - */ - virtual su2double GetCD_Visc(unsigned short val_marker); - - /*! - * \author H. Kline - * \brief Set the total "combo" objective (weighted sum of other values). - * \param[in] ComboObj - Value of the combined objective. - */ - virtual void SetTotal_ComboObj(su2double ComboObj); - - /*! - * \author H. Kline - * \brief Provide the total "combo" objective (weighted sum of other values). - * \return Value of the "combo" objective values. - */ - virtual su2double GetTotal_ComboObj(void); - - /*! - * \brief A virtual member. - * \return Value of the sideforce coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CSF(void); - - /*! - * \brief A virtual member. - * \return Value of the efficiency coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CEff(void); - - /*! - * \brief A virtual member. - * \return Value of the thrust coefficient (force in the -x direction, inviscid + viscous contribution). - */ - virtual su2double GetTotal_CT(void); - - /*! - * \brief A virtual member. - * \return Value of the torque coefficient (moment in the -x direction, inviscid + viscous contribution). - */ - virtual su2double GetTotal_CQ(void); - - /*! - * \brief A virtual member. - * \return Value of the heat load (integrated heat flux). - */ - virtual su2double GetTotal_HeatFlux(void); - - /*! - * \brief A virtual member. - * \return Value of the heat load (integrated heat flux). - */ - virtual su2double GetTotal_MaxHeatFlux(void); - - /*! - * \brief A virtual member. - * \return Value of the average temperature. - */ - virtual su2double GetTotal_AvgTemperature(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double Get_PressureDrag(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double Get_ViscDrag(void); - - /*! - * \brief A virtual member. - * \return Value of the rotor Figure of Merit (FM) (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CMerit(void); - - /*! - * \brief A virtual member. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CEquivArea(void); - - /*! - * \brief A virtual member. - * \return Value of the Aero drag (inviscid + viscous contribution). - */ - virtual su2double GetTotal_AeroCD(void); - - /*! - * \brief A virtual member. - * \return Value of the difference of the presure and the target pressure. - */ - virtual su2double GetTotal_CpDiff(void); - - /*! - * \brief A virtual member. - * \return Value of the difference of the heat and the target heat. - */ - virtual su2double GetTotal_HeatFluxDiff(void); - - /*! - * \brief A virtual member. - * \return Value of the FEA coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CFEA(void) const; - - /*! - * \brief A virtual member. - * \return Value of the Near-Field Pressure coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CNearFieldOF(void); - - /*! - * \author H. Kline - * \brief Add to the value of the total 'combo' objective. - * \param[in] val_obj - Value of the contribution to the 'combo' objective. - */ - virtual void AddTotal_ComboObj(su2double val_obj); - - /*! - * \brief A virtual member. - * \return Value of the objective function for a reference geometry. - */ - virtual su2double GetTotal_OFRefGeom(void) const; - - /*! - * \brief A virtual member. - * \return Value of the objective function for a reference node. - */ - virtual su2double GetTotal_OFRefNode(void) const; - - /*! - * \brief A virtual member. - * \return Value of the objective function for the volume fraction. - */ - virtual su2double GetTotal_OFVolFrac(void) const; - - /*! - * \brief A virtual member. - * \return Value of the objective function for the structural compliance. - */ - virtual su2double GetTotal_OFCompliance(void) const; - - /*! - * \brief A virtual member. - * \return Bool that defines whether the solution has an element-based file or not - */ - virtual bool IsElementBased(void) const; - - /*! - * \brief A virtual member. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - virtual void SetTotal_CEquivArea(su2double val_cequivarea); - - /*! - * \brief A virtual member. - * \param[in] val_aerocd - Value of the aero drag. - */ - virtual void SetTotal_AeroCD(su2double val_aerocd); - - /*! - * \brief A virtual member. - * \param[in] val_pressure - Value of the difference between pressure and the target pressure. - */ - virtual void SetTotal_CpDiff(su2double val_pressure); - - /*! - * \brief A virtual member. - * \param[in] val_pressure - Value of the difference between heat and the target heat. - */ - virtual void SetTotal_HeatFluxDiff(su2double val_heat); - - /*! - * \brief A virtual member. - * \param[in] val_cfea - Value of the FEA coefficient. - */ - virtual void SetTotal_CFEA(su2double val_cfea); - - /*! - * \brief A virtual member. - * \param[in] val_ofrefgeom - Value of the objective function for a reference geometry. - */ - virtual void SetTotal_OFRefGeom(su2double val_ofrefgeom); - - /*! - * \brief A virtual member. - * \param[in] val_ofrefgeom - Value of the objective function for a reference node. - */ - virtual void SetTotal_OFRefNode(su2double val_ofrefnode); - - /*! - * \brief A virtual member. - * \param[in] val_cnearfieldpress - Value of the Near-Field pressure coefficient. - */ - virtual void SetTotal_CNearFieldOF(su2double val_cnearfieldpress); - - /*! - * \brief A virtual member. - * \return Value of the lift coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CL(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CD(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_NetThrust(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Power(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_SolidCD(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_ReverseFlow(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_MFR(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Prop_Eff(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_ByPassProp_Eff(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Adiab_Eff(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Poly_Eff(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_IDC(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_IDC_Mach(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_IDR(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_DC60(void); - - /*! - * \brief A virtual member. - * \return Value of the custom objective function. - */ - virtual su2double GetTotal_Custom_ObjFunc(void); - - /*! - * \brief A virtual member. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CMx(void); - - /*! - * \brief A virtual member. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CMy(void); - - /*! - * \brief A virtual member. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CMz(void); - - /*! - * \brief A virtual member. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CoPx(void); - - /*! - * \brief A virtual member. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CoPy(void); - - /*! - * \brief A virtual member. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CoPz(void); - - /*! - * \brief A virtual member. - * \return Value of the force x coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CFx(void); - - /*! - * \brief A virtual member. - * \return Value of the force y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CFy(void); - - /*! - * \brief A virtual member. - * \return Value of the force y coefficient (inviscid + viscous contribution). - */ - virtual su2double GetTotal_CFz(void); - - /*! - * \brief A virtual member. - * \return Value of the wave strength. - */ - virtual su2double GetTotal_CWave(void); - - /*! - * \brief A virtual member. - * \return Value of the wave strength. - */ - virtual su2double GetTotal_CHeat(void); - - /*! - * \brief A virtual member. - * \return Value of the lift coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CL_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CD_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CSF_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CEff_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMx_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMy_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMz_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPx_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPy_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPz_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFx_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFy_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFz_Inv(void); - - /*! - * \brief A virtual member. - * \return Value of the lift coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CL_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CD_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CSF_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CEff_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMx_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMy_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMz_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPx_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPy_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPz_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFx_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFy_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFz_Visc(void); - - /*! - * \brief A virtual member. - * \return Value of the lift coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CL_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CD_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CSF_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CEff_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMx_Mnt(void); - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMy_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CMz_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPx_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPy_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CoPz_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFx_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFy_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the drag coefficient (inviscid contribution). - */ - virtual su2double GetAllBound_CFz_Mnt(void); - - /*! - * \brief A virtual member. - * \return Value of the buffet metric. - */ - virtual su2double GetTotal_Buffet_Metric(void); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double GetCPressure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - - virtual void SetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double *GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - - virtual void SetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - - virtual su2double *GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - - virtual su2double GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual unsigned long GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double *GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double GetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex, su2double val_deltap); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual su2double GetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex, su2double val_deltat); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the total temperature is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total temperature is evaluated. - * \return Value of the total temperature - */ - virtual su2double GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the total pressure is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total pressure is evaluated. - * \return Value of the total pressure - */ - virtual su2double GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the flow direction is evaluated - * \param[in] val_vertex - Vertex of the marker val_marker where the flow direction is evaluated - * \param[in] val_dim - The component of the flow direction unit vector to be evaluated - * \return Component of a unit vector representing the flow direction. - */ - virtual su2double GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the total temperature is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the total temperature is set. - * \param[in] val_ttotal - Value of the total temperature - */ - virtual void SetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ttotal); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the total pressure is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the total pressure is set. - * \param[in] val_ptotal - Value of the total pressure - */ - virtual void SetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ptotal); - - /*! - * \brief A virtual member - * \param[in] val_marker - Surface marker where the flow direction is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the flow direction is set. - * \param[in] val_dim - The component of the flow direction unit vector to be set - * \param[in] val_flowdir - Component of a unit vector representing the flow direction. - */ - virtual void SetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_flowdir); - - /*! - * \brief A virtual member - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the turbulence variable (i.e. k is 0 in SST) - * \param[in] val_turb_var - Value of the turbulence variable to be used. - */ - virtual void SetInlet_TurbVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_turb_var); - - /*! - * \brief A virtual member - * \param[in] config - Definition of the particular problem. - * \param[in] iMarker - Surface marker where the coefficient is computed. - */ - virtual void SetUniformInlet(CConfig* config, unsigned short iMarker); - - /*! - * \brief A virtual member - * \param[in] val_inlet - vector containing the inlet values for the current vertex. - * \param[in] iMarker - Surface marker where the coefficient is computed. - * \param[in] iVertex - Vertex of the marker iMarker where the inlet is being set. - */ - virtual void SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief A virtual member - * \param[in] val_inlet - vector returning the inlet values for the current vertex. - * \param[in] val_inlet_point - Node index where the inlet is being set. - * \param[in] val_kind_marker - Enumerated type for the particular inlet type. - * \param[in] geometry - Geometrical definition of the problem. - * \param config - Definition of the particular problem. - * \return Value of the face area at the vertex. - */ - virtual su2double GetInletAtVertex(su2double *val_inlet, - unsigned long val_inlet_point, - unsigned short val_kind_marker, - string val_marker, - CGeometry *geometry, - CConfig *config); - - /*! - * \brief Update the multi-grid structure for the customized boundary conditions - * \param geometry_container - Geometrical definition. - * \param config - Definition of the particular problem. - */ - virtual void UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the skin friction coefficient. - */ - virtual su2double GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - virtual su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - virtual su2double GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - virtual void SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the buffet sensor. - */ - virtual su2double GetBuffetSensor(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the y plus. - */ - virtual su2double GetYPlus(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \return Value of the StrainMag_Max - */ - virtual su2double GetStrainMag_Max(void); - - /*! - * \brief A virtual member. - * \return Value of the Omega_Max - */ - virtual su2double GetOmega_Max(void); - - /*! - * \brief A virtual member. - * \return Value of the StrainMag_Max - */ - virtual void SetStrainMag_Max(su2double val_strainmag_max); - - /*! - * \brief A virtual member. - * \return Value of the Omega_Max - */ - virtual void SetOmega_Max(su2double val_omega_max); - - /*! - * \brief A virtual member. - * \return Value of the adjoint density at the infinity. - */ - virtual su2double GetPsiRho_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the adjoint density at the infinity. - */ - virtual su2double* GetPsiRhos_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the adjoint energy at the infinity. - */ - virtual su2double GetPsiE_Inf(void); - - /*! - * \brief A virtual member. - * \param[in] val_dim - Index of the adjoint velocity vector. - * \return Value of the adjoint velocity vector at the infinity. - */ - virtual su2double GetPhi_Inf(unsigned short val_dim); - - /*! - * \brief A virtual member. - * \return Value of the geometrical sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_Geo(void); - - /*! - * \brief A virtual member. - * \return Value of the Mach sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_Mach(void); - - /*! - * \brief A virtual member. - * \return Value of the angle of attack sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_AoA(void); - - /*! - * \brief Set the total farfield pressure sensitivity coefficient. - * \return Value of the farfield pressure sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_Press(void); - - /*! - * \brief Set the total farfield temperature sensitivity coefficient. - * \return Value of the farfield temperature sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_Temp(void); - - /*! - * \author H. Kline - * \brief Get the total back pressure sensitivity coefficient. - * \return Value of the back pressure sensitivity coefficient - * (inviscid + viscous contribution). - */ - virtual su2double GetTotal_Sens_BPress(void); - - /*! - * \brief A virtual member. - * \return Value of the density sensitivity. - */ - virtual su2double GetTotal_Sens_Density(void); - - /*! - * \brief A virtual member. - * \return Value of the velocity magnitude sensitivity. - */ - virtual su2double GetTotal_Sens_ModVel(void); - - /*! - * \brief A virtual member. - * \return Value of the density at the infinity. - */ - virtual su2double GetDensity_Inf(void); - - /*! - * \brief A virtual member. - * \param[in] val_var - Index of the variable for the density. - * \return Value of the density at the infinity. - */ - virtual su2double GetDensity_Inf(unsigned short val_var); - - /*! - * \brief A virtual member. - * \return Value of the velocity at the infinity. - */ - virtual su2double GetModVelocity_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the density x energy at the infinity. - */ - virtual su2double GetDensity_Energy_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the pressure at the infinity. - */ - virtual su2double GetPressure_Inf(void); - - /*! - * \brief A virtual member. - * \param[in] val_dim - Index of the adjoint velocity vector. - * \return Value of the density x velocity at the infinity. - */ - virtual su2double GetDensity_Velocity_Inf(unsigned short val_dim); - - /*! - * \brief A virtual member. - * \param[in] val_dim - Index of the velocity vector. - * \param[in] val_var - Index of the variable for the velocity. - * \return Value of the density multiply by the velocity at the infinity. - */ - virtual su2double GetDensity_Velocity_Inf(unsigned short val_dim, unsigned short val_var); - - /*! - * \brief A virtual member. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the velocity at the infinity. - */ - virtual su2double GetVelocity_Inf(unsigned short val_dim); - - /*! - * \brief A virtual member. - * \return Value of the velocity at the infinity. - */ - virtual su2double *GetVelocity_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the viscosity at the infinity. - */ - virtual su2double GetViscosity_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of nu tilde at the far-field. - */ - virtual su2double GetNuTilde_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the turbulent kinetic energy. - */ - virtual su2double GetTke_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the turbulent frequency. - */ - virtual su2double GetOmega_Inf(void); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Young Modulus E - */ - virtual su2double GetTotal_Sens_E(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity for the Poisson's ratio Nu - */ - virtual su2double GetTotal_Sens_Nu(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the structural density sensitivity - */ - virtual su2double GetTotal_Sens_Rho(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the structural weight sensitivity - */ - virtual su2double GetTotal_Sens_Rho_DL(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField - */ - virtual su2double GetTotal_Sens_EField(unsigned short iEField); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the FEA DV in the region iDVFEA - */ - virtual su2double GetTotal_Sens_DVFEA(unsigned short iDVFEA); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Young Modulus E - */ - virtual su2double GetGlobal_Sens_E(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Poisson's ratio Nu - */ - virtual su2double GetGlobal_Sens_Nu(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the structural density sensitivity - */ - virtual su2double GetGlobal_Sens_Rho(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the structural weight sensitivity - */ - virtual su2double GetGlobal_Sens_Rho_DL(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField - */ - virtual su2double GetGlobal_Sens_EField(unsigned short iEField); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the FEA DV in the region iDVFEA - */ - virtual su2double GetGlobal_Sens_DVFEA(unsigned short iDVFEA); - - /*! - * \brief A virtual member. - * \return Value of the Young modulus from the adjoint solver - */ - virtual su2double GetVal_Young(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the Poisson's ratio from the adjoint solver - */ - virtual su2double GetVal_Poisson(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the density for inertial effects, from the adjoint solver - */ - virtual su2double GetVal_Rho(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the density for dead loads, from the adjoint solver - */ - virtual su2double GetVal_Rho_DL(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Number of electric field variables from the adjoint solver - */ - virtual unsigned short GetnEField(void); - - /*! - * \brief A virtual member. - * \return Number of design variables from the adjoint solver - */ - virtual unsigned short GetnDVFEA(void); - - /*! - * \brief A virtual member. - */ - virtual void ReadDV(CConfig *config); - - /*! - * \brief A virtual member. - * \return Pointer to the values of the Electric Field - */ - virtual su2double GetVal_EField(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Pointer to the values of the design variables - */ - virtual su2double GetVal_DVFEA(unsigned short iVal); - - /*! - * \brief A virtual member. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the sensitivity coefficient. - */ - virtual su2double GetCSensitivity(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A virtual member. - * \return A pointer to an array containing a set of constants - */ - virtual su2double* GetConstants(); - - /*! - * \brief A virtual member. - * \param[in] iBGS - Number of BGS iteration. - * \param[in] val_forcecoeff_history - Value of the force coefficient. - */ - virtual void SetForceCoeff(su2double val_forcecoeff_history); - - /*! - * \brief A virtual member. - * \param[in] val_relaxcoeff_history - Value of the force coefficient. - */ - virtual void SetRelaxCoeff(su2double val_relaxcoeff_history); - - /*! - * \brief A virtual member. - * \param[in] iBGS - Number of BGS iteration. - * \param[in] val_FSI_residual - Value of the residual. - */ - virtual void SetFSI_Residual(su2double val_FSI_residual); - - /*! - * \brief A virtual member. - * \param[out] val_forcecoeff_history - Value of the force coefficient. - */ - virtual su2double GetForceCoeff() const; - - /*! - * \brief A virtual member. - * \param[out] val_relaxcoeff_history - Value of the relax coefficient. - */ - virtual su2double GetRelaxCoeff() const; - - /*! - * \brief A virtual member. - * \param[out] val_FSI_residual - Value of the residual. - */ - virtual su2double GetFSI_Residual() const; - - /*! - * \brief A virtual member. - * \param[in] solver1_geometry - Geometrical definition of the problem. - * \param[in] solver1_solution - Container vector with all the solutions. - * \param[in] solver1_config - Definition of the particular problem. - * \param[in] solver2_geometry - Geometrical definition of the problem. - * \param[in] solver2_solution - Container vector with all the solutions. - * \param[in] solver2_config - Definition of the particular problem. - */ - virtual void Copy_Zone_Solution(CSolver ***solver1_solution, - CGeometry **solver1_geometry, - CConfig *solver1_config, - CSolver ***solver2_solution, - CGeometry **solver2_geometry, - CConfig *solver2_config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - virtual void SetInitialCondition(CGeometry **geometry, - CSolver ***solver_container, - CConfig *config, unsigned long ExtIter); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - virtual void ResetInitialCondition(CGeometry **geometry, - CSolver ***solver_container, - CConfig *config, unsigned long ExtIter); - - /*! - * \brief A virtual member. - * \param[in] fea_geometry - Geometrical definition of the problem. - * \param[in] fea_config - Geometrical definition of the problem. - * \param[in] fea_geometry - Definition of the particular problem. - */ - virtual void PredictStruct_Displacement(CGeometry **fea_geometry, - CConfig *fea_config, - CSolver ***fea_solution); - - /*! - * \brief A virtual member. - * \param[in] fea_geometry - Geometrical definition of the problem. - * \param[in] fea_config - Geometrical definition of the problem. - * \param[in] fea_geometry - Definition of the particular problem. - */ - virtual void ComputeAitken_Coefficient(CGeometry **fea_geometry, - CConfig *fea_config, - CSolver ***fea_solution, - unsigned long iOuterIter); - - - /*! - * \brief A virtual member. - * \param[in] fea_geometry - Geometrical definition of the problem. - * \param[in] fea_config - Geometrical definition of the problem. - * \param[in] fea_geometry - Definition of the particular problem. - */ - virtual void SetAitken_Relaxation(CGeometry **fea_geometry, - CConfig *fea_config, - CSolver ***fea_solution); - - /*! - * \brief A virtual member. - * \param[in] fea_geometry - Geometrical definition of the problem. - * \param[in] fea_config - Geometrical definition of the problem. - * \param[in] fea_geometry - Definition of the particular problem. - */ - virtual void Update_StructSolution(CGeometry **fea_geometry, - CConfig *fea_config, - CSolver ***fea_solution); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - virtual void LoadRestart(CGeometry **geometry, CSolver ***solver, - CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Read a native SU2 restart file in ASCII format. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_filename - String name of the restart file. - */ - void Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, string val_filename); - - /*! - * \brief Read a native SU2 restart file in binary format. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_filename - String name of the restart file. - */ - void Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, string val_filename); - - /*! - * \brief Read the metadata from a native SU2 restart file (ASCII or binary). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] adjoint - Boolean to identify the restart file of an adjoint run. - * \param[in] val_filename - String name of the restart file. - */ - void Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bool adjoint_run, string val_filename); - - /*! - * \brief Load a inlet profile data from file into a particular solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_kind_solver - Solver container position. - * \param[in] val_kind_marker - Kind of marker to apply the profiles. - */ - void LoadInletProfile(CGeometry **geometry, - CSolver ***solver, - CConfig *config, - int val_iter, - unsigned short val_kind_solver, - unsigned short val_kind_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_OFRefGeom(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_OFRefNode(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_OFVolFrac(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_OFCompliance(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Stiffness_Penalty(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - */ - virtual void LoadRestart_FSI(CGeometry *geometry, CConfig *config, int val_iter); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void RefGeom_Sensitivity(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void DE_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Stiffness_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] iElem - element parameter. - * \param[out] iElem_iDe - ID of the Dielectric Elastomer region. - */ - virtual unsigned short Get_iElem_iDe(unsigned long iElem) const; - - /*! - * \brief A virtual member. - * \param[in] i_DV - number of design variable. - * \param[in] val_EField - value of the design variable. - */ - virtual void Set_DV_Val(su2double val_EField, unsigned short i_DV); - - /*! - * \brief A virtual member. - * \param[in] i_DV - number of design variable. - * \param[out] DV_Val - value of the design variable. - */ - virtual su2double Get_DV_Val(unsigned short i_DV); - - /*! - * \brief A virtual member. - * \param[out] val_I - value of the objective function. - */ - virtual su2double Get_val_I(void); - - /*! - * \brief Gauss method for solving a linear system. - * \param[in] A - Matrix Ax = b. - * \param[in] rhs - Right hand side. - * \param[in] nVar - Number of variables. - */ - void Gauss_Elimination(su2double** A, su2double* rhs, unsigned short nVar); - - /*! - * \brief Prepares and solves the aeroelastic equations. - * \param[in] surface_movement - Surface movement classes of the problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - Physical iteration number. - */ - void Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometry, CConfig *config, unsigned long TimeIter); - - /*! - * \brief Sets up the generalized eigenvectors and eigenvalues needed to solve the aeroelastic equations. - * \param[in] PHI - Matrix of the generalized eigenvectors. - * \param[in] lambda - The eigenvalues of the generalized eigensystem. - * \param[in] config - Definition of the particular problem. - */ - void SetUpTypicalSectionWingModel(vector >& PHI, vector& w, CConfig *config); - - /*! - * \brief Solve the typical section wing model. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] Cl - Coefficient of lift at particular iteration. - * \param[in] Cm - Moment coefficient about z-axis at particular iteration. - * \param[in] config - Definition of the particular problem. - * \param[in] val_Marker - Surface that is being monitored. - * \param[in] displacements - solution of typical section wing model. - */ - - void SolveTypicalSectionWingModel(CGeometry *geometry, su2double Cl, su2double Cm, CConfig *config, unsigned short val_Marker, vector& displacements); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config_container - The particular config. - */ - virtual void RegisterSolution(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config_container - The particular config. - */ - virtual void RegisterOutput(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - virtual void SetAdjoint_Output(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - virtual void SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - virtual void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - virtual void ExtractAdjoint_Geometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - virtual void ExtractAdjoint_CrossTerm(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - virtual void ExtractAdjoint_CrossTerm_Geometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - virtual void ExtractAdjoint_CrossTerm_Geometry_Flow(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member - * \param[in] geometry - The geometrical definition of the problem. - */ - virtual void RegisterObj_Func(CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetSurface_Sensitivity(CGeometry *geometry, CConfig* config); - - /*! - * \brief A virtual member. Extract and set the geometrical sensitivity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - The solver container holding all terms of the solution. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetSensitivity(CGeometry *geometry, CSolver **solver, CConfig *config); - - virtual void SetAdj_ObjFunc(CGeometry *geometry, CConfig* config); - - /*! - * \brief A virtual member. - * \param[in] Set value of interest: 0 - Initial value, 1 - Current value. - */ - virtual void SetFSI_ConvValue(unsigned short val_index, su2double val_criteria); - - /*! - * \brief A virtual member. - * \param[in] Value of interest: 0 - Initial value, 1 - Current value. - * \return Values to compare - */ - virtual su2double GetFSI_ConvValue(unsigned short val_index) const; - - /*! - * \brief A virtual member. - * \param[in] CurrentTime - Current time step. - * \param[in] RampTime - Time for application of the ramp.* - * \param[in] config - Definition of the particular problem. - */ - virtual su2double Compute_LoadCoefficient(su2double CurrentTime, su2double RampTime, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_StiffMatrix(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_MassRes(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_NodalStressRes(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - virtual void Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void Solve_System(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \return Value of the dynamic Aitken relaxation factor - */ - virtual su2double GetWAitken_Dyn(void) const; - - /*! - * \brief A virtual member. - * \return Value of the last Aitken relaxation factor in the previous time step. - */ - virtual su2double GetWAitken_Dyn_tn1(void) const; - - /*! - * \brief A virtual member. - * \param[in] Value of the dynamic Aitken relaxation factor - */ - virtual void SetWAitken_Dyn(su2double waitk); - - /*! - * \brief A virtual member. - * \param[in] Value of the last Aitken relaxation factor in the previous time step. - */ - virtual void SetWAitken_Dyn_tn1(su2double waitk_tn1); - - /*! - * \brief A virtual member. - * \param[in] Value of the load increment for nonlinear structural analysis - */ - virtual void SetLoad_Increment(su2double val_loadIncrement); - - /*! - * \brief A virtual member. - * \param[in] Value of the load increment for nonlinear structural analysis - */ - virtual su2double GetLoad_Increment(void) const; - - /*! - * \brief A virtual member. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. - */ - virtual unsigned long SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output); - - /*! - * \brief A virtual member. - * \param[in] Value of freestream pressure. - */ - virtual void SetPressure_Inf(su2double p_inf); - - /*! - * \brief A virtual member. - * \param[in] Value of freestream temperature. - */ - virtual void SetTemperature_Inf(su2double t_inf); - - /*! - * \brief A virtual member. - * \param[in] Value of freestream density. - */ - virtual void SetDensity_Inf(su2double rho_inf); - - /*! - * \brief A virtual member. - * \param[in] val_dim - Index of the velocity vector. - * \param[in] val_velocity - Value of the velocity. - */ - virtual void SetVelocity_Inf(unsigned short val_dim, su2double val_velocity); - - /*! - * \brief A virtual member. - * \param[in] kind_recording - Kind of AD recording. - */ - virtual void SetRecording(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] kind_recording - Kind of AD recording. - */ - virtual void SetMesh_Recording(CGeometry **geometry, CVolumetricMovement *grid_movement, - CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reset - If true reset variables to their initial values. - */ - virtual void RegisterVariables(CGeometry *geometry, CConfig *config, bool reset = false); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetFreeStream_Solution(CConfig *config); - - /*! - * \brief A virtual member. - */ - virtual su2double* GetVecSolDOFs(void); - - /*! - * \brief A virtual member. - */ - virtual unsigned long GetnDOFsGlobal(void); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetTauWall_WF(CGeometry *geometry, CSolver** solver_container, CConfig* config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetNuTilde_WF(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - virtual void InitTurboContainers(CGeometry *geometry, CConfig *config); - - /*! - * \brief virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the average is evaluated. - */ - virtual void PreprocessAverage(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag); - - - /*! - * \brief virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the average is evaluated. - */ - virtual void TurboAverageProcess(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag); - - /*! - * \brief virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - */ - virtual void GatherInOutAverageValues(CConfig *config, CGeometry *geometry); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Density on the surface val_marker. - */ - virtual su2double GetAverageDensity(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Pressure on the surface val_marker. - */ - virtual su2double GetAveragePressure(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Total Pressure on the surface val_marker. - */ - virtual su2double* GetAverageTurboVelocity(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Nu on the surface val_marker. - */ - virtual su2double GetAverageNu(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Kine on the surface val_marker. - */ - virtual su2double GetAverageKine(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Omega on the surface val_marker. - */ - virtual su2double GetAverageOmega(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Nu on the surface val_marker. - */ - virtual su2double GetExtAverageNu(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Kine on the surface val_marker. - */ - virtual su2double GetExtAverageKine(unsigned short valMarker, unsigned short iSpan); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Omega on the surface val_marker. - */ - virtual su2double GetExtAverageOmega(unsigned short valMarker, unsigned short iSpan); - - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Density on the surface val_marker. - */ - virtual void SetExtAverageDensity(unsigned short valMarker, unsigned short valSpan, su2double valDensity); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Pressure on the surface val_marker. - */ - virtual void SetExtAveragePressure(unsigned short valMarker, unsigned short valSpan, su2double valPressure); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Total Pressure on the surface val_marker. - */ - virtual void SetExtAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan, unsigned short valIndex, su2double valTurboVelocity); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Nu on the surface val_marker. - */ - virtual void SetExtAverageNu(unsigned short valMarker, unsigned short valSpan, su2double valNu); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Kine on the surface val_marker. - */ - virtual void SetExtAverageKine(unsigned short valMarker, unsigned short valSpan, su2double valKine); - - /*! - * \brief A virtual member. - * \param[in] val_marker - bound marker. - * \return Value of the Average Omega on the surface val_marker. - */ - virtual void SetExtAverageOmega(unsigned short valMarker, unsigned short valSpan, su2double valOmega); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetDensityIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of inlet pressure. - */ - virtual su2double GetPressureIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet normal velocity. - */ - virtual su2double* GetTurboVelocityIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet density. - */ - virtual su2double GetDensityOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet pressure. - */ - virtual su2double GetPressureOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet normal velocity. - */ - virtual su2double* GetTurboVelocityOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetKineIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetOmegaIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetNuIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetKineOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetOmegaOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - virtual su2double GetNuOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetDensityIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetPressureIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetTurboVelocityIn(su2double* value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetDensityOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetPressureOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetTurboVelocityOut(su2double* value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetKineIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetOmegaIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetNuIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetKineOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetOmegaOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - virtual void SetNuOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetFreeStream_TurboSolution(CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - */ - virtual void SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetRoe_Dissipation(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] solver - Solver container - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - virtual void SetDES_LengthScale(CSolver** solver, CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - * \param[in] referenceCoord - Determine if the mesh is deformed from the reference or from the current coordinates. - */ - virtual void DeformMesh(CGeometry **geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - * \param[in] referenceCoord - Determine if the mesh is deformed from the reference or from the current coordinates. - */ - virtual void SetMesh_Stiffness(CGeometry **geometry, CNumerics **numerics, CConfig *config); - - /*! - * \brief Routine that sets the flag controlling implicit treatment for periodic BCs. - * \param[in] val_implicit_periodic - Flag controlling implicit treatment for periodic BCs. - */ - void SetImplicitPeriodic(bool val_implicit_periodic); - - /*! - * \brief Routine that sets the flag controlling solution rotation for periodic BCs. - * \param[in] val_implicit_periodic - Flag controlling solution rotation for periodic BCs. - */ - void SetRotatePeriodic(bool val_rotate_periodic); - - /*! - * \brief Retrieve the solver name for output purposes. - * \param[out] val_solvername - Name of the solver. - */ - string GetSolverName(void); - - /*! - * \brief Get the solution fields. - * \return A vector containing the solution fields. - */ - vector GetSolutionFields(); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - virtual void ComputeVerificationError(CGeometry *geometry, CConfig *config); - - /*! - * \brief Initialize the vertex traction containers at the vertices. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - - inline void InitVertexTractionContainer(CGeometry *geometry, CConfig *config){ - - unsigned long iVertex; - unsigned short iMarker; - - VertexTraction = new su2double** [nMarker]; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - VertexTraction[iMarker] = new su2double* [geometry->nVertex[iMarker]]; - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - VertexTraction[iMarker][iVertex] = new su2double [nDim](); - } - } - } - - /*! - * \brief Initialize the adjoint vertex traction containers at the vertices. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - - inline void InitVertexTractionAdjointContainer(CGeometry *geometry, CConfig *config){ - - unsigned long iVertex; - unsigned short iMarker; - - VertexTractionAdjoint = new su2double** [nMarker]; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - VertexTractionAdjoint[iMarker] = new su2double* [geometry->nVertex[iMarker]]; - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - VertexTractionAdjoint[iMarker][iVertex] = new su2double [nDim](); - } - } - } - - /*! - * \brief Compute the tractions at the vertices. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void ComputeVertexTractions(CGeometry *geometry, CConfig *config); - - /*! - * \brief Set the adjoints of the vertex tractions. - * \param[in] iMarker - Index of the marker - * \param[in] iVertex - Index of the relevant vertex - * \param[in] iDim - Dimension - */ - inline su2double GetVertexTractions(unsigned short iMarker, unsigned long iVertex, - unsigned short iDim){ return VertexTraction[iMarker][iVertex][iDim]; } - - /*! - * \brief Register the vertex tractions as output. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void RegisterVertexTractions(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the adjoints of the vertex tractions. - * \param[in] iMarker - Index of the marker - * \param[in] iVertex - Index of the relevant vertex - * \param[in] iDim - Dimension - * \param[in] val_adjoint - Value received for the adjoint (from another solver) - */ - inline void StoreVertexTractionsAdjoint(unsigned short iMarker, unsigned long iVertex, - unsigned short iDim, su2double val_adjoint){ - VertexTractionAdjoint[iMarker][iVertex][iDim] = val_adjoint; - } - - /*! - * \brief Set the adjoints of the vertex tractions to the AD structure. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config); - - /*! - * \brief Get minimun volume in the mesh - * \return - */ - virtual su2double GetMinimum_Volume() const { return 0.0; } - - /*! - * \brief Get maximum volume in the mesh - * \return - */ - virtual su2double GetMaximum_Volume() const { return 0.0; } - -protected: - /*! - * \brief Allocate the memory for the verification solution, if necessary. - * \param[in] nDim - Number of dimensions of the problem. - * \param[in] nVar - Number of variables of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetVerificationSolution(unsigned short nDim, - unsigned short nVar, - CConfig *config); -}; - -/*! - * \class CBaselineSolver - * \brief Main class for defining a baseline solution from a restart file (for output). - * \author F. Palacios, T. Economon. - */ -class CBaselineSolver final : public CSolver { -protected: - - CBaselineVariable* nodes = nullptr; /*!< \brief Variables of the baseline solver. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CBaselineSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CBaselineSolver(CGeometry *geometry, CConfig *config); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] nVar - Number of variables. - * \param[in] field_names - Vector of variable names. - */ - CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned short val_nvar, vector field_names); - - /*! - * \brief Destructor of the class. - */ - virtual ~CBaselineSolver(void); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Load a FSI solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - */ - void LoadRestart_FSI(CGeometry *geometry, CConfig *config, int val_iter); - - /*! - * \brief Set the number of variables and string names from the restart file. - * \param[in] config - Definition of the particular problem. - */ - void SetOutputVariables(CGeometry *geometry, CConfig *config); - -}; - -/*! - * \class CBaselineSolver_FEM - * \brief Main class for defining a baseline solution from a restart file for the DG-FEM solver output. - * \author T. Economon. - * \version 7.0.0 "Blackbird" - */ -class CBaselineSolver_FEM : public CSolver { -protected: - - unsigned long nDOFsLocTot; /*!< \brief Total number of local DOFs, including halos. */ - unsigned long nDOFsLocOwned; /*!< \brief Number of owned local DOFs. */ - unsigned long nDOFsGlobal; /*!< \brief Number of global DOFs. */ - - unsigned long nVolElemTot; /*!< \brief Total number of local volume elements, including halos. */ - unsigned long nVolElemOwned; /*!< \brief Number of owned local volume elements. */ - CVolumeElementFEM *volElem; /*!< \brief Array of the local volume elements, including halos. */ - - vector VecSolDOFs; /*!< \brief Vector, which stores the solution variables in all the DOFs. */ - - CVariable* GetBaseClassPointerToNodes() {return nullptr;} - -public: - - /*! - * \brief Constructor of the class. - */ - CBaselineSolver_FEM(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CBaselineSolver_FEM(CGeometry *geometry, CConfig *config); - - /*! - * \brief Destructor of the class. - */ - virtual ~CBaselineSolver_FEM(void); - - /*! - * \brief Set the number of variables and string names from the restart file. - * \param[in] config - Definition of the particular problem. - */ - void SetOutputVariables(CGeometry *geometry, CConfig *config); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Get a pointer to the vector of the solution degrees of freedom. - * \return Pointer to the vector of the solution degrees of freedom. - */ - su2double* GetVecSolDOFs(void); - -}; - -/*! - * \class CEulerSolver - * \brief Main class for defining the Euler's flow solver. - * \ingroup Euler_Equations - * \author F. Palacios - */ -class CEulerSolver : public CSolver { -protected: - - su2double - Mach_Inf, /*!< \brief Mach number at the infinity. */ - Density_Inf, /*!< \brief Density at the infinity. */ - Energy_Inf, /*!< \brief Energy at the infinity. */ - Temperature_Inf, /*!< \brief Energy at the infinity. */ - Pressure_Inf, /*!< \brief Pressure at the infinity. */ - *Velocity_Inf; /*!< \brief Flow Velocity vector at the infinity. */ - - su2double - *CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each boundary. */ - *CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each boundary. */ - *CSF_Inv, /*!< \brief Sideforce coefficient (inviscid contribution) for each boundary. */ - *CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CoPx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CoPy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CoPz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each boundary. */ - *CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each boundary. */ - *CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each boundary. */ - *Surface_CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CSF_Inv, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CEff_Inv, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each monitoring surface. */ - *CEff_Inv, /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each boundary. */ - *CMerit_Inv, /*!< \brief Rotor Figure of Merit (inviscid contribution) for each boundary. */ - *CT_Inv, /*!< \brief Thrust coefficient (force in -x direction, inviscid contribution) for each boundary. */ - *CQ_Inv, /*!< \brief Torque coefficient (moment in -x direction, inviscid contribution) for each boundary. */ - *CEquivArea_Inv, /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ - *CNearFieldOF_Inv, /*!< \brief Near field pressure (inviscid contribution) for each boundary. */ - *CD_Mnt, /*!< \brief Drag coefficient (inviscid contribution) for each boundary. */ - *CL_Mnt, /*!< \brief Lift coefficient (inviscid contribution) for each boundary. */ - *CSF_Mnt, /*!< \brief Sideforce coefficient (inviscid contribution) for each boundary. */ - *CMx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CMy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CMz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CoPx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CoPy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CoPz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CFx_Mnt, /*!< \brief x Force coefficient (inviscid contribution) for each boundary. */ - *CFy_Mnt, /*!< \brief y Force coefficient (inviscid contribution) for each boundary. */ - *CFz_Mnt, /*!< \brief z Force coefficient (inviscid contribution) for each boundary. */ - *Surface_CL_Mnt, /*!< \brief Lift coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CD_Mnt, /*!< \brief Drag coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CSF_Mnt, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CEff_Mnt, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFx_Mnt, /*!< \brief x Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFy_Mnt, /*!< \brief y Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFz_Mnt, /*!< \brief z Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each monitoring surface. */ - *CEff_Mnt, /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each boundary. */ - *CMerit_Mnt, /*!< \brief Rotor Figure of Merit (inviscid contribution) for each boundary. */ - *CT_Mnt, /*!< \brief Thrust coefficient (force in -x direction, inviscid contribution) for each boundary. */ - *CQ_Mnt, /*!< \brief Torque coefficient (moment in -x direction, inviscid contribution) for each boundary. */ - *CEquivArea_Mnt, /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ - **CPressure, /*!< \brief Pressure coefficient for each boundary and vertex. */ - **CPressureTarget, /*!< \brief Target Pressure coefficient for each boundary and vertex. */ - **HeatFlux, /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - **HeatFluxTarget, /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - **YPlus, /*!< \brief Yplus for each boundary and vertex. */ - ***CharacPrimVar, /*!< \brief Value of the characteristic variables at each boundary. */ - ***DonorPrimVar, /*!< \brief Value of the donor variables at each boundary. */ - *ForceInviscid, /*!< \brief Inviscid force for each boundary. */ - *MomentInviscid, /*!< \brief Inviscid moment for each boundary. */ - *ForceMomentum, /*!< \brief Inviscid force for each boundary. */ - *MomentMomentum; /*!< \brief Inviscid moment for each boundary. */ - su2double - *Inflow_MassFlow, /*!< \brief Mass flow rate for each boundary. */ - *Exhaust_MassFlow, /*!< \brief Mass flow rate for each boundary. */ - *Inflow_Pressure, /*!< \brief Fan face pressure for each boundary. */ - *Inflow_Mach, /*!< \brief Fan face mach number for each boundary. */ - *Inflow_Area, /*!< \brief Boundary total area. */ - *Exhaust_Area, /*!< \brief Boundary total area. */ - *Exhaust_Pressure, /*!< \brief Fan face pressure for each boundary. */ - *Exhaust_Temperature, /*!< \brief Fan face mach number for each boundary. */ - Inflow_MassFlow_Total, /*!< \brief Mass flow rate for each boundary. */ - Exhaust_MassFlow_Total, /*!< \brief Mass flow rate for each boundary. */ - Inflow_Pressure_Total, /*!< \brief Fan face pressure for each boundary. */ - Inflow_Mach_Total, /*!< \brief Fan face mach number for each boundary. */ - InverseDesign; /*!< \brief Inverse design functional for each boundary. */ - unsigned long - **DonorGlobalIndex; /*!< \brief Value of the donor global index. */ - su2double - **ActDisk_DeltaP, /*!< \brief Value of the Delta P. */ - **ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ - su2double - **Inlet_Ptotal, /*!< \brief Value of the Total P. */ - **Inlet_Ttotal, /*!< \brief Value of the Total T. */ - ***Inlet_FlowDir; /*!< \brief Value of the Flow Direction. */ - - su2double - AllBound_CD_Inv, /*!< \brief Total drag coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CL_Inv, /*!< \brief Total lift coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CSF_Inv, /*!< \brief Total sideforce coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMx_Inv, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Inv, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Inv, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Inv, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Inv, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Inv, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFx_Inv, /*!< \brief Total x force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Inv, /*!< \brief Total y force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Inv, /*!< \brief Total z force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Inv, /*!< \brief Efficient coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Inv, /*!< \brief Rotor Figure of Merit (inviscid contribution) for all the boundaries. */ - AllBound_CT_Inv, /*!< \brief Total thrust coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CQ_Inv, /*!< \brief Total torque coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEquivArea_Inv, /*!< \brief equivalent area coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CNearFieldOF_Inv; /*!< \brief Near-Field press coefficient (inviscid contribution) for all the boundaries. */ - - su2double - AllBound_CD_Mnt, /*!< \brief Total drag coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CL_Mnt, /*!< \brief Total lift coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CSF_Mnt, /*!< \brief Total sideforce coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMx_Mnt, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Mnt, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Mnt, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Mnt, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Mnt, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Mnt, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFx_Mnt, /*!< \brief Total x force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Mnt, /*!< \brief Total y force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Mnt, /*!< \brief Total z force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Mnt, /*!< \brief Efficient coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Mnt, /*!< \brief Rotor Figure of Merit (inviscid contribution) for all the boundaries. */ - AllBound_CT_Mnt, /*!< \brief Total thrust coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CQ_Mnt; /*!< \brief Total torque coefficient (inviscid contribution) for all the boundaries. */ - - su2double - Total_ComboObj, /*!< \brief Total 'combo' objective for all monitored boundaries */ - Total_CD, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_CL, /*!< \brief Total lift coefficient for all the boundaries. */ - Total_CL_Prev, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */ - Total_SolidCD, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_CD_Prev, /*!< \brief Total drag coefficient for all the boundaries (fixed lift mode). */ - Total_NetThrust, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_Power, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_ReverseFlow, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_IDC, /*!< \brief Total IDC coefficient for all the boundaries. */ - Total_IDC_Mach, /*!< \brief Total IDC coefficient for all the boundaries. */ - Total_IDR, /*!< \brief Total IDC coefficient for all the boundaries. */ - Total_DC60, /*!< \brief Total IDC coefficient for all the boundaries. */ - Total_MFR, /*!< \brief Total Mass Flow Ratio for all the boundaries. */ - Total_Prop_Eff, /*!< \brief Total Mass Flow Ratio for all the boundaries. */ - Total_ByPassProp_Eff, /*!< \brief Total Mass Flow Ratio for all the boundaries. */ - Total_Adiab_Eff, /*!< \brief Total Mass Flow Ratio for all the boundaries. */ - Total_Poly_Eff, /*!< \brief Total Mass Flow Ratio for all the boundaries. */ - Total_Custom_ObjFunc, /*!< \brief Total custom objective function for all the boundaries. */ - Total_CSF, /*!< \brief Total sideforce coefficient for all the boundaries. */ - Total_CMx, /*!< \brief Total x moment coefficient for all the boundaries. */ - Total_CMx_Prev, /*!< \brief Total drag coefficient for all the boundaries (fixed lift mode). */ - Total_CMy, /*!< \brief Total y moment coefficient for all the boundaries. */ - Total_CMy_Prev, /*!< \brief Total drag coefficient for all the boundaries (fixed lift mode). */ - Total_CMz, /*!< \brief Total z moment coefficient for all the boundaries. */ - Total_CMz_Prev, /*!< \brief Total drag coefficient for all the boundaries (fixed lift mode). */ - Total_CoPx, /*!< \brief Total x moment coefficient for all the boundaries. */ - Total_CoPy, /*!< \brief Total y moment coefficient for all the boundaries. */ - Total_CoPz, /*!< \brief Total z moment coefficient for all the boundaries. */ - Total_CFx, /*!< \brief Total x force coefficient for all the boundaries. */ - Total_CFy, /*!< \brief Total y force coefficient for all the boundaries. */ - Total_CFz, /*!< \brief Total z force coefficient for all the boundaries. */ - Total_CEff, /*!< \brief Total efficiency coefficient for all the boundaries. */ - Total_CMerit, /*!< \brief Total rotor Figure of Merit for all the boundaries. */ - Total_CT, /*!< \brief Total thrust coefficient for all the boundaries. */ - Total_CQ, /*!< \brief Total torque coefficient for all the boundaries. */ - Total_Heat, /*!< \brief Total heat load for all the boundaries. */ - Total_MaxHeat, /*!< \brief Maximum heat flux on all boundaries. */ - Total_AeroCD, /*!< \brief Total aero drag coefficient for all the boundaries. */ - Total_CEquivArea, /*!< \brief Total Equivalent Area coefficient for all the boundaries. */ - Total_CNearFieldOF, /*!< \brief Total Near-Field Pressure coefficient for all the boundaries. */ - Total_CpDiff, /*!< \brief Total Equivalent Area coefficient for all the boundaries. */ - Total_HeatFluxDiff, /*!< \brief Total Equivalent Area coefficient for all the boundaries. */ - Total_MassFlowRate; /*!< \brief Total Mass Flow Rate on monitored boundaries. */ - su2double - *Surface_CL, /*!< \brief Lift coefficient for each monitoring surface. */ - *Surface_CD, /*!< \brief Drag coefficient for each monitoring surface. */ - *Surface_CSF, /*!< \brief Side-force coefficient for each monitoring surface. */ - *Surface_CEff, /*!< \brief Side-force coefficient for each monitoring surface. */ - *Surface_CFx, /*!< \brief x Force coefficient for each monitoring surface. */ - *Surface_CFy, /*!< \brief y Force coefficient for each monitoring surface. */ - *Surface_CFz, /*!< \brief z Force coefficient for each monitoring surface. */ - *Surface_CMx, /*!< \brief x Moment coefficient for each monitoring surface. */ - *Surface_CMy, /*!< \brief y Moment coefficient for each monitoring surface. */ - *Surface_CMz, /*!< \brief z Moment coefficient for each monitoring surface. */ - *Surface_HF_Visc, /*!< \brief Total (integrated) heat flux for each monitored surface. */ - *Surface_MaxHF_Visc; /*!< \brief Maximum heat flux for each monitored surface. */ - - su2double - *SecondaryVar_i, /*!< \brief Auxiliary vector for storing the solution at point i. */ - *SecondaryVar_j; /*!< \brief Auxiliary vector for storing the solution at point j. */ - su2double - *PrimVar_i, /*!< \brief Auxiliary vector for storing the solution at point i. */ - *PrimVar_j; /*!< \brief Auxiliary vector for storing the solution at point j. */ - su2double **LowMach_Precontioner; /*!< \brief Auxiliary vector for storing the inverse of Roe-turkel preconditioner. */ - bool space_centered, /*!< \brief True if space centered scheeme used. */ - euler_implicit, /*!< \brief True if euler implicit scheme used. */ - least_squares; /*!< \brief True if computing gradients by least squares. */ - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - - su2double *Primitive, /*!< \brief Auxiliary nPrimVar vector. */ - *Primitive_i, /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point i. */ - *Primitive_j; /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point j. */ - - su2double *Secondary, /*!< \brief Auxiliary nPrimVar vector. */ - *Secondary_i, /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point i. */ - *Secondary_j; /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point j. */ - - su2double AoA_Prev, /*!< \brief Old value of the angle of attack (monitored). */ - AoA_inc; - bool Start_AoA_FD, /*!< \brief Boolean for start of finite differencing for FixedCL mode */ - End_AoA_FD, /*!< \brief Boolean for end of finite differencing for FixedCL mode */ - Update_AoA; /*!< \brief Boolean to signal Angle of Attack Update */ - unsigned long Iter_Update_AoA; /*!< \brief Iteration at which AoA was updated last */ - su2double dCL_dAlpha; /*!< \brief Value of dCL_dAlpha used to control CL in fixed CL mode */ - unsigned long BCThrust_Counter; - unsigned short nSpanWiseSections; /*!< \brief Number of span-wise sections. */ - unsigned short nSpanMax; /*!< \brief Max number of maximum span-wise sections for all zones */ - unsigned short nMarkerTurboPerf; /*!< \brief Number of turbo performance. */ - - CFluidModel *FluidModel; /*!< \brief fluid model used in the solver */ - - /*--- Turbomachinery Solver Variables ---*/ - su2double *** AverageFlux, - ***SpanTotalFlux, - ***AverageVelocity, - ***AverageTurboVelocity, - ***OldAverageTurboVelocity, - ***ExtAverageTurboVelocity, - **AveragePressure, - **OldAveragePressure, - **RadialEquilibriumPressure, - **ExtAveragePressure, - **AverageDensity, - **OldAverageDensity, - **ExtAverageDensity, - **AverageNu, - **AverageKine, - **AverageOmega, - **ExtAverageNu, - **ExtAverageKine, - **ExtAverageOmega; - - su2double **DensityIn, - **PressureIn, - ***TurboVelocityIn, - **DensityOut, - **PressureOut, - ***TurboVelocityOut, - **KineIn, - **OmegaIn, - **NuIn, - **KineOut, - **OmegaOut, - **NuOut; - - complex ***CkInflow, - ***CkOutflow1, - ***CkOutflow2; - - /*--- End of Turbomachinery Solver Variables ---*/ - - /* Sliding meshes variables */ - - su2double ****SlidingState; - int **SlidingStateNodes; - - CEulerVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - - /*! - * \brief Constructor of the class. - */ - CEulerSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - virtual ~CEulerSolver(void); - - /*! - * \brief Set the solver nondimensionalization. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void SetNondimensionalization(CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - CFluidModel* GetFluidModel(void); - - /*! - * \brief Compute the density at the infinity. - * \return Value of the density at the infinity. - */ - su2double GetDensity_Inf(void); - - /*! - * \brief Compute 2-norm of the velocity at the infinity. - * \return Value of the 2-norm of the velocity at the infinity. - */ - su2double GetModVelocity_Inf(void); - - /*! - * \brief Compute the density multiply by energy at the infinity. - * \return Value of the density multiply by energy at the infinity. - */ - su2double GetDensity_Energy_Inf(void); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - su2double GetPressure_Inf(void); - - /*! - * \brief Compute the density multiply by velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the density multiply by the velocity at the infinity. - */ - su2double GetDensity_Velocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the velocity at the infinity. - */ - su2double GetVelocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \return Value of the velocity at the infinity. - */ - su2double *GetVelocity_Inf(void); - - /*! - * \brief Compute the time step for solving the Euler equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Value of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Compute the spatial integration using a centered scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the extrapolated quantities, for MUSCL upwind 2nd reconstruction, - * in a more thermodynamic consistent way - * \param[in] config - Definition of the particular problem. - */ - void ComputeConsExtrapolation(CConfig *config); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute primitive variables and their gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. - * \return - The number of non-physical points. - */ - unsigned long SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output); - - /*! - * \brief Compute a pressure sensor switch. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute Ducros Sensor for Roe Dissipation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetUpwind_Ducros_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the gradient of the primitive variables using Green-Gauss method, - * and stores the result in the Gradient_Primitive variable. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetPrimitive_Gradient_GG(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the gradient of the primitive variables using a Least-Squares method, - * and stores the result in the Gradient_Primitive variable. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the limiter of the primitive variables. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetPrimitive_Limiter(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the preconditioner for convergence acceleration by Roe-Turkel method. - * \param[in] iPoint - Index of the grid point - * \param[in] config - Definition of the particular problem. - */ - void SetPreconditioner(CConfig *config, unsigned long iPoint); - - /*! - * \brief Compute the undivided laplacian for the solution, except the energy equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the max eigenvalue. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetMax_Eigenvalue(CGeometry *geometry, CConfig *config); - - /*! - * \brief Parallelization of Undivided Laplacian. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config); - - /*! - * \brief Parallelization of Undivided Laplacian. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Set_MPI_Nearfield(CGeometry *geometry, CConfig *config); - - /*! - * \author H. Kline - * \brief Compute weighted-sum "combo" objective output - * \param[in] config - Definition of the particular problem. - */ - void Evaluate_ObjFunc(CConfig *config); - - /*! - * \author: T. Kattmann - * - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the far-field boundary condition using characteristics. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the symmetry boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the interface state across sliding meshes. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); - - /*! - * \brief Impose the engine inflow boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the engine exhaust boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the engine inflow boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface); - - /*! - * \brief Impose the interface boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Interface_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the near-field boundary condition using the residual. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose a periodic boundary condition by summing contributions from the complete control volume. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Periodic(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config); - - /*! - * \brief Impose the dirichlet boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Dirichlet(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short val_marker); - - /*! - * \author: G.Gori, S.Vitale, M.Pini, A.Guardone, P.Colonna - * - * \brief Impose the boundary condition using characteristic recostruction. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Riemann(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - - /*! - * \brief Impose the boundary condition using characteristic recostruction. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_TurboRiemann(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief It computes Fourier transformation for the needed quantities along the pitch for each span in turbomachinery analysis. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] marker_flag - Surface marker flag where the function is applied. - */ - void PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNumerics *conv_numerics, unsigned short marker_flag); - - /*! - * \author: G.Gori, S.Vitale, M.Pini, A.Guardone, P.Colonna - * - * \brief Impose the boundary condition using characteristic recostruction. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Giles(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - - /*! - * \brief Impose a subsonic inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose a supersonic inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose a supersonic outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose a custom or verification boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the convective numerical method. - * \param[in] visc_numerics - Description of the viscous numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the nacelle inflow boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the ancelle exhaust boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Set the new solution variables to the current solution value for classical RK. - * \param[in] geometry - Geometrical definition of the problem. - */ - void Set_NewSolution(CGeometry *geometry); - - /*! - * \brief Update the solution using a Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using the classical fourth-order Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Compute the Fan face Mach number. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solution - Container vector with all the solutions. - */ - void GetPower_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief Update the AoA and freestream velocity at the farfield. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - void SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief Update the AoA and freestream velocity at the farfield. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - void SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief Check for convergence of the Fixed CL mode to the target CL - * \param[in] config - Definition of the particular problem. - * \param[in] convergence - boolean for whether the solution is converged - * \return boolean for whether the Fixed CL mode is converged to target CL - */ - bool FixedCL_Convergence(CConfig *config, bool convergence); - - /*! - * \brief Checking whether fixed CL mode in finite-differencing mode - * \return boolean for whether the Fixed CL mode is currently in finite-differencing mode - */ - bool GetStart_AoA_FD(void); - - /*! - * \brief Checking whether fixed CL mode in finite-differencing mode - * \return boolean for whether the Fixed CL mode is currently in finite-differencing mode - */ - bool GetEnd_AoA_FD(void); - - /*! - * \brief Get the iteration of the last AoA update (Fixed CL Mode) - * \return value for the last iteration that the AoA was updated - */ - unsigned long GetIter_Update_AoA(); - - /*! - * \brief Get the AoA before the most recent update - * \return value of the AoA before most recent update - */ - su2double GetPrevious_AoA(); - - /*! - * \brief Get the CL Driver's control command - * \return value of CL Driver control command (AoA_inc) - */ - su2double GetAoA_inc(); - - /*! - * \brief Set gradients of coefficients for fixed CL mode - * \param[in] config - Definition of the particular problem. - */ - void SetCoefficient_Gradients(CConfig *config); - - /*! - * \brief Update the solution using the explicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Update the solution using an implicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear iteration for stability. - * \param[in] solver - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ComputeUnderRelaxationFactor(CSolver **solver, CConfig *config); - - /*! - * \brief Compute the pressure forces and all the adimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Pressure_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the pressure forces and all the adimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Momentum_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute turbomachinery performance. - * \param[in] solver - solver containing the outlet information. - * \param[in] inMarker - marker related to the inlet. - * \param[in] outMarker - marker related to the outlet. - */ - void TurboPerformance(CSolver *solver, CConfig *config, unsigned short inMarker, unsigned short outMarker, unsigned short Kind_TurboPerf , unsigned short inMarkerTP ); - - /*! - * \brief Compute turbomachinery performance. - * \param[in] solver - solver containing the outlet information. - * \param[in] inMarker - marker related to the inlet. - * \param[in] outMarker - marker related to the outlet. - */ - void StoreTurboPerformance(CSolver *solver, unsigned short inMarkerTP ); - - /*! - * \brief Get the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - */ - su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index); - - /*! - * \brief Provide the non dimensional lift coefficient (inviscid contribution). - * \param val_marker Surface where the coefficient is going to be computed. - * \return Value of the lift coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCL_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the drag coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the mass flow rate. - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the mass flow rate on the surface val_marker. - */ - su2double GetInflow_MassFlow(unsigned short val_marker); - - /*! - * \brief Provide the mass flow rate. - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the mass flow rate on the surface val_marker. - */ - su2double GetExhaust_MassFlow(unsigned short val_marker); - - /*! - * \brief Provide the mass flow rate. - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the fan face pressure on the surface val_marker. - */ - su2double GetInflow_Pressure(unsigned short val_marker); - - /*! - * \brief Provide the mass flow rate. - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the fan face mach on the surface val_marker. - */ - su2double GetInflow_Mach(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional sideforce coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the sideforce coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional efficiency coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the efficiency coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CSF(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CEff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Equivalent Area coefficient. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CEquivArea(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional aero CD. - * \return Value of the Aero CD coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_AeroCD(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Equivalent Area coefficient. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CpDiff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Equivalent Area coefficient. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_HeatFluxDiff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Near-Field pressure coefficient. - * \return Value of the NearField pressure coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CNearFieldOF(void); - - /*! - * \author H. Kline - * \brief Add to the value of the total 'combo' objective. - * \param[in] val_obj - Value of the contribution to the 'combo' objective. - */ - void AddTotal_ComboObj(su2double val_obj); - - /*! - * \brief Set the value of the Equivalent Area coefficient. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - void SetTotal_CEquivArea(su2double val_cequivarea); - - /*! - * \brief Set the value of the Aero drag. - * \param[in] val_cequivarea - Value of the aero drag. - */ - void SetTotal_AeroCD(su2double val_aerocd); - - /*! - * \brief Set the value of the Equivalent Area coefficient. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - void SetTotal_CpDiff(su2double val_pressure); - - /*! - * \brief Set the value of the Equivalent Area coefficient. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - void SetTotal_HeatFluxDiff(su2double val_heat); - - /*! - * \brief Set the value of the Near-Field pressure oefficient. - * \param[in] val_cnearfieldpress - Value of the Near-Field pressure coefficient. - */ - void SetTotal_CNearFieldOF(su2double val_cnearfieldpress); - - /*! - * \author H. Kline - * \brief Set the total "combo" objective (weighted sum of other values). - * \param[in] ComboObj - Value of the combined objective. - */ - void SetTotal_ComboObj(su2double ComboObj); - - /*! - * \author H. Kline - * \brief Provide the total "combo" objective (weighted sum of other values). - * \return Value of the "combo" objective values. - */ - su2double GetTotal_ComboObj(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional lift coefficient. - * \return Value of the lift coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CL(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CD(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_NetThrust(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_Power(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_SolidCD(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_ReverseFlow(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_MFR(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_Prop_Eff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_ByPassProp_Eff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_Adiab_Eff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_Poly_Eff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_IDC(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_IDC_Mach(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_IDR(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_DC60(void); - - /*! - * \brief Provide the total custom objective function. - * \return Value of the custom objective function. - */ - su2double GetTotal_Custom_ObjFunc(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x moment coefficient. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y moment coefficient. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z moment coefficient. - * \return Value of the moment z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x moment coefficient. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y moment coefficient. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z moment coefficient. - * \return Value of the moment z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x force coefficient. - * \return Value of the force x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y force coefficient. - * \return Value of the force y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z force coefficient. - * \return Value of the force z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional thrust coefficient. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CT(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional thrust coefficient. - * \param[in] val_Total_CT - Value of the total thrust coefficient. - */ - void SetTotal_CT(su2double val_Total_CT); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional torque coefficient. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CQ(void); - - /*! - * \brief Provide the total heat load. - * \return Value of the heat load (viscous contribution). - */ - su2double GetTotal_HeatFlux(void); - - /*! - * \brief Provide the total heat load. - * \return Value of the heat load (viscous contribution). - */ - su2double GetTotal_MaxHeatFlux(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional torque coefficient. - * \param[in] val_Total_CQ - Value of the total torque coefficient. - */ - void SetTotal_CQ(su2double val_Total_CQ); - - /*! - * \brief Store the total heat load. - * \param[in] val_Total_Heat - Value of the heat load. - */ - void SetTotal_HeatFlux(su2double val_Total_Heat); - - /*! - * \brief Store the total heat load. - * \param[in] val_Total_Heat - Value of the heat load. - */ - void SetTotal_MaxHeatFlux(su2double val_Total_MaxHeat); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional rotor Figure of Merit. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMerit(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_CD(su2double val_Total_CD); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional lift coefficient. - * \param[in] val_Total_CL - Value of the total lift coefficient. - */ - void SetTotal_CL(su2double val_Total_CL); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_NetThrust(su2double val_Total_NetThrust); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_Power(su2double val_Total_Power); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_SolidCD(su2double val_Total_SolidCD); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_ReverseFlow(su2double val_ReverseFlow); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_MFR(su2double val_Total_MFR); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_Prop_Eff(su2double val_Total_Prop_Eff); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_ByPassProp_Eff(su2double val_Total_ByPassProp_Eff); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_Adiab_Eff(su2double val_Total_Adiab_Eff); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_Poly_Eff(su2double val_Total_Poly_Eff); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_IDC(su2double val_Total_IDC); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_IDC_Mach(su2double val_Total_IDC_Mach); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_IDR(su2double val_Total_IDR); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_DC60(su2double val_Total_DC60); - - /*! - * \brief Set the value of the custom objective function. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - void SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief Add the value of the custom objective function. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - void AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Inv(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Inv(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Mnt(void); - - /*! - * \brief Provide the Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetCPressure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Provide the Target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the value of the target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double *GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double *GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - unsigned long GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex, su2double val_deltap); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex, su2double val_deltat); - - /*! - * \brief Value of the total temperature at an inlet boundary. - * \param[in] val_marker - Surface marker where the total temperature is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total temperature is evaluated. - * \return Value of the total temperature - */ - su2double GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the total pressure at an inlet boundary. - * \param[in] val_marker - Surface marker where the total pressure is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total pressure is evaluated. - * \return Value of the total pressure - */ - su2double GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A component of the unit vector representing the flow direction at an inlet boundary. - * \param[in] val_marker - Surface marker where the flow direction is evaluated - * \param[in] val_vertex - Vertex of the marker val_marker where the flow direction is evaluated - * \param[in] val_dim - The component of the flow direction unit vector to be evaluated - * \return Component of a unit vector representing the flow direction. - */ - su2double GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief Set the value of the total temperature at an inlet boundary. - * \param[in] val_marker - Surface marker where the total temperature is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the total temperature is set. - * \param[in] val_ttotal - Value of the total temperature - */ - void SetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ttotal); - - /*! - * \brief Set the value of the total pressure at an inlet boundary. - * \param[in] val_marker - Surface marker where the total pressure is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the total pressure is set. - * \param[in] val_ptotal - Value of the total pressure - */ - void SetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ptotal); - - /*! - * \brief Set a component of the unit vector representing the flow direction at an inlet boundary. - * \param[in] val_marker - Surface marker where the flow direction is set. - * \param[in] val_vertex - Vertex of the marker val_marker where the flow direction is set. - * \param[in] val_dim - The component of the flow direction unit vector to be set - * \param[in] val_flowdir - Component of a unit vector representing the flow direction. - */ - void SetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_flowdir); - - /*! - * \brief Set a uniform inlet profile - * - * The values at the inlet are set to match the values specified for - * inlets in the configuration file. - * - * \param[in] config - Definition of the particular problem. - * \param[in] iMarker - Surface marker where the coefficient is computed. - */ - void SetUniformInlet(CConfig* config, unsigned short iMarker); - - /*! - * \brief Store of a set of provided inlet profile values at a vertex. - * \param[in] val_inlet - vector containing the inlet values for the current vertex. - * \param[in] iMarker - Surface marker where the coefficient is computed. - * \param[in] iVertex - Vertex of the marker iMarker where the inlet is being set. - */ - void SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the set of value imposed at an inlet. - * \param[in] val_inlet - vector returning the inlet values for the current vertex. - * \param[in] val_inlet_point - Node index where the inlet is being set. - * \param[in] val_kind_marker - Enumerated type for the particular inlet type. - * \param[in] geometry - Geometrical definition of the problem. - * \param config - Definition of the particular problem. - * \return Value of the face area at the vertex. - */ - su2double GetInletAtVertex(su2double *val_inlet, - unsigned long val_inlet_point, - unsigned short val_kind_marker, - string val_marker, - CGeometry *geometry, - CConfig *config); - - /*! - * \brief Update the multi-grid structure for the customized boundary conditions - * \param geometry_container - Geometrical definition. - * \param config - Definition of the particular problem. - */ - void UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config); - - /*! - * \brief Set the total residual adding the term that comes from the Dual Time Strategy. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Allocates the final pointer of SlidingState depending on how many donor vertex donate to it. That number is stored in SlidingStateNodes[val_marker][val_vertex]. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - * \param[in] donor_index - index of the donor node to set - * \param[in] component - set value - */ - void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component); - - /*! - * \brief Set the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] value - number of outer states - */ - void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value); - - /*! - * \brief Get the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the initial condition for the Euler Equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); - - /*! - * \brief Set the freestream pressure. - * \param[in] Value of freestream pressure. - */ - void SetPressure_Inf(su2double p_inf); - - /*! - * \brief Set the freestream temperature. - * \param[in] Value of freestream temperature. - */ - void SetTemperature_Inf(su2double t_inf); - - /*! - * \brief Set the solution using the Freestream values. - * \param[in] config - Definition of the particular problem. - */ - void SetFreeStream_Solution(CConfig *config); - - /*! - * \brief Initilize turbo containers. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void InitTurboContainers(CGeometry *geometry, CConfig *config); - - /*! - * \brief Set the solution using the Freestream values. - * \param[in] config - Definition of the particular problem. - */ - void SetFreeStream_TurboSolution(CConfig *config); - - /*! - * \brief It computes average quantities along the span for turbomachinery analysis. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] marker_flag - Surface marker flag where the function is applied. - */ - void PreprocessAverage(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag); - - /*! - * \brief It computes average quantities along the span for turbomachinery analysis. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] marker_flag - Surface marker flag where the function is applied. - */ - void TurboAverageProcess(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag); - - /*! - * \brief it performs a mixed out average of the nodes of a boundary. - * \param[in] val_init_pressure - initial pressure value - * \param[in] val_Averaged_Flux - flux averaged values. - * \param[in] val_normal - normal vector. - * \param[in] pressure_mix - value of the mixed-out avaraged pressure. - * \param[in] density_miz - value of the mixed-out avaraged density. - */ - void MixedOut_Average (CConfig *config, su2double val_init_pressure, const su2double *val_Averaged_Flux, - const su2double *val_normal, su2double& pressure_mix, su2double& density_mix); - - /*! - * \brief It gathers into the master node average quantities at inflow and outflow needed for turbomachinery analysis. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - */ - void GatherInOutAverageValues(CConfig *config, CGeometry *geometry); - - /*! - * \brief it take a velocity in the cartesian reference of framework and transform into the turbomachinery frame of reference. - * \param[in] cartesianVelocity - cartesian components of velocity vector. - * \param[in] turboNormal - normal vector in the turbomachinery frame of reference. - * \param[in] turboVelocity - velocity vector in the turbomachinery frame of reference. - */ - void ComputeTurboVelocity(const su2double *cartesianVelocity, const su2double *turboNormal, su2double *turboVelocity, - unsigned short marker_flag, unsigned short marker_kindturb); - - /*! - * \brief it take a velocity in the cartesian reference of framework and transform into the turbomachinery frame of reference. - * \param[in] cartesianVelocity - cartesian components of velocity vector. - * \param[in] turboNormal - normal vector in the turbomachinery frame of reference. - * \param[in] turboVelocity - velocity vector in the turbomachinery frame of reference. - */ - void ComputeBackVelocity(const su2double *turboVelocity, const su2double *turboNormal, su2double *cartesianVelocity, - unsigned short marker_flag, unsigned short marker_kindturb); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average Density on the surface val_marker. - */ - su2double GetAverageDensity(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average pressure at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average Pressure on the surface val_marker. - */ - su2double GetAveragePressure(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average turbo velocity average at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average Total Pressure on the surface val_marker. - */ - su2double* GetAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Nu on the surface val_marker. - */ - su2double GetAverageNu(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Kine on the surface val_marker. - */ - su2double GetAverageKine(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Omega on the surface val_marker. - */ - su2double GetAverageOmega(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Nu on the surface val_marker. - */ - su2double GetExtAverageNu(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Kine on the surface val_marker. - */ - su2double GetExtAverageKine(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Provide the average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average turbulent Omega on the surface val_marker. - */ - su2double GetExtAverageOmega(unsigned short valMarker, unsigned short valSpan); - - /*! - * \brief Set the external average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \param[in] val_Span - value of the Span. - * \param[in] valDensity - value to set. - */ - void SetExtAverageDensity(unsigned short valMarker, unsigned short valSpan, su2double valDensity); - - /*! - * \brief Set the external average density at the boundary of interest. - * \param[in] val_marker - bound marker. - * \param[in] val_Span - value of the Span. - * \param[in] valPressure - value to set. - */ - void SetExtAveragePressure(unsigned short valMarker, unsigned short valSpan, su2double valPressure); - - /*! - * \brief Set the external the average turbo velocity average at the boundary of interest. - * \param[in] val_marker - bound marker. - * \return Value of the Average Total Pressure on the surface val_marker. - */ - void SetExtAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan, unsigned short valIndex, su2double valTurboVelocity); - - /*! - * \brief Set the external average turbulent Nu at the boundary of interest. - * \param[in] val_marker - bound marker. - * \param[in] val_Span - value of the Span. - * \param[in] valNu - value to set. - */ - void SetExtAverageNu(unsigned short valMarker, unsigned short valSpan, su2double valNu); - - /*! - * \brief Set the external average turbulent Kine at the boundary of interest. - * \param[in] val_marker - bound marker. - * \param[in] val_Span - value of the Span. - * \param[in] valKine - value to set. - */ - void SetExtAverageKine(unsigned short valMarker, unsigned short valSpan, su2double valKine); - - /*! - * \brief Set the external average turbulent Omega at the boundary of interest. - * \param[in] val_marker - bound marker. - * \param[in] val_Span - value of the Span. - * \param[in] valOmega - value to set. - */ - void SetExtAverageOmega(unsigned short valMarker, unsigned short valSpan, su2double valOmega); - - /*! - * \brief Provide the inlet density to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetDensityIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the inlet pressure to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of inlet pressure. - */ - su2double GetPressureIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the inlet normal velocity to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet normal velocity. - */ - su2double* GetTurboVelocityIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet density to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet density. - */ - su2double GetDensityOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet pressure to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet pressure. - */ - su2double GetPressureOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet normal velocity to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the outlet normal velocity. - */ - su2double* GetTurboVelocityOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the inlet turbulent kei to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetKineIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the inlet turbulent omega to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetOmegaIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the inlet turbulent nu to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetNuIn(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet turbulent kei to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetKineOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet turbulent omega to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetOmegaOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Provide the outlet turbulent nu to check convergence of conservative mixing-plane. - * \param[in] inMarkerTP - bound marker. - * \return Value of the inlet density. - */ - su2double GetNuOut(unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set inlet density. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetDensityIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set inlet pressure. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetPressureIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set inlet normal velocity. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetTurboVelocityIn(su2double* value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set outlet density. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetDensityOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set outlet pressure. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetPressureOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set outlet normal velocity. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetTurboVelocityOut(su2double* value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set inlet turbulent kei. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetKineIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - /*! - * \brief Set inlet turbulent omega. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetOmegaIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - /*! - * \brief Set inlet turbulent Nu. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetNuIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Set outlet turbulent kei. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetKineOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - /*! - * \brief Set Outlet turbulent omega. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetOmegaOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - /*! - * \brief Set outlet turbulent Nu. - * \param[in] value - turboperformance value to set. - * \param[in] inMarkerTP - turboperformance marker. - */ - void SetNuOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan); - - /*! - * \brief Compute the global error measures (L2, Linf) for verification cases. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void ComputeVerificationError(CGeometry *geometry, CConfig *config); - -}; - -/*! - * \class CIncEulerSolver - * \brief Main class for defining the incompressible Euler flow solver. - * \ingroup Euler_Equations - * \author F. Palacios, T. Economon, T. Albring - */ -class CIncEulerSolver : public CSolver { -protected: - - su2double - Density_Inf, /*!< \brief Density at the infinity. */ - Pressure_Inf, /*!< \brief Pressure at the infinity. */ - *Velocity_Inf, /*!< \brief Flow Velocity vector at the infinity. */ - Temperature_Inf; /*!< \brief Temperature at infinity. */ - - su2double - *CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each boundary. */ - *CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each boundary. */ - *CSF_Inv, /*!< \brief Sideforce coefficient (inviscid contribution) for each boundary. */ - *CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CoPx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CoPy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CoPz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each boundary. */ - *CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each boundary. */ - *CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each boundary. */ - *Surface_CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CSF_Inv, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CEff_Inv, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each monitoring surface. */ - *CEff_Inv, /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each boundary. */ - *CMerit_Inv, /*!< \brief Rotor Figure of Merit (inviscid contribution) for each boundary. */ - *CT_Inv, /*!< \brief Thrust coefficient (force in -x direction, inviscid contribution) for each boundary. */ - *CQ_Inv, /*!< \brief Torque coefficient (moment in -x direction, inviscid contribution) for each boundary. */ - *CD_Mnt, /*!< \brief Drag coefficient (inviscid contribution) for each boundary. */ - *CL_Mnt, /*!< \brief Lift coefficient (inviscid contribution) for each boundary. */ - *CSF_Mnt, /*!< \brief Sideforce coefficient (inviscid contribution) for each boundary. */ - *CMx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CMy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CMz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CoPx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CoPy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CoPz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CFx_Mnt, /*!< \brief x Force coefficient (inviscid contribution) for each boundary. */ - *CFy_Mnt, /*!< \brief y Force coefficient (inviscid contribution) for each boundary. */ - *CFz_Mnt, /*!< \brief z Force coefficient (inviscid contribution) for each boundary. */ - *Surface_CL_Mnt, /*!< \brief Lift coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CD_Mnt, /*!< \brief Drag coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CSF_Mnt, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CEff_Mnt, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFx_Mnt, /*!< \brief x Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFy_Mnt, /*!< \brief y Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFz_Mnt, /*!< \brief z Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMx_Mnt, /*!< \brief x Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMy_Mnt, /*!< \brief y Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMz_Mnt, /*!< \brief z Moment coefficient (inviscid contribution) for each monitoring surface. */ - *CEff_Mnt, /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each boundary. */ - *CMerit_Mnt, /*!< \brief Rotor Figure of Merit (inviscid contribution) for each boundary. */ - *CT_Mnt, /*!< \brief Thrust coefficient (force in -x direction, inviscid contribution) for each boundary. */ - *CQ_Mnt, /*!< \brief Torque coefficient (moment in -x direction, inviscid contribution) for each boundary. */ - **CPressure, /*!< \brief Pressure coefficient for each boundary and vertex. */ - **CPressureTarget, /*!< \brief Target Pressure coefficient for each boundary and vertex. */ - **HeatFlux, /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - **HeatFluxTarget, /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - **YPlus, /*!< \brief Yplus for each boundary and vertex. */ - ***CharacPrimVar, /*!< \brief Value of the characteristic variables at each boundary. */ - *ForceInviscid, /*!< \brief Inviscid force for each boundary. */ - *MomentInviscid, /*!< \brief Inviscid moment for each boundary. */ - *ForceMomentum, /*!< \brief Inviscid force for each boundary. */ - *MomentMomentum, /*!< \brief Inviscid moment for each boundary. */ - InverseDesign; /*!< \brief Inverse design functional for each boundary. */ - su2double - **Inlet_Ptotal, /*!< \brief Value of the Total P. */ - **Inlet_Ttotal, /*!< \brief Value of the Total T. */ - ***Inlet_FlowDir; /*!< \brief Value of the Flow Direction. */ - - su2double - AllBound_CD_Inv, /*!< \brief Total drag coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CL_Inv, /*!< \brief Total lift coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CSF_Inv, /*!< \brief Total sideforce coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMx_Inv, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Inv, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Inv, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFx_Inv, /*!< \brief Total x force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Inv, /*!< \brief Total y force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Inv, /*!< \brief Total z force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Inv, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Inv, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Inv, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Inv, /*!< \brief Efficient coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Inv, /*!< \brief Rotor Figure of Merit (inviscid contribution) for all the boundaries. */ - AllBound_CT_Inv, /*!< \brief Total thrust coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CQ_Inv; /*!< \brief Total torque coefficient (inviscid contribution) for all the boundaries. */ - - - su2double - AllBound_CD_Mnt, /*!< \brief Total drag coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CL_Mnt, /*!< \brief Total lift coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CSF_Mnt, /*!< \brief Total sideforce coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMx_Mnt, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Mnt, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Mnt, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFx_Mnt, /*!< \brief Total x force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Mnt, /*!< \brief Total y force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Mnt, /*!< \brief Total z force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Mnt, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Mnt, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Mnt, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Mnt, /*!< \brief Efficient coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Mnt, /*!< \brief Rotor Figure of Merit (inviscid contribution) for all the boundaries. */ - AllBound_CT_Mnt, /*!< \brief Total thrust coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CQ_Mnt; /*!< \brief Total torque coefficient (inviscid contribution) for all the boundaries. */ - - su2double - Total_ComboObj, /*!< \brief Total 'combo' objective for all monitored boundaries */ - Total_CD, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_CL, /*!< \brief Total lift coefficient for all the boundaries. */ - Total_CSF, /*!< \brief Total sideforce coefficient for all the boundaries. */ - Total_CMx, /*!< \brief Total x moment coefficient for all the boundaries. */ - Total_CMy, /*!< \brief Total y moment coefficient for all the boundaries. */ - Total_CMz, /*!< \brief Total z moment coefficient for all the boundaries. */ - Total_CoPx, /*!< \brief Total x moment coefficient for all the boundaries. */ - Total_CoPy, /*!< \brief Total y moment coefficient for all the boundaries. */ - Total_CoPz, /*!< \brief Total z moment coefficient for all the boundaries. */ - Total_CFx, /*!< \brief Total x force coefficient for all the boundaries. */ - Total_CFy, /*!< \brief Total y force coefficient for all the boundaries. */ - Total_CFz, /*!< \brief Total z force coefficient for all the boundaries. */ - Total_CEff, /*!< \brief Total efficiency coefficient for all the boundaries. */ - Total_CMerit, /*!< \brief Total rotor Figure of Merit for all the boundaries. */ - Total_CT, /*!< \brief Total thrust coefficient for all the boundaries. */ - Total_CQ, /*!< \brief Total torque coefficient for all the boundaries. */ - Total_Heat, /*!< \brief Total heat load for all the boundaries. */ - Total_MaxHeat, /*!< \brief Maximum heat flux on all boundaries. */ - Total_CpDiff, /*!< \brief Total Equivalent Area coefficient for all the boundaries. */ - Total_HeatFluxDiff, /*!< \brief Total Equivalent Area coefficient for all the boundaries. */ - Total_Custom_ObjFunc, /*!< \brief Total custom objective function for all the boundaries. */ - Total_MassFlowRate; /*!< \brief Total Mass Flow Rate on monitored boundaries. */ - su2double - *Surface_CL, /*!< \brief Lift coefficient for each monitoring surface. */ - *Surface_CD, /*!< \brief Drag coefficient for each monitoring surface. */ - *Surface_CSF, /*!< \brief Side-force coefficient for each monitoring surface. */ - *Surface_CEff, /*!< \brief Side-force coefficient for each monitoring surface. */ - *Surface_CFx, /*!< \brief x Force coefficient for each monitoring surface. */ - *Surface_CFy, /*!< \brief y Force coefficient for each monitoring surface. */ - *Surface_CFz, /*!< \brief z Force coefficient for each monitoring surface. */ - *Surface_CMx, /*!< \brief x Moment coefficient for each monitoring surface. */ - *Surface_CMy, /*!< \brief y Moment coefficient for each monitoring surface. */ - *Surface_CMz, /*!< \brief z Moment coefficient for each monitoring surface. */ - *Surface_HF_Visc, /*!< \brief Total (integrated) heat flux for each monitored surface. */ - *Surface_MaxHF_Visc; /*!< \brief Maximum heat flux for each monitored surface. */ - - su2double *SecondaryVar_i, /*!< \brief Auxiliary vector for storing the solution at point i. */ - *SecondaryVar_j; /*!< \brief Auxiliary vector for storing the solution at point j. */ - su2double *PrimVar_i, /*!< \brief Auxiliary vector for storing the solution at point i. */ - *PrimVar_j; /*!< \brief Auxiliary vector for storing the solution at point j. */ - bool space_centered, /*!< \brief True if space centered scheeme used. */ - euler_implicit, /*!< \brief True if euler implicit scheme used. */ - least_squares; /*!< \brief True if computing gradients by least squares. */ - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - - su2double *Primitive, /*!< \brief Auxiliary nPrimVar vector. */ - *Primitive_i, /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point i. */ - *Primitive_j; /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point j. */ - - CFluidModel *FluidModel; /*!< \brief fluid model used in the solver */ - su2double **Preconditioner; /*!< \brief Auxiliary matrix for storing the low speed preconditioner. */ - - /* Sliding meshes variables */ - - su2double ****SlidingState; - int **SlidingStateNodes; - - CIncEulerVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CIncEulerSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - virtual ~CIncEulerSolver(void); - - /*! - * \brief Set the solver nondimensionalization. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void SetNondimensionalization(CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - CFluidModel* GetFluidModel(void); - - /*! - * \brief Compute the density at the infinity. - * \return Value of the density at the infinity. - */ - su2double GetDensity_Inf(void); - - /*! - * \brief Compute 2-norm of the velocity at the infinity. - * \return Value of the 2-norm of the velocity at the infinity. - */ - su2double GetModVelocity_Inf(void); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - su2double GetPressure_Inf(void); - - /*! - * \brief Get the temperature value at infinity. - * \return Value of the temperature at infinity. - */ - su2double GetTemperature_Inf(void); - - /*! - * \brief Compute the density multiply by velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the density multiply by the velocity at the infinity. - */ - su2double GetDensity_Velocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the velocity at the infinity. - */ - su2double GetVelocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \return Value of the velocity at the infinity. - */ - su2double *GetVelocity_Inf(void); - - /*! - * \brief Set the velocity at infinity. - * \param[in] val_dim - Index of the velocity vector. - * \param[in] val_velocity - Value of the velocity. - */ - void SetVelocity_Inf(unsigned short val_dim, su2double val_velocity); - - /*! - * \brief Compute the time step for solving the Euler equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Value of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Compute the spatial integration using a centered scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute primitive variables and their gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. - * \return - The number of non-physical points. - */ - unsigned long SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output); - - /*! - * \brief Compute a pressure sensor switch. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the gradient of the primitive variables using Green-Gauss method, - * and stores the result in the Gradient_Primitive variable. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetPrimitive_Gradient_GG(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the gradient of the primitive variables using a Least-Squares method, - * and stores the result in the Gradient_Primitive variable. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reconstruction - indicator that the gradient being computed is for upwind reconstruction. - */ - void SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config, bool reconstruction = false); - - /*! - * \brief Compute the limiter of the primitive variables. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetPrimitive_Limiter(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the undivided laplacian for the solution, except the energy equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the max eigenvalue. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetMax_Eigenvalue(CGeometry *geometry, CConfig *config); - - /*! - * \author H. Kline - * \brief Compute weighted-sum "combo" objective output - * \param[in] config - Definition of the particular problem. - */ - void Evaluate_ObjFunc(CConfig *config); - - /*! - * \author: T. Kattmann - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the far-field boundary condition using characteristics. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the symmetry boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose a subsonic inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose a custom or verification boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the convective numerical method. - * \param[in] visc_numerics - Description of the viscous numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the interface state across sliding meshes. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); - - /*! - * \brief Impose a periodic boundary condition by summing contributions from the complete control volume. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Periodic(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config); - - /*! - * \brief compare to values. - * \param[in] a - value 1. - * \param[in] b - value 2. - */ - static bool Compareval(std::vector a,std::vector b); - - /*! - * \brief Update the solution using a Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using the explicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Compute the pressure forces and all the adimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Pressure_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the pressure forces and all the adimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Momentum_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Update the solution using an implicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear iteration for stability. - * \param[in] solver - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ComputeUnderRelaxationFactor(CSolver **solver, CConfig *config); - - /*! - * \brief Provide the non dimensional lift coefficient (inviscid contribution). - * \param val_marker Surface where the coefficient is going to be computed. - * \return Value of the lift coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCLift_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Mnt(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the drag coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional sideforce coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the sideforce coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional efficiency coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the efficiency coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CSF(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CEff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Equivalent Area coefficient. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CpDiff(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional Equivalent Area coefficient. - * \return Value of the Equivalent Area coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_HeatFluxDiff(void); - - /*! - * \brief Set the value of the Equivalent Area coefficient. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - void SetTotal_CpDiff(su2double val_pressure); - - /*! - * \brief Set the value of the Equivalent Area coefficient. - * \param[in] val_cequivarea - Value of the Equivalent Area coefficient. - */ - void SetTotal_HeatFluxDiff(su2double val_heat); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional lift coefficient. - * \param[in] val_Total_CLift - Value of the total lift coefficient. - */ - void SetTotal_CLift(su2double val_Total_CLift); - - /*! - * \brief Set the value of the custom objective function. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - void SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief Add the value of the custom objective function. - * \param[in] val_Total_Custom_ObjFunc - Value of the total custom objective function. - * \param[in] val_weight - Value of the weight for the custom objective function. - */ - void AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional lift coefficient. - * \return Value of the lift coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CL(void); - - /*! - * \author H. Kline - * \brief Set the total "combo" objective (weighted sum of other values). - * \param[in] ComboObj - Value of the combined objective. - */ - void SetTotal_ComboObj(su2double ComboObj); - - /*! - * \author H. Kline - * \brief Provide the total "combo" objective (weighted sum of other values). - * \return Value of the "combo" objective values. - */ - su2double GetTotal_ComboObj(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CD(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x moment coefficient. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y moment coefficient. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z moment coefficient. - * \return Value of the moment z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x moment coefficient. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y moment coefficient. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z moment coefficient. - * \return Value of the moment z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CoPz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x force coefficient. - * \return Value of the force x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y force coefficient. - * \return Value of the force y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z force coefficient. - * \return Value of the force z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional thrust coefficient. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CT(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional thrust coefficient. - * \param[in] val_Total_CT - Value of the total thrust coefficient. - */ - void SetTotal_CT(su2double val_Total_CT); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional torque coefficient. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CQ(void); - - /*! - * \brief Provide the total heat load. - * \return Value of the heat load (viscous contribution). - */ - su2double GetTotal_HeatFlux(void); - - /*! - * \brief Provide the total heat load. - * \return Value of the heat load (viscous contribution). - */ - su2double GetTotal_MaxHeatFlux(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional torque coefficient. - * \param[in] val_Total_CQ - Value of the total torque coefficient. - */ - void SetTotal_CQ(su2double val_Total_CQ); - - /*! - * \brief Store the total heat load. - * \param[in] val_Total_Heat - Value of the heat load. - */ - void SetTotal_HeatFlux(su2double val_Total_Heat); - - /*! - * \brief Store the total heat load. - * \param[in] val_Total_Heat - Value of the heat load. - */ - void SetTotal_MaxHeatFlux(su2double val_Total_MaxHeat); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional rotor Figure of Merit. - * \return Value of the rotor efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMerit(void); - - /*! - * \brief Provide the total custom objective function. - * \return Value of the custom objective function. - */ - su2double GetTotal_Custom_ObjFunc(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CDrag - Value of the total drag coefficient. - */ - void SetTotal_CD(su2double val_Total_CDrag); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Inv(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Inv(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Mnt(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Mnt(void); - - /*! - * \brief Provide the Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetCPressure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Provide the Target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the value of the target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double *GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the total residual adding the term that comes from the Dual Time Strategy. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Set the initial condition for the Euler Equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); - - /*! - * \brief Set the freestream pressure. - * \param[in] Value of freestream pressure. - */ - void SetPressure_Inf(su2double p_inf); - - /*! - * \brief Set the freestream temperature. - * \param[in] Value of freestream temperature. - */ - void SetTemperature_Inf(su2double t_inf); - - /*! - * \brief Set the freestream temperature. - * \param[in] Value of freestream temperature. - */ - void SetDensity_Inf(su2double rho_inf); - - /*! - * \brief Set the solution using the Freestream values. - * \param[in] config - Definition of the particular problem. - */ - void SetFreeStream_Solution(CConfig *config); - - /*! - * \brief Update the Beta parameter for the incompressible preconditioner. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - */ - void SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the preconditioner for low-Mach flows. - * \param[in] iPoint - Index of the grid point - * \param[in] config - Definition of the particular problem. - */ - void SetPreconditioner(CConfig *config, unsigned long iPoint); - - /*! - * \brief Value of the total temperature at an inlet boundary. - * \param[in] val_marker - Surface marker where the total temperature is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total temperature is evaluated. - * \return Value of the total temperature - */ - su2double GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the total pressure at an inlet boundary. - * \param[in] val_marker - Surface marker where the total pressure is evaluated. - * \param[in] val_vertex - Vertex of the marker val_marker where the total pressure is evaluated. - * \return Value of the total pressure - */ - su2double GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief A component of the unit vector representing the flow direction at an inlet boundary. - * \param[in] val_marker - Surface marker where the flow direction is evaluated - * \param[in] val_vertex - Vertex of the marker val_marker where the flow direction is evaluated - * \param[in] val_dim - The component of the flow direction unit vector to be evaluated - * \return Component of a unit vector representing the flow direction. - */ - su2double GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief Set a uniform inlet profile - * - * The values at the inlet are set to match the values specified for - * inlets in the configuration file. - * - * \param[in] config - Definition of the particular problem. - * \param[in] iMarker - Surface marker where the coefficient is computed. - */ - void SetUniformInlet(CConfig* config, unsigned short iMarker); - - /*! - * \brief Store of a set of provided inlet profile values at a vertex. - * \param[in] val_inlet - vector containing the inlet values for the current vertex. - * \param[in] iMarker - Surface marker where the coefficient is computed. - * \param[in] iVertex - Vertex of the marker iMarker where the inlet is being set. - */ - void SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the set of value imposed at an inlet. - * \param[in] val_inlet - vector returning the inlet values for the current vertex. - * \param[in] val_inlet_point - Node index where the inlet is being set. - * \param[in] val_kind_marker - Enumerated type for the particular inlet type. - * \param[in] geometry - Geometrical definition of the problem. - * \param config - Definition of the particular problem. - * \return Value of the face area at the vertex. - */ - su2double GetInletAtVertex(su2double *val_inlet, - unsigned long val_inlet_point, - unsigned short val_kind_marker, - string val_marker, - CGeometry *geometry, - CConfig *config); - - /*! - * \brief A virtual member. - */ - void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief Allocates the final pointer of SlidingState depending on how many donor vertex donate to it. That number is stored in SlidingStateNodes[val_marker][val_vertex]. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - * \param[in] donor_index - index of the donor node to set - * \param[in] component - set value - */ - void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component); - - /*! - * \brief Set the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] value - number of outer states - */ - void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value); - - /*! - * \brief Get the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - */ - su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index); - - /*! - * \brief Compute the global error measures (L2, Linf) for verification cases. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void ComputeVerificationError(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute necessary quantities (massflow, integrated heatflux, avg density) - * for streamwise periodic cases. Also sets new delta P for prescribed massflow. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Output - Write output or not. - */ - void GetStreamwise_Periodic_Properties(CGeometry *geometry, - CConfig *config, - unsigned short iMesh, - bool Output); - -}; - -/*! - * \class CNSSolver - * \brief Main class for defining the Navier-Stokes flow solver. - * \ingroup Navier_Stokes_Equations - * \author F. Palacios - */ -class CNSSolver : public CEulerSolver { -private: - su2double Viscosity_Inf; /*!< \brief Viscosity at the infinity. */ - su2double Tke_Inf; /*!< \brief Turbulent kinetic energy at the infinity. */ - su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number. */ - Prandtl_Turb; /*!< \brief Turbulent Prandtl number. */ - su2double *CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for each boundary. */ - *CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for each boundary. */ - *CSF_Visc, /*!< \brief Side force coefficient (viscous contribution) for each boundary. */ - *CMx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each boundary. */ - *CMy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each boundary. */ - *CMz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each boundary. */ - *CoPx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each boundary. */ - *CoPy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each boundary. */ - *CoPz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each boundary. */ - *CFx_Visc, /*!< \brief Force x coefficient (viscous contribution) for each boundary. */ - *CFy_Visc, /*!< \brief Force y coefficient (viscous contribution) for each boundary. */ - *CFz_Visc, /*!< \brief Force z coefficient (viscous contribution) for each boundary. */ - *Surface_CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CSF_Visc, /*!< \brief Side-force coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CEff_Visc, /*!< \brief Side-force coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFx_Visc, /*!< \brief Force x coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFy_Visc, /*!< \brief Force y coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFz_Visc, /*!< \brief Force z coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each monitoring surface. */ - *Surface_Buffet_Metric, /*!< \brief Integrated separation sensor for each monitoring surface. */ - *CEff_Visc, /*!< \brief Efficiency (Cl/Cd) (Viscous contribution) for each boundary. */ - *CMerit_Visc, /*!< \brief Rotor Figure of Merit (Viscous contribution) for each boundary. */ - *Buffet_Metric, /*!< \brief Integrated separation sensor for each boundary. */ - *CT_Visc, /*!< \brief Thrust coefficient (viscous contribution) for each boundary. */ - *CQ_Visc, /*!< \brief Torque coefficient (viscous contribution) for each boundary. */ - *HF_Visc, /*!< \brief Heat load (viscous contribution) for each boundary. */ - *MaxHF_Visc, /*!< \brief Maximum heat flux (viscous contribution) for each boundary. */ - ***HeatConjugateVar, /*!< \brief Conjugate heat transfer variables for each boundary and vertex. */ - ***CSkinFriction, /*!< \brief Skin friction coefficient for each boundary and vertex. */ - **Buffet_Sensor; /*!< \brief Separation sensor for each boundary and vertex. */ - su2double Total_Buffet_Metric; /*!< \brief Integrated separation sensor for all the boundaries. */ - su2double *ForceViscous, /*!< \brief Viscous force for each boundary. */ - *MomentViscous; /*!< \brief Inviscid moment for each boundary. */ - su2double - AllBound_CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for all the boundaries. */ - AllBound_CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for all the boundaries. */ - AllBound_CSF_Visc, /*!< \brief Sideforce coefficient (viscous contribution) for all the boundaries. */ - AllBound_CMx_Visc, /*!< \brief Moment x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Visc, /*!< \brief Moment y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Visc, /*!< \brief Moment z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Visc, /*!< \brief Moment x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Visc, /*!< \brief Moment y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Visc, /*!< \brief Moment z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Visc, /*!< \brief Efficient coefficient (Viscous contribution) for all the boundaries. */ - AllBound_CFx_Visc, /*!< \brief Force x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Visc, /*!< \brief Force y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Visc, /*!< \brief Force z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Visc, /*!< \brief Rotor Figure of Merit coefficient (Viscous contribution) for all the boundaries. */ - AllBound_CT_Visc, /*!< \brief Thrust coefficient (viscous contribution) for all the boundaries. */ - AllBound_CQ_Visc, /*!< \brief Torque coefficient (viscous contribution) for all the boundaries. */ - AllBound_HF_Visc, /*!< \brief Heat load (viscous contribution) for all the boundaries. */ - AllBound_MaxHF_Visc; /*!< \brief Maximum heat flux (viscous contribution) for all boundaries. */ - su2double - StrainMag_Max, - Omega_Max; /*!< \brief Maximum Strain Rate magnitude and Omega. */ - -public: - - /*! - * \brief Constructor of the class. - */ - CNSSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CNSSolver(void); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Visc(unsigned short val_marker); - - /*! - * \brief Provide the buffet metric. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the buffet metric on the surface val_marker. - */ - su2double GetSurface_Buffet_Metric(unsigned short val_marker); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Visc(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Visc(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Visc(void); - - /*! - * \brief Get the buffet metric. - * \return Value of the buffet metric. - */ - su2double GetTotal_Buffet_Metric(void); - - /*! - * \brief Compute the viscosity at the infinity. - * \return Value of the viscosity at the infinity. - */ - su2double GetViscosity_Inf(void); - - /*! - * \brief Get the turbulent kinetic energy at the infinity. - * \return Value of the turbulent kinetic energy at the infinity. - */ - su2double GetTke_Inf(void); - - /*! - * \brief Compute the time step for solving the Navier-Stokes equations with turbulence model. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. - * \return - The number of non-physical points. - */ - unsigned long SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output); - - /*! - * \brief Compute weighted-sum "combo" objective output - * \param[in] config - Definition of the particular problem. - */ - void Evaluate_ObjFunc(CConfig *config); - - /*! - * \brief Impose a constant heat-flux condition at the wall. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the Navier-Stokes boundary condition (strong). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Navier-Stokes boundary condition (strong) with values from a CHT coupling. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - */ - su2double GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - * \param[in] relaxation factor - relaxation factor for the change of the variables - * \param[in] val_var - value of the variable - */ - void SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var); - - /*! - * \brief Compute the viscous forces and all the addimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Friction_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the buffet sensor. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Buffet_Monitoring(CGeometry *geometry, CConfig *config); - - /*! - * \brief Get the total heat flux. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the integrated heat flux (viscous contribution) on the surface val_marker. - */ - su2double GetSurface_HF_Visc(unsigned short val_marker); - - /*! - * \brief Get the maximum (per surface) heat flux. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the maximum heat flux (viscous contribution) on the surface val_marker. - */ - su2double GetSurface_MaxHF_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional lift coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCL_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional sideforce coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the sideforce coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCSF_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional drag coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCD_Visc(unsigned short val_marker); - - /*! - * \brief Compute the viscous residuals. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the skin friction coefficient. - */ - su2double GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - su2double GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the value of the target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat); - - - /*! - * \brief Get the value of the buffet sensor - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the buffet sensor. - */ - su2double GetBuffetSensor(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the y plus. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the y plus. - */ - su2double GetYPlus(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the max Omega. - * \return Value of the max Omega. - */ - su2double GetOmega_Max(void); - - /*! - * \brief Get the max Strain rate magnitude. - * \return Value of the max Strain rate magnitude. - */ - su2double GetStrainMag_Max(void); - - /*! - * \brief A virtual member. - * \return Value of the StrainMag_Max - */ - void SetStrainMag_Max(su2double val_strainmag_max); - - /*! - * \brief A virtual member. - * \return Value of the Omega_Max - */ - void SetOmega_Max(su2double val_omega_max); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void SetRoe_Dissipation(CGeometry *geometry, CConfig *config); - - /*! - * \brief Computes the wall shear stress (Tau_Wall) on the surface using a wall function. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetTauWall_WF(CGeometry *geometry, CSolver** solver_container, CConfig* config); - -}; - -/*! - * \class CIncNSSolver - * \brief Main class for defining the incompressible Navier-Stokes flow solver. - * \ingroup Navier_Stokes_Equations - * \author F. Palacios, T. Economon, T. Albring - */ -class CIncNSSolver : public CIncEulerSolver { -private: - su2double Viscosity_Inf; /*!< \brief Viscosity at the infinity. */ - su2double Tke_Inf; /*!< \brief Turbulent kinetic energy at the infinity. */ - su2double - *CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for each boundary. */ - *CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for each boundary. */ - *CSF_Visc, /*!< \brief Side force coefficient (viscous contribution) for each boundary. */ - *CMx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each boundary. */ - *CMy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each boundary. */ - *CMz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each boundary. */ - *CoPx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each boundary. */ - *CoPy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each boundary. */ - *CoPz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each boundary. */ - *CFx_Visc, /*!< \brief Force x coefficient (viscous contribution) for each boundary. */ - *CFy_Visc, /*!< \brief Force y coefficient (viscous contribution) for each boundary. */ - *CFz_Visc, /*!< \brief Force z coefficient (viscous contribution) for each boundary. */ - *Surface_CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CSF_Visc, /*!< \brief Side-force coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CEff_Visc, /*!< \brief Side-force coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFx_Visc, /*!< \brief Force x coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFy_Visc, /*!< \brief Force y coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CFz_Visc, /*!< \brief Force z coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMx_Visc, /*!< \brief Moment x coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMy_Visc, /*!< \brief Moment y coefficient (viscous contribution) for each monitoring surface. */ - *Surface_CMz_Visc, /*!< \brief Moment z coefficient (viscous contribution) for each monitoring surface. */ - *CEff_Visc, /*!< \brief Efficiency (Cl/Cd) (Viscous contribution) for each boundary. */ - *CMerit_Visc, /*!< \brief Rotor Figure of Merit (Viscous contribution) for each boundary. */ - *CT_Visc, /*!< \brief Thrust coefficient (viscous contribution) for each boundary. */ - *CQ_Visc, /*!< \brief Torque coefficient (viscous contribution) for each boundary. */ - *HF_Visc, /*!< \brief Heat load (viscous contribution) for each boundary. */ - *MaxHF_Visc, /*!< \brief Maximum heat flux (viscous contribution) for each boundary. */ - ***HeatConjugateVar, /*!< \brief Conjugate heat transfer variables for each boundary and vertex. */ - ***CSkinFriction; /*!< \brief Skin friction coefficient for each boundary and vertex. */ - su2double - *ForceViscous, /*!< \brief Viscous force for each boundary. */ - *MomentViscous; /*!< \brief Inviscid moment for each boundary. */ - su2double - AllBound_CD_Visc, /*!< \brief Drag coefficient (viscous contribution) for all the boundaries. */ - AllBound_CL_Visc, /*!< \brief Lift coefficient (viscous contribution) for all the boundaries. */ - AllBound_CSF_Visc, /*!< \brief Sideforce coefficient (viscous contribution) for all the boundaries. */ - AllBound_CMx_Visc, /*!< \brief Moment x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Visc, /*!< \brief Moment y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Visc, /*!< \brief Moment z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPx_Visc, /*!< \brief Moment x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPy_Visc, /*!< \brief Moment y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CoPz_Visc, /*!< \brief Moment z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Visc, /*!< \brief Efficient coefficient (Viscous contribution) for all the boundaries. */ - AllBound_CFx_Visc, /*!< \brief Force x coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Visc, /*!< \brief Force y coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Visc, /*!< \brief Force z coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMerit_Visc, /*!< \brief Rotor Figure of Merit coefficient (Viscous contribution) for all the boundaries. */ - AllBound_CT_Visc, /*!< \brief Thrust coefficient (viscous contribution) for all the boundaries. */ - AllBound_CQ_Visc, /*!< \brief Torque coefficient (viscous contribution) for all the boundaries. */ - AllBound_HF_Visc, /*!< \brief Heat load (viscous contribution) for all the boundaries. */ - AllBound_MaxHF_Visc; /*!< \brief Maximum heat flux (viscous contribution) for all boundaries. */ - su2double - StrainMag_Max, - Omega_Max; /*!< \brief Maximum Strain Rate magnitude and Omega. */ - -public: - - /*! - * \brief Constructor of the class. - */ - CIncNSSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CIncNSSolver(void); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Visc(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Visc(unsigned short val_marker); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Visc(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Visc(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CoPz_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Visc(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Visc(void); - - /*! - * \brief Compute the viscosity at the infinity. - * \return Value of the viscosity at the infinity. - */ - su2double GetViscosity_Inf(void); - - /*! - * \brief Get the turbulent kinetic energy at the infinity. - * \return Value of the turbulent kinetic energy at the infinity. - */ - su2double GetTke_Inf(void); - - /*! - * \brief Compute the time step for solving the Navier-Stokes equations with turbulence model. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. - * \return - The number of non-physical points. - */ - unsigned long SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output); - - /*! - * \brief Impose a no-slip condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an isothermal temperature condition at the wall. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the (received) conjugate heat variables. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - * \param[in] relaxation factor - relaxation factor for the change of the variables - * \param[in] val_var - value of the variable - */ - void SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - */ - su2double GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var); - - /*! - * \brief Compute the viscous forces and all the addimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Friction_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Get the total heat flux. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the integrated heat flux (viscous contribution) on the surface val_marker. - */ - su2double GetSurface_HF_Visc(unsigned short val_marker); - - /*! - * \brief Get the maximum (per surface) heat flux. - * \param[in] val_marker - Surface marker where the heat flux is computed. - * \return Value of the maximum heat flux (viscous contribution) on the surface val_marker. - */ - su2double GetSurface_MaxHF_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional lift coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCL_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional sideforce coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the sideforce coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCSF_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional drag coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCD_Visc(unsigned short val_marker); - - /*! - * \brief Compute the viscous residuals. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the skin friction coefficient. - */ - su2double GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the skin friction coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat transfer coefficient. - */ - su2double GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the value of the target Pressure coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat); - - /*! - * \brief Get the y plus. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the y plus. - */ - su2double GetYPlus(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Get the max Omega. - * \return Value of the max Omega. - */ - su2double GetOmega_Max(void); - - /*! - * \brief Get the max Strain rate magnitude. - * \return Value of the max Strain rate magnitude. - */ - su2double GetStrainMag_Max(void); - - /*! - * \brief A virtual member. - * \return Value of the StrainMag_Max - */ - void SetStrainMag_Max(su2double val_strainmag_max); - - /*! - * \brief A virtual member. - * \return Value of the Omega_Max - */ - void SetOmega_Max(su2double val_omega_max); - -}; - -/*! - * \class CTurbSolver - * \brief Main class for defining the turbulence model solver. - * \ingroup Turbulence_Model - * \author A. Bueno. - */ -class CTurbSolver : public CSolver { -protected: - su2double *FlowPrimVar_i, /*!< \brief Store the flow solution at point i. */ - *FlowPrimVar_j, /*!< \brief Store the flow solution at point j. */ - *lowerlimit, /*!< \brief contains lower limits for turbulence variables. */ - *upperlimit; /*!< \brief contains upper limits for turbulence variables. */ - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - su2double*** Inlet_TurbVars; /*!< \brief Turbulence variables at inlet profiles */ - - CTurbVariable* snode; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /* Sliding meshes variables */ - - su2double ****SlidingState; - int **SlidingStateNodes; - - CTurbVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CTurbSolver(void); - - /*! - * \brief Destructor of the class. - */ - virtual ~CTurbSolver(void); - - /*! - * \brief Constructor of the class. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CTurbSolver(CGeometry* geometry, CConfig *config); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Compute the viscous residuals for the turbulent equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Impose the Symmetry Plane boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - /*! - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Riemann(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_TurboRiemann(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Giles(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose a periodic boundary condition by summing contributions from the complete control volume. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Periodic(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config); - - /*! - * \brief Update the solution using an implicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Set the total residual adding the term that comes from the Dual Time-Stepping Strategy. - * \param[in] geometry - Geometric definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear iteration for stability. - * \param[in] solver - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ComputeUnderRelaxationFactor(CSolver **solver, CConfig *config); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Get the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - */ - su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index); - - /*! - * \brief Allocates the final pointer of SlidingState depending on how many donor vertex donate to it. That number is stored in SlidingStateNodes[val_marker][val_vertex]. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] val_state - requested state component - * \param[in] donor_index - index of the donor node to set - * \param[in] component - set value - */ - void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component); - - /*! - * \brief Set the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] value - number of outer states - */ - void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value); - - /*! - * \brief Get the number of outer state for fluid interface nodes. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - */ - int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set custom turbulence variables at the vertex of an inlet. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the turbulence variable (i.e. k is 0 in SST) - * \param[in] val_turb_var - Value of the turbulence variable to be used. - */ - void SetInlet_TurbVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_turb_var); -}; - -/*! - * \class CTurbSASolver - * \brief Main class for defining the turbulence model solver. - * \ingroup Turbulence_Model - * \author A. Bueno. - */ - -class CTurbSASolver: public CTurbSolver { -private: - su2double nu_tilde_Inf, nu_tilde_Engine, nu_tilde_ActDisk; - -public: - /*! - * \brief Constructor of the class. - */ - CTurbSASolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] FluidModel - */ - CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned short iMesh, CFluidModel* FluidModel); - - /*! - * \brief Destructor of the class. - */ - ~CTurbSASolver(void); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Impose the Navier-Stokes wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Navier-Stokes wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Far Field boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the engine inflow boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the engine exhaust boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the interface boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Interface_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the fluid interface boundary condition using tranfer data. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); - - /*! - * \brief Impose the near-field boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface); - - /*! - * \brief Set the solution using the Freestream values. - * \param[in] config - Definition of the particular problem. - */ - void SetFreeStream_Solution(CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] solver - Solver container - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void SetDES_LengthScale(CSolver** solver, CGeometry *geometry, CConfig *config); - - /*! - * \brief Store of a set of provided inlet profile values at a vertex. - * \param[in] val_inlet - vector containing the inlet values for the current vertex. - * \param[in] iMarker - Surface marker where the coefficient is computed. - * \param[in] iVertex - Vertex of the marker iMarker where the inlet is being set. - */ - void SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the set of value imposed at an inlet. - * \param[in] val_inlet - vector returning the inlet values for the current vertex. - * \param[in] val_inlet_point - Node index where the inlet is being set. - * \param[in] val_kind_marker - Enumerated type for the particular inlet type. - * \param[in] geometry - Geometrical definition of the problem. - * \param config - Definition of the particular problem. - * \return Value of the face area at the vertex. - */ - su2double GetInletAtVertex(su2double *val_inlet, - unsigned long val_inlet_point, - unsigned short val_kind_marker, - string val_marker, - CGeometry *geometry, - CConfig *config); - - /*! - * \brief Set a uniform inlet profile - * - * The values at the inlet are set to match the values specified for - * inlets in the configuration file. - * - * \param[in] config - Definition of the particular problem. - * \param[in] iMarker - Surface marker where the coefficient is computed. - */ - void SetUniformInlet(CConfig* config, unsigned short iMarker); - - /*! - * \brief Get the value of nu tilde at the far-field. - * \return Value of nu tilde at the far-field. - */ - su2double GetNuTilde_Inf(void); - - /*! - * \brief Compute nu tilde from the wall functions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void SetNuTilde_WF(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); -}; - -/*! - * \class CTurbSSTSolver - * \brief Main class for defining the turbulence model solver. - * \ingroup Turbulence_Model - * \author A. Campos, F. Palacios, T. Economon - */ - -class CTurbSSTSolver: public CTurbSolver { -private: - su2double *constants, /*!< \brief Constants for the model. */ - kine_Inf, /*!< \brief Free-stream turbulent kinetic energy. */ - omega_Inf; /*!< \brief Free-stream specific dissipation. */ - -public: - /*! - * \brief Constructor of the class. - */ - CTurbSSTSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CTurbSSTSolver(void); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Computes the eddy viscosity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Impose the Navier-Stokes wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Navier-Stokes wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Far Field boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the interface state across sliding meshes. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); - - /*! - * \brief Get the constants for the SST model. - * \return A pointer to an array containing a set of constants - */ - su2double* GetConstants(); - - /*! - * \brief Set the solution using the Freestream values. - * \param[in] config - Definition of the particular problem. - */ - void SetFreeStream_Solution(CConfig *config); - - /*! - * \brief Store of a set of provided inlet profile values at a vertex. - * \param[in] val_inlet - vector containing the inlet values for the current vertex. - * \param[in] iMarker - Surface marker where the coefficient is computed. - * \param[in] iVertex - Vertex of the marker iMarker where the inlet is being set. - */ - void SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the set of value imposed at an inlet. - * \param[in] val_inlet - vector returning the inlet values for the current vertex. - * \param[in] val_inlet_point - Node index where the inlet is being set. - * \param[in] val_kind_marker - Enumerated type for the particular inlet type. - * \param[in] geometry - Geometrical definition of the problem. - * \param config - Definition of the particular problem. - * \return Value of the face area at the vertex. - */ - su2double GetInletAtVertex(su2double *val_inlet, - unsigned long val_inlet_point, - unsigned short val_kind_marker, - string val_marker, - CGeometry *geometry, - CConfig *config); - /*! - * \brief Set a uniform inlet profile - * - * The values at the inlet are set to match the values specified for - * inlets in the configuration file. - * - * \param[in] config - Definition of the particular problem. - * \param[in] iMarker - Surface marker where the coefficient is computed. - */ - void SetUniformInlet(CConfig* config, unsigned short iMarker); - - /*! - * \brief Get the value of the turbulent kinetic energy. - * \return Value of the turbulent kinetic energy. - */ - su2double GetTke_Inf(void); - - /*! - * \brief Get the value of the turbulent frequency. - * \return Value of the turbulent frequency. - */ - su2double GetOmega_Inf(void); - -}; - -/*! - * \class CTransLMSolver - * \brief Main class for defining the turbulence model solver. - * \ingroup Turbulence_Model - * \author A. Aranake. - */ - -class CTransLMSolver: public CTurbSolver { -private: - su2double Intermittency_Inf, REth_Inf; -public: - /*! - * \brief Constructor of the class. - */ - CTransLMSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CTransLMSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CTransLMSolver(void); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the viscous residuals for the turbulent equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Impose the Navier-Stokes wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the Far Field boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the symmetry condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - /*! - * \brief Update the solution using an implicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - // Another set of matrix structures for the Lm equations - CSysMatrix JacobianItmc; /*!< \brief Complete sparse Jacobian structure for implicit computations. */ - su2double *LinSysSolItmc; /*!< \brief vector to store iterative solution of implicit linear system. */ - su2double *LinSysResItmc; /*!< \brief vector to store iterative residual of implicit linear system. */ - su2double *rhsItmc; /*!< \brief right hand side of implicit linear system. */ - CSysMatrix JacobianReth; /*!< \brief Complete sparse Jacobian structure for implicit computations. */ - su2double *LinSysSolReth; /*!< \brief vector to store iterative solution of implicit linear system. */ - su2double *LinSysResReth; /*!< \brief vector to store iterative residual of implicit linear system. */ - su2double *rhsReth; /*!< \brief right hand side of implicit linear system. */ -}; - -/*! - * \class CAdjEulerSolver - * \brief Main class for defining the Euler's adjoint flow solver. - * \ingroup Euler_Equations - * \author F. Palacios - */ -class CAdjEulerSolver : public CSolver { -protected: - su2double - PsiRho_Inf, /*!< \brief PsiRho variable at the infinity. */ - PsiE_Inf, /*!< \brief PsiE variable at the infinity. */ - *Phi_Inf; /*!< \brief Phi vector at the infinity. */ - su2double - *Sens_Mach, /*!< \brief Mach sensitivity coefficient for each boundary. */ - *Sens_AoA, /*!< \brief Angle of attack sensitivity coefficient for each boundary. */ - *Sens_Geo, /*!< \brief Shape sensitivity coefficient for each boundary. */ - *Sens_Press, /*!< \brief Pressure sensitivity coefficient for each boundary. */ - *Sens_Temp, /*!< \brief Temperature sensitivity coefficient for each boundary. */ - *Sens_BPress, /*!< \brief Back pressure sensitivity coefficient for each boundary. */ - **CSensitivity, /*!< \brief Shape sensitivity coefficient for each boundary and vertex. */ - ***DonorAdjVar; /*!< \brief Value of the donor variables at each boundary. */ - su2double Total_Sens_Mach; /*!< \brief Total mach sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_AoA; /*!< \brief Total angle of attack sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_Geo; /*!< \brief Total shape sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_Press; /*!< \brief Total farfield sensitivity to pressure. */ - su2double Total_Sens_Temp; /*!< \brief Total farfield sensitivity to temperature. */ - su2double Total_Sens_BPress; /*!< \brief Total sensitivity to back pressure. */ - bool space_centered; /*!< \brief True if space centered scheeme used. */ - su2double **Jacobian_Axisymmetric; /*!< \brief Storage for axisymmetric Jacobian. */ - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - su2double *FlowPrimVar_i, /*!< \brief Store the flow solution at point i. */ - *FlowPrimVar_j; /*!< \brief Store the flow solution at point j. */ - unsigned long **DonorGlobalIndex; /*!< \brief Value of the donor global index. */ - - su2double pnorm, - Area_Monitored; /*!< \brief Store the total area of the monitored outflow surface (used for normalization in continuous adjoint outflow conditions) */ - - su2double ACoeff, ACoeff_inc, ACoeff_old; - bool Update_ACoeff; - - CAdjEulerVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CAdjEulerSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - virtual ~CAdjEulerSolver(void); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Parallelization of Undivided Laplacian. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Set_MPI_Nearfield(CGeometry *geometry, CConfig *config); - - /*! - * \brief Parallelization of Undivided Laplacian. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config); - - /*! - * \brief Created the force projection vector for adjoint boundary conditions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetForceProj_Vector(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Compute the jump for the interior boundary problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetIntBoundary_Jump(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Compute adjoint density at the infinity. - * \return Value of the adjoint density at the infinity. - */ - su2double GetPsiRho_Inf(void); - - /*! - * \brief Compute the adjoint energy at the infinity. - * \return Value of the adjoint energy at the infinity. - */ - su2double GetPsiE_Inf(void); - - /*! - * \brief Compute Phi (adjoint velocity) at the infinity. - * \param[in] val_dim - Index of the adjoint velocity vector. - * \return Value of the adjoint velocity vector at the infinity. - */ - su2double GetPhi_Inf(unsigned short val_dim); - - /*! - * \brief Compute the spatial integration using a centered scheme for the adjoint equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the undivided laplacian for the adjoint solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double *GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value); - - /*! - * \brief Value of the characteristic variables at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - su2double GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - unsigned long GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Value of the characteristic global index at the boundaries. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the pressure coefficient. - */ - void SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index); - - /*! - * \brief Compute the sensor for higher order dissipation control in rotating problems. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config); - - /*! - * \brief Update the AoA and freestream velocity at the farfield. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - void SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output); - - /*! - * \brief Impose via the residual the adjoint Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the interface boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Interface_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the near-field boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose an actuator disk inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface); - - /*! - * \brief Impose via the residual the adjoint symmetry boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the boundary condition to the far field using characteristics. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - - /*! - * \brief Impose the supersonic inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the supersonic outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] solver - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the engine inflow adjoint boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the engine exhaust boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Update the solution using a Runge-Kutta strategy. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using a explicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Update the solution using an implicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Initialize the residual vectors. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the inviscid sensitivity of the functional. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief Smooth the inviscid sensitivity of the functional. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void Smooth_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief Get the shape sensitivity coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the sensitivity coefficient. - */ - su2double GetCSensitivity(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Set the shape sensitivity coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \param[in] val_sensitivity - Value of the sensitivity coefficient. - */ - void SetCSensitivity(unsigned short val_marker, unsigned long val_vertex, su2double val_sensitivity); - - /*! - * \brief Provide the total shape sensitivity coefficient. - * \return Value of the geometrical sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Geo(void); - - /*! - * \brief Set the total Mach number sensitivity coefficient. - * \return Value of the Mach sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Mach(void); - - /*! - * \brief Set the total angle of attack sensitivity coefficient. - * \return Value of the angle of attack sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_AoA(void); - - /*! - * \brief Set the total farfield pressure sensitivity coefficient. - * \return Value of the farfield pressure sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Press(void); - - /*! - * \brief Set the total farfield temperature sensitivity coefficient. - * \return Value of the farfield temperature sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Temp(void); - - /*! - * \author H. Kline - * \brief Get the total Back pressure number sensitivity coefficient. - * \return Value of the Back sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_BPress(void); - - /*! - * \brief Set the total residual adding the term that comes from the Dual Time Strategy. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Set the initial condition for the Euler Equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - -}; - -/*! - * \class CAdjNSSolver - * \brief Main class for defining the Navier-Stokes' adjoint flow solver. - * \ingroup Navier_Stokes_Equations - * \author F. Palacios - */ -class CAdjNSSolver : public CAdjEulerSolver { -public: - - /*! - * \brief Constructor of the class. - */ - CAdjNSSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CAdjNSSolver(void); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - - /*! - * \brief Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose via the residual or brute force the Navier-Stokes adjoint boundary condition (heat flux). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the viscous sensitivity of the functional. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - void Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config); - - /*! - * \brief Compute the viscous residuals for the adjoint equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - -}; - -/*! - * \class CAdjTurbSolver - * \brief Main class for defining the adjoint turbulence model solver. - * \ingroup Turbulence_Model - * \author F. Palacios, A. Bueno. - */ -class CAdjTurbSolver : public CSolver { -private: - su2double PsiNu_Inf, /*!< \brief PsiNu variable at the infinity. */ - *FlowSolution_i, /*!< \brief Store the flow solution at point i. */ - *FlowSolution_j; /*!< \brief Store the flow solution at point j. */ - - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - - CAdjTurbVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Default constructor of the class. - */ - CAdjTurbSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Default destructor of the class. - */ - virtual ~CAdjTurbSolver(void); - - /*! - * \brief Impose the Navier-Stokes turbulent adjoint boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose an isothermal wall boundary condition (no-slip). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the boundary condition to the far field using characteristics. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Initializate the residual vectors. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Compute the viscous residuals for the turbulent adjoint equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Update the solution using an implicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - -}; - -/*! \class CHeatSolverFVM - * \brief Main class for defining the finite-volume heat solver. - * \author O. Burghardt - * \date January 19, 2018. - */ -class CHeatSolverFVM : public CSolver { -protected: - unsigned short nVarFlow, nMarker, CurrentMesh; - su2double **HeatFlux, *HeatFlux_per_Marker, *Surface_HF, Total_HeatFlux, AllBound_HeatFlux, - *AverageT_per_Marker, Total_AverageT, AllBound_AverageT, - *Primitive, *Primitive_Flow_i, *Primitive_Flow_j, - *Surface_Areas, Total_HeatFlux_Areas, Total_HeatFlux_Areas_Monitor; - su2double ***ConjugateVar, ***InterfaceVar; - - CHeatFVMVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CHeatSolverFVM(void); - - /*! - * \brief Constructor of the class. - */ - CHeatSolverFVM(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - virtual ~CHeatSolverFVM(void); - - /*! - * \brief Restart residual and compute gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, - unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Source term computation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Compute the undivided laplacian for the solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the spatial integration using a centered scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Compute the viscous residuals for the turbulent equation. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - - void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config); - - /*! - * \brief Impose the Navier-Stokes boundary condition (strong). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose a constant heat-flux condition at the wall. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); - - /*! - * \brief Impose the (received) conjugate heat variables. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - */ - su2double GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var); - - /*! - * \brief Set the conjugate heat variables. - * \param[in] val_marker - marker index - * \param[in] val_vertex - vertex index - * \param[in] pos_var - variable position (in vector of all conjugate heat variables) - * \param[in] relaxation factor - relaxation factor for the change of the variables - * \param[in] val_var - value of the variable - */ - void SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var); - - /*! - * \brief Evaluate heat-flux related objectives. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Get value of the heat load (integrated heat flux). - * \return Value of the heat load (integrated heat flux). - */ - su2double GetTotal_HeatFlux(void); - - /*! - * \brief Get value of the integral-averaged temperature. - * \return Value of the integral-averaged temperature. - */ - su2double GetTotal_AvgTemperature(void); - - /*! - * \brief Update the solution using an implicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Update the solution using an explicit solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Set the initial condition for the FEM structural problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); - - /*! - * \brief Set the total residual adding the term that comes from the Dual Time-Stepping Strategy. - * \param[in] geometry - Geometric definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Get the heat flux. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the heat flux. - */ - su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex); - -}; - -/*! - * \class CTemplateSolver - * \brief Main class for defining the template model solver. - * \ingroup Template_Flow_Equation - * \author F. Palacios - */ -class CTemplateSolver : public CSolver { -private: - - CVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CTemplateSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - CTemplateSolver(CGeometry *geometry, CConfig *config); - - /*! - * \brief Destructor of the class. - */ - ~CTemplateSolver(void); - - /*! - * \brief Compute the velocity^2, SoundSpeed, Pressure. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Compute the time step for solving the Euler equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Index of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Compute the spatial integration using a centered scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep); - - /*! - * \brief Compute the spatial integration using a upwind scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] second_numerics - Description of the second numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CNumerics *second_numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Source term integration. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh); - - /*! - * \brief Impose via the residual the Euler wall boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose the Navier-Stokes boundary condition (strong). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the far-field boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the inlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the outlet boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker); - - /*! - * \brief Impose the symmetry plane boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; - - /*! - * \brief Impose a custom or verification boundary condition. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the convective numerical method. - * \param[in] visc_numerics - Description of the viscous numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker); - - /*! - * \brief Update the solution using a Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using the explicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - - /*! - * \brief Update the solution using an implicit Euler scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config); - -}; - -/*! - * \class CDiscAdjSolver - * \brief Main class for defining the discrete adjoint solver. - * \ingroup Discrete_Adjoint - * \author T. Albring - */ -class CDiscAdjSolver : public CSolver { -private: - unsigned short KindDirect_Solver; - CSolver *direct_solver; - su2double **CSensitivity; /*!< \brief Shape sensitivity coefficient for each boundary and vertex. */ - su2double Total_Sens_Mach; /*!< \brief Total mach sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_AoA; /*!< \brief Total angle of attack sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_Geo; /*!< \brief Total shape sensitivity coefficient for all the boundaries. */ - su2double Total_Sens_Press; /*!< \brief Total farfield sensitivity to pressure. */ - su2double Total_Sens_Temp; /*!< \brief Total farfield sensitivity to temperature. */ - su2double Total_Sens_BPress; /*!< \brief Total sensitivity to outlet pressure. */ - su2double Total_Sens_Density; /*!< \brief Total sensitivity to initial density (incompressible). */ - su2double Total_Sens_ModVel; /*!< \brief Total sensitivity to inlet velocity (incompressible). */ - su2double ObjFunc_Value; /*!< \brief Value of the objective function. */ - su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel; - - su2double *Solution_Geometry; /*!< \brief Auxiliary vector for the geometry solution (dimension nDim instead of nVar). */ - - CDiscAdjVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CDiscAdjSolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CDiscAdjSolver(CGeometry *geometry, CConfig *config); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] solver - Initialize the discrete adjoint solver with the corresponding direct solver. - * \param[in] Kind_Solver - The kind of direct solver. - */ - CDiscAdjSolver(CGeometry *geometry, CConfig *config, CSolver* solver, unsigned short Kind_Solver, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CDiscAdjSolver(void); - - /*! - * \brief Performs the preprocessing of the adjoint AD-based solver. - * Registers all necessary variables on the tape. Called while tape is active. - * \param[in] geometry_container - The geometry container holding all grid levels. - * \param[in] config_container - The particular config. - */ - void RegisterSolution(CGeometry *geometry, CConfig *config); - - /*! - * \brief Performs the preprocessing of the adjoint AD-based solver. - * Registers all necessary variables that are output variables on the tape. - * Called while tape is active. - * \param[in] geometry_container - The geometry container holding all grid levels. - * \param[in] config_container - The particular config. - */ - void RegisterOutput(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the output of the flow (+turb.) iteration - * before evaluation of the tape. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - void SetAdjoint_Output(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the output of the mesh deformation iteration - * before evaluation of the tape. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - void SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the input variables of the flow (+turb.) iteration - * after tape has been evaluated. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_Geometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the flow variables due to cross term contributions - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_CrossTerm(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_CrossTerm_Geometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_CrossTerm_Geometry_Flow(CGeometry *geometry, CConfig *config); - - /*! - * \brief Register the objective function as output. - * \param[in] geometry - The geometrical definition of the problem. - */ - void RegisterObj_Func(CConfig *config); - - /*! - * \brief Set the surface sensitivity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetSurface_Sensitivity(CGeometry *geometry, CConfig* config); - - /*! - * \brief Extract and set the geometrical sensitivity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - The solver container holding all terms of the solution. - * \param[in] config - Definition of the particular problem. - */ - void SetSensitivity(CGeometry *geometry, CSolver **solver, CConfig *config); - - /*! - * \brief Set the objective function. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetAdj_ObjFunc(CGeometry *geometry, CConfig* config); - - /*! - * \brief Provide the total shape sensitivity coefficient. - * \return Value of the geometrical sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Geo(void); - - /*! - * \brief Set the total Mach number sensitivity coefficient. - * \return Value of the Mach sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Mach(void); - - /*! - * \brief Set the total angle of attack sensitivity coefficient. - * \return Value of the angle of attack sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_AoA(void); - - /*! - * \brief Set the total farfield pressure sensitivity coefficient. - * \return Value of the farfield pressure sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Press(void); - - /*! - * \brief Set the total farfield temperature sensitivity coefficient. - * \return Value of the farfield temperature sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_Temp(void); - - /*! - * \author H. Kline - * \brief Get the total Back pressure number sensitivity coefficient. - * \return Value of the Back sensitivity coefficient - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_BPress(void); - - /*! - * \brief Get the total density sensitivity coefficient. - * \return Value of the density sensitivity. - */ - su2double GetTotal_Sens_Density(void); - - /*! - * \brief Get the total velocity magnitude sensitivity coefficient. - * \return Value of the velocity magnitude sensitivity. - */ - su2double GetTotal_Sens_ModVel(void); - - /*! - * \brief Get the shape sensitivity coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. - * \return Value of the sensitivity coefficient. - */ - su2double GetCSensitivity(unsigned short val_marker, unsigned long val_vertex); - - /*! - * \brief Prepare the solver for a new recording. - * \param[in] kind_recording - Kind of AD recording. - */ - void SetRecording(CGeometry *geometry, CConfig *config); - - /*! - * \brief Prepare the solver for a new recording. - * \param[in] kind_recording - Kind of AD recording. - */ - void SetMesh_Recording(CGeometry **geometry, CVolumetricMovement *grid_movement, - CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reset - If true reset variables to their initial values. - */ - void RegisterVariables(CGeometry *geometry, CConfig *config, bool reset = false) override; - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config) override; - - /*! - * \brief Update the dual-time derivatives. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Compute the multizone residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - -}; - -/*! - * \class CDiscAdjFEASolver - * \brief Main class for defining the discrete adjoint solver for FE structural problems. - * \ingroup Discrete_Adjoint - * \author R. Sanchez - */ -class CDiscAdjFEASolver : public CSolver { -private: - unsigned short KindDirect_Solver; - CSolver *direct_solver; - su2double *Sens_E, /*!< \brief Young modulus sensitivity coefficient for each boundary. */ - *Sens_Nu, /*!< \brief Poisson's ratio sensitivity coefficient for each boundary. */ - *Sens_nL, /*!< \brief Normal pressure sensitivity coefficient for each boundary. */ - **CSensitivity; /*!< \brief Shape sensitivity coefficient for each boundary and vertex. */ - - su2double *Solution_Vel, /*!< \brief Velocity componenent of the solution. */ - *Solution_Accel; /*!< \brief Acceleration componenent of the solution. */ - - su2double *SolRest; /*!< \brief Auxiliary vector to restart the solution */ - - su2double ObjFunc_Value; /*!< \brief Value of the objective function. */ - su2double *normalLoads; /*!< \brief Values of the normal loads for each marker iMarker_nL. */ - unsigned long nMarker_nL; /*!< \brief Total number of markers that have a normal load applied. */ - - unsigned short nMPROP; /*!< \brief Number of material properties */ - - su2double *E_i, /*!< \brief Values of the Young's Modulus. */ - *Nu_i, /*!< \brief Values of the Poisson's ratio. */ - *Rho_i, /*!< \brief Values of the density (for inertial effects). */ - *Rho_DL_i; /*!< \brief Values of the density (for volume loading). */ - int *AD_Idx_E_i, /*!< \brief Derivative index of the Young's Modulus. */ - *AD_Idx_Nu_i, /*!< \brief Derivative index of the Poisson's ratio. */ - *AD_Idx_Rho_i, /*!< \brief Derivative index of the density (for inertial effects). */ - *AD_Idx_Rho_DL_i; /*!< \brief Derivative index of the density (for volume loading). */ - - su2double *Local_Sens_E, /*!< \brief Local sensitivity of the Young's modulus. */ - *Global_Sens_E, /*!< \brief Global sensitivity of the Young's modulus. */ - *Total_Sens_E; /*!< \brief Total sensitivity of the Young's modulus (time domain). */ - su2double *Local_Sens_Nu, /*!< \brief Local sensitivity of the Poisson ratio. */ - *Global_Sens_Nu, /*!< \brief Global sensitivity of the Poisson ratio. */ - *Total_Sens_Nu; /*!< \brief Total sensitivity of the Poisson ratio (time domain). */ - su2double *Local_Sens_Rho, /*!< \brief Local sensitivity of the density. */ - *Global_Sens_Rho, /*!< \brief Global sensitivity of the density. */ - *Total_Sens_Rho; /*!< \brief Total sensitivity of the density (time domain). */ - su2double *Local_Sens_Rho_DL, /*!< \brief Local sensitivity of the volume load. */ - *Global_Sens_Rho_DL, /*!< \brief Global sensitivity of the volume load. */ - *Total_Sens_Rho_DL; /*!< \brief Total sensitivity of the volume load (time domain). */ - - bool de_effects; /*!< \brief Determines if DE effects are considered. */ - unsigned short nEField; /*!< \brief Number of electric field areas in the problem. */ - su2double *EField; /*!< \brief Array that stores the electric field as design variables. */ - int *AD_Idx_EField; /*!< \brief Derivative index of the electric field as design variables. */ - su2double *Local_Sens_EField, /*!< \brief Local sensitivity of the Electric Field. */ - *Global_Sens_EField, /*!< \brief Global sensitivity of the Electric Field. */ - *Total_Sens_EField; /*!< \brief Total sensitivity of the Electric Field (time domain). */ - - bool fea_dv; /*!< \brief Determines if the design variable we study is a FEA parameter. */ - unsigned short nDV; /*!< \brief Number of design variables in the problem. */ - su2double *DV_Val; /*!< \brief Values of the design variables. */ - int *AD_Idx_DV_Val; /*!< \brief Derivative index of the design variables. */ - su2double *Local_Sens_DV, /*!< \brief Local sensitivity of the design variables. */ - *Global_Sens_DV, /*!< \brief Global sensitivity of the design variables. */ - *Total_Sens_DV; /*!< \brief Total sensitivity of the design variables (time domain). */ - - CDiscAdjFEABoundVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */ - - /*! - * \brief Return nodes to allow CSolver::base_nodes to be set. - */ - inline CVariable* GetBaseClassPointerToNodes() override { return nodes; } - -public: - - /*! - * \brief Constructor of the class. - */ - CDiscAdjFEASolver(void); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CDiscAdjFEASolver(CGeometry *geometry, CConfig *config); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] solver - Initialize the discrete adjoint solver with the corresponding direct solver. - * \param[in] Kind_Solver - The kind of direct solver. - */ - CDiscAdjFEASolver(CGeometry *geometry, CConfig *config, CSolver* solver, unsigned short Kind_Solver, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - ~CDiscAdjFEASolver(void); - - /*! - * \brief Performs the preprocessing of the adjoint AD-based solver. - * Registers all necessary variables on the tape. Called while tape is active. - * \param[in] geometry_container - The geometry container holding all grid levels. - * \param[in] config_container - The particular config. - */ - void RegisterSolution(CGeometry *geometry, CConfig *config); - - /*! - * \brief Performs the preprocessing of the adjoint AD-based solver. - * Registers all necessary variables that are output variables on the tape. - * Called while tape is active. - * \param[in] geometry_container - The geometry container holding all grid levels. - * \param[in] config_container - The particular config. - */ - void RegisterOutput(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the output of the flow (+turb.) iteration - * before evaluation of the tape. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - void SetAdjoint_Output(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the input variables of the flow (+turb.) iteration - * after tape has been evaluated. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config); - - /*! - * \brief Sets the adjoint values of the structural variables due to cross term contributions - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_CrossTerm(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - The geometrical definition of the problem. - * \param[in] solver_container - The solver container holding all solutions. - * \param[in] config - The particular config. - */ - void ExtractAdjoint_CrossTerm_Geometry(CGeometry *geometry, CConfig *config); - - /*! - * \brief Register the objective function as output. - * \param[in] geometry - The geometrical definition of the problem. - */ - void RegisterObj_Func(CConfig *config); - - /*! - * \brief Set the surface sensitivity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetSurface_Sensitivity(CGeometry *geometry, CConfig* config); - - /*! - * \brief Extract and set the geometrical sensitivity. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - The solver container holding all terms of the solution. - * \param[in] config - Definition of the particular problem. - */ - void SetSensitivity(CGeometry *geometry, CSolver **solver, CConfig *config); - - /*! - * \brief Set the objective function. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetAdj_ObjFunc(CGeometry *geometry, CConfig* config); - - /*! - * \brief Provide the total Young's modulus sensitivity - * \return Value of the total Young's modulus sensitivity - * (inviscid + viscous contribution). - */ - su2double GetTotal_Sens_E(unsigned short iVal); - - /*! - * \brief Set the total Poisson's ratio sensitivity. - * \return Value of the Poisson's ratio sensitivity - */ - su2double GetTotal_Sens_Nu(unsigned short iVal); - - /*! - * \brief Get the total sensitivity for the structural density - * \return Value of the structural density sensitivity - */ - su2double GetTotal_Sens_Rho(unsigned short iVal); - - /*! - * \brief Get the total sensitivity for the structural weight - * \return Value of the structural weight sensitivity - */ - su2double GetTotal_Sens_Rho_DL(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField (time averaged) - */ - su2double GetTotal_Sens_EField(unsigned short iEField); - - /*! - * \brief A virtual member. - * \return Value of the total sensitivity coefficient for the FEA DV in the region iDVFEA (time averaged) - */ - su2double GetTotal_Sens_DVFEA(unsigned short iDVFEA); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Young Modulus E - */ - su2double GetGlobal_Sens_E(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the Mach sensitivity for the Poisson's ratio Nu - */ - su2double GetGlobal_Sens_Nu(unsigned short iVal); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField - */ - su2double GetGlobal_Sens_EField(unsigned short iEField); - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the FEA DV in the region iDVFEA - */ - su2double GetGlobal_Sens_DVFEA(unsigned short iDVFEA); - - /*! - * \brief Get the total sensitivity for the structural density - * \return Value of the structural density sensitivity - */ - su2double GetGlobal_Sens_Rho(unsigned short iVal); - - /*! - * \brief Get the total sensitivity for the structural weight - * \return Value of the structural weight sensitivity - */ - su2double GetGlobal_Sens_Rho_DL(unsigned short iVal); - - - /*! - * \brief Get the value of the Young modulus from the adjoint solver - * \return Value of the Young modulus from the adjoint solver - */ - su2double GetVal_Young(unsigned short iVal); - - /*! - * \brief Get the value of the Poisson's ratio from the adjoint solver - * \return Value of the Poisson's ratio from the adjoint solver - */ - su2double GetVal_Poisson(unsigned short iVal); - - /*! - * \brief Get the value of the density from the adjoint solver, for inertial effects - * \return Value of the density from the adjoint solver - */ - su2double GetVal_Rho(unsigned short iVal); - - /*! - * \brief Get the value of the density from the adjoint solver, for dead loads - * \return Value of the density for dead loads, from the adjoint solver - */ - su2double GetVal_Rho_DL(unsigned short iVal); - - /*! - * \brief Get the number of variables for the Electric Field from the adjoint solver - * \return Number of electric field variables from the adjoint solver - */ - unsigned short GetnEField(void); - - /*! - * \brief Read the design variables for the adjoint solver - */ - void ReadDV(CConfig *config); - - /*! - * \brief Get the number of design variables from the adjoint solver, - * \return Number of design variables from the adjoint solver - */ - unsigned short GetnDVFEA(void); - - /*! - * \brief Get the value of the Electric Field from the adjoint solver - * \return Pointer to the values of the Electric Field - */ - su2double GetVal_EField(unsigned short iVal); - - /*! - * \brief Get the value of the design variables from the adjoint solver - * \return Pointer to the values of the design variables - */ - su2double GetVal_DVFEA(unsigned short iVal); - - /*! - * \brief Prepare the solver for a new recording. - * \param[in] kind_recording - Kind of AD recording. - */ - void SetRecording(CGeometry *geometry, CConfig *config); - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] reset - If true reset variables to their initial values. - */ - void RegisterVariables(CGeometry *geometry, CConfig *config, bool reset = false) override; - - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config) override; - - /*! - * \brief Update the dual-time derivatives. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Output - boolean to determine whether to print output. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Compute the multizone residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - -}; - -/*! - * \class CFEM_DG_EulerSolver - * \brief Main class for defining the Euler Discontinuous Galerkin finite element flow solver. - * \ingroup Euler_Equations - * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.0.0 "Blackbird" - */ -class CFEM_DG_EulerSolver : public CSolver { -protected: - - su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ - - CFluidModel *FluidModel; /*!< \brief fluid model used in the solver */ - - su2double - Mach_Inf, /*!< \brief Mach number at infinity. */ - Density_Inf, /*!< \brief Density at infinity. */ - Energy_Inf, /*!< \brief Energy at infinity. */ - Temperature_Inf, /*!< \brief Energy at infinity. */ - Pressure_Inf, /*!< \brief Pressure at infinity. */ - *Velocity_Inf; /*!< \brief Flow velocity vector at infinity. */ - - vector ConsVarFreeStream; /*!< \brief Vector, which contains the free stream - conservative variables. */ - su2double - *CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each boundary. */ - *CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each boundary. */ - *CSF_Inv, /*!< \brief Sideforce coefficient (inviscid contribution) for each boundary. */ - *CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each boundary. */ - *CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each boundary. */ - *CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each boundary. */ - *CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each boundary. */ - *CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each boundary. */ - *CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each boundary. */ - *CEff_Inv; /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each boundary. */ - - su2double - *Surface_CL_Inv, /*!< \brief Lift coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CD_Inv, /*!< \brief Drag coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CSF_Inv, /*!< \brief Side-force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFx_Inv, /*!< \brief x Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFy_Inv, /*!< \brief y Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CFz_Inv, /*!< \brief z Force coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMx_Inv, /*!< \brief x Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMy_Inv, /*!< \brief y Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CMz_Inv, /*!< \brief z Moment coefficient (inviscid contribution) for each monitoring surface. */ - *Surface_CEff_Inv; /*!< \brief Efficiency (Cl/Cd) (inviscid contribution) for each monitoring surface. */ - - su2double - AllBound_CL_Inv, /*!< \brief Total lift coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CD_Inv, /*!< \brief Total drag coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CSF_Inv, /*!< \brief Total sideforce coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFx_Inv, /*!< \brief Total x force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFy_Inv, /*!< \brief Total y force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CFz_Inv, /*!< \brief Total z force coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMx_Inv, /*!< \brief Total x moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMy_Inv, /*!< \brief Total y moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CMz_Inv, /*!< \brief Total z moment coefficient (inviscid contribution) for all the boundaries. */ - AllBound_CEff_Inv; /*!< \brief Total efficiency (Cl/Cd) (inviscid contribution) for all the boundaries. */ - - su2double - Total_CL, /*!< \brief Total lift coefficient for all the boundaries. */ - Total_CD, /*!< \brief Total drag coefficient for all the boundaries. */ - Total_CSF, /*!< \brief Total sideforce coefficient for all the boundaries. */ - Total_CFx, /*!< \brief Total x force coefficient for all the boundaries. */ - Total_CFy, /*!< \brief Total y force coefficient for all the boundaries. */ - Total_CFz, /*!< \brief Total z force coefficient for all the boundaries. */ - Total_CMx, /*!< \brief Total x moment coefficient for all the boundaries. */ - Total_CMy, /*!< \brief Total y moment coefficient for all the boundaries. */ - Total_CMz, /*!< \brief Total z moment coefficient for all the boundaries. */ - Total_CEff; /*!< \brief Total efficiency coefficient for all the boundaries. */ - - su2double - *Surface_CL, /*!< \brief Lift coefficient for each monitoring surface. */ - *Surface_CD, /*!< \brief Drag coefficient for each monitoring surface. */ - *Surface_CSF, /*!< \brief Side-force coefficient for each monitoring surface. */ - *Surface_CFx, /*!< \brief x Force coefficient for each monitoring surface. */ - *Surface_CFy, /*!< \brief y Force coefficient for each monitoring surface. */ - *Surface_CFz, /*!< \brief z Force coefficient for each monitoring surface. */ - *Surface_CMx, /*!< \brief x Moment coefficient for each monitoring surface. */ - *Surface_CMy, /*!< \brief y Moment coefficient for each monitoring surface. */ - *Surface_CMz, /*!< \brief z Moment coefficient for each monitoring surface. */ - *Surface_CEff; /*!< \brief Efficiency (Cl/Cd) for each monitoring surface. */ - - unsigned long nDOFsLocTot; /*!< \brief Total number of local DOFs, including halos. */ - unsigned long nDOFsLocOwned; /*!< \brief Number of owned local DOFs. */ - unsigned long nDOFsGlobal; /*!< \brief Number of global DOFs. */ - - unsigned long nVolElemTot; /*!< \brief Total number of local volume elements, including halos. */ - unsigned long nVolElemOwned; /*!< \brief Number of owned local volume elements. */ - CVolumeElementFEM *volElem; /*!< \brief Array of the local volume elements, including halos. */ - - const unsigned long *nVolElemOwnedPerTimeLevel; /*!< \brief Number of owned local volume elements - per time level. Cumulative storage. */ - const unsigned long *nVolElemInternalPerTimeLevel; /*!< \brief Number of internal local volume elements per - time level. Internal means that the solution - data does not need to be communicated. */ - const unsigned long *nVolElemHaloPerTimeLevel; /*!< \brief Number of halo volume elements - per time level. Cumulative storage. */ - - vector > ownedElemAdjLowTimeLevel; /*!< \brief List of owned elements per time level that are - adjacent to elements of the lower time level. */ - vector > haloElemAdjLowTimeLevel; /*!< \brief List of halo elements per time level that are - adjacent to elements of the lower time level. */ - - unsigned long nMeshPoints; /*!< \brief Number of mesh points in the local part of the grid. */ - CPointFEM *meshPoints; /*!< \brief Array of the points of the FEM mesh. */ - - const unsigned long *nMatchingInternalFacesWithHaloElem; /*!< \brief Number of local matching internal faces per time level - between an owned and a halo element. Cumulative storage. */ - const unsigned long *nMatchingInternalFacesLocalElem; /*!< \brief Number of local matching internal faces per time level - between local elements. Cumulative storage. */ - - CInternalFaceElementFEM *matchingInternalFaces; /*!< \brief Array of the local matching internal faces. */ - CBoundaryFEM *boundaries; /*!< \brief Array of the boundaries of the FEM mesh. */ - - unsigned short nStandardBoundaryFacesSol; /*!< \brief Number of standard boundary faces used for solution of the DG solver. */ - unsigned short nStandardElementsSol; /*!< \brief Number of standard volume elements used for solution of the DG solver. */ - unsigned short nStandardMatchingFacesSol; /*!< \brief Number of standard matching internal faces used for solution of the DG solver. */ - - const CFEMStandardBoundaryFace *standardBoundaryFacesSol; /*!< \brief Array that contains the standard boundary - faces used for the solution of the DG solver. */ - const CFEMStandardElement *standardElementsSol; /*!< \brief Array that contains the standard volume elements - used for the solution of the DG solver. */ - const CFEMStandardInternalFace *standardMatchingFacesSol; /*!< \brief Array that contains the standard matching - internal faces used for the solution of - the DG solver. */ - - const su2double *timeCoefADER_DG; /*!< \brief The time coefficients in the iteration matrix of - the ADER-DG predictor step. */ - const su2double *timeInterpolDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs and - the time integration points for ADER-DG. */ - const su2double *timeInterpolAdjDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs of adjacent - elements of a higher time level and the time integration - points for ADER-DG. */ - - unsigned int sizeWorkArray; /*!< \brief The size of the work array needed. */ - - vector TolSolADER; /*!< \brief Vector, which stores the tolerances for the conserved - variables in the ADER predictor step. */ - - vector VecSolDOFs; /*!< \brief Vector, which stores the solution variables in the owned DOFs. */ - vector VecSolDOFsNew; /*!< \brief Vector, which stores the new solution variables in the owned DOFs (needed for classical RK4 scheme). */ - vector VecDeltaTime; /*!< \brief Vector, which stores the time steps of the owned volume elements. */ - - vector VecSolDOFsPredictorADER; /*!< \brief Vector, which stores the ADER predictor solution in the owned - DOFs. These are both space and time DOFs. */ - - vector > VecWorkSolDOFs; /*!< \brief Working double vector to store the conserved variables for - the DOFs for the different time levels. */ - - vector VecResDOFs; /*!< \brief Vector, which stores the residuals in the owned DOFs. */ - vector VecResFaces; /*!< \brief Vector, which stores the residuals of the DOFs that - come from the faces, both boundary and internal. */ - vector VecTotResDOFsADER; /*!< \brief Vector, which stores the accumulated residuals of the - owned DOFs for the ADER corrector step. */ - - - vector nEntriesResFaces; /*!< \brief Number of entries for the DOFs in the - residual of the faces. Cumulative storage. */ - vector entriesResFaces; /*!< \brief The corresponding entries in the residual of the faces. */ - - vector nEntriesResAdjFaces; /*!< \brief Number of entries for the DOFs in the residual of the faces, - where the face is adjacent to an element of lower time - level. Cumulative storage. */ - vector entriesResAdjFaces; /*!< \brief The corresponding entries in the residual of the faces. */ - - vector > startLocResFacesMarkers; /*!< \brief The starting location in the residual of the - faces for the time levels of the boundary - markers. */ - - vector startLocResInternalFacesLocalElem; /*!< \brief The starting location in the residual of the - faces for the time levels of internal faces - between locally owned elements. */ - vector startLocResInternalFacesWithHaloElem; /*!< \brief The starting location in the residual of the - faces for the time levels of internal faces - between an owned and a halo element. */ - - bool symmetrizingTermsPresent; /*!< \brief Whether or not symmetrizing terms are present in the - discretization. */ - - vector nDOFsPerRank; /*!< \brief Number of DOFs per rank in - cumulative storage format. */ - vector > nonZeroEntriesJacobian; /*!< \brief The ID's of the DOFs for the - non-zero entries of the Jacobian - for the locally owned DOFs. */ - - int nGlobalColors; /*!< \brief Number of global colors for the Jacobian computation. */ - - vector > localDOFsPerColor; /*!< \brief Double vector, which contains for every - color the local DOFs. */ - vector > colorToIndEntriesJacobian; /*!< \brief Double vector, which contains for every - local DOF the mapping from the color to the - entry in the Jacobian. A -1 indicates that - the color does not contribute to the Jacobian - of the DOF. */ - - CBlasStructure *blasFunctions; /*!< \brief Pointer to the object to carry out the BLAS functionalities. */ - -private: - -#ifdef HAVE_MPI - vector > commRequests; /*!< \brief Communication requests in the communication of the solution for all - time levels. These are both sending and receiving requests. */ - - vector > > elementsRecvMPIComm; /*!< \brief Triple vector, which contains the halo elements - for MPI communication for all time levels. */ - vector > > elementsSendMPIComm; /*!< \brief Triple vector, which contains the donor elements - for MPI communication for all time levels. */ - - vector > ranksRecvMPI; /*!< \brief Double vector, which contains the ranks from which the halo elements - are received for all time levels. */ - vector > ranksSendMPI; /*!< \brief Double vector, which contains the ranks to which the donor elements - are sent for all time levels. */ - - vector > > commRecvBuf; /*!< \brief Receive buffers used to receive the solution data - in the communication pattern for all time levels. */ - vector > > commSendBuf; /*!< \brief Send buffers used to send the solution data - in the communication pattern for all time levels. */ -#endif - - vector > elementsRecvSelfComm; /*!< \brief Double vector, which contains the halo elements - for self communication for all time levels. */ - vector > elementsSendSelfComm; /*!< \brief Double vector, which contains the donor elements - for self communication for all time levels. */ - - vector rotationMatricesPeriodicity; /*!< \brief Vector, which contains the rotation matrices - for the rotational periodic transformations. */ - vector > > halosRotationalPeriodicity; /*!< \brief Triple vector, which contains the indices - of halo elements for which a periodic - transformation must be applied for all - time levels. */ - - vector tasksList; /*!< \brief List of tasks to be carried out in the computationally - intensive part of the solver. */ - - CVariable* GetBaseClassPointerToNodes() {return nullptr;} - -public: - - /*! - * \brief Constructor of the class. - */ - CFEM_DG_EulerSolver(void); - - /*! - * \overload - * \param[in] config - Definition of the particular problem. - * \param[in] val_nDim - Dimension of the problem (2D or 3D). - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CFEM_DG_EulerSolver(CConfig *config, unsigned short val_nDim, unsigned short iMesh); - - /*! - * \overload - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - CFEM_DG_EulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh); - - /*! - * \brief Destructor of the class. - */ - virtual ~CFEM_DG_EulerSolver(void); - - /*! - * \brief Set the fluid solver nondimensionalization. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] writeOutput - Whether or not output must be written. - */ - void SetNondimensionalization(CConfig *config, - unsigned short iMesh, - const bool writeOutput); - using CSolver::SetNondimensionalization; - - /*! - * \brief Get a pointer to the vector of the solution degrees of freedom. - * \return Pointer to the vector of the solution degrees of freedom. - */ - su2double* GetVecSolDOFs(void); - - /*! - * \brief Get the global number of solution degrees of freedom for the calculation. - * \return Global number of solution degrees of freedom - */ - unsigned long GetnDOFsGlobal(void); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - CFluidModel* GetFluidModel(void); - - /*! - * \brief Compute the density at the infinity. - * \return Value of the density at the infinity. - */ - su2double GetDensity_Inf(void); - - /*! - * \brief Compute 2-norm of the velocity at the infinity. - * \return Value of the 2-norm of the velocity at the infinity. - */ - su2double GetModVelocity_Inf(void); - - /*! - * \brief Compute the density multiply by energy at the infinity. - * \return Value of the density multiply by energy at the infinity. - */ - su2double GetDensity_Energy_Inf(void); - - /*! - * \brief Compute the pressure at the infinity. - * \return Value of the pressure at the infinity. - */ - su2double GetPressure_Inf(void); - - /*! - * \brief Compute the density multiply by velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the density multiply by the velocity at the infinity. - */ - su2double GetDensity_Velocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \param[in] val_dim - Index of the velocity vector. - * \return Value of the velocity at the infinity. - */ - su2double GetVelocity_Inf(unsigned short val_dim); - - /*! - * \brief Get the velocity at the infinity. - * \return Value of the velocity at the infinity. - */ - su2double *GetVelocity_Inf(void); - - /*! - * \brief Set the freestream pressure. - * \param[in] Value of freestream pressure. - */ - void SetPressure_Inf(su2double p_inf); - - /*! - * \brief Set the freestream temperature. - * \param[in] Value of freestream temperature. - */ - void SetTemperature_Inf(su2double t_inf); - - /*! - * \brief Set the initial condition for the Euler Equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] ExtIter - External iteration. - */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, - CConfig *config, unsigned long TimeIter); - - /*! - * \brief Set the working solution of the first time level to the current - solution. Used for Runge-Kutta type schemes. - * \param[in] geometry - Geometrical definition of the problem. - */ - void Set_OldSolution(CGeometry *geometry); - - /*! - * \brief Set the new solution to the current solution for classical RK. - * \param[in] geometry - Geometrical definition of the problem. - */ - void Set_NewSolution(CGeometry *geometry); - - /*! - * \brief Function to compute the time step for solving the Euler equations. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] Iteration - Value of the current iteration. - */ - void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration); - - /*! - * \brief Function, which checks whether or not the time synchronization point is reached - when explicit time stepping is used. - * \param[in] config - Definition of the particular problem. - * \param[in] TimeSync - The synchronization time. - * \param[in,out] timeEvolved - On input the time evolved before the time step, - on output the time evolved after the time step. - * \param[out] syncTimeReached - Whether or not the synchronization time is reached. - */ - void CheckTimeSynchronization(CConfig *config, - const su2double TimeSync, - su2double &timeEvolved, - bool &syncTimeReached); - - /*! - * \brief Function, which processes the list of tasks to be executed by - the DG solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void ProcessTaskList_DG(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh); - - /*! - * \brief Function, to carry out the space time integration for ADER - with time accurate local time stepping. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void ADER_SpaceTimeIntegration(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Function, which controls the computation of the spatial Jacobian. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void ComputeSpatialJacobian(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem); - - /*! - * \brief Function, which determines the values of the tolerances in - the predictor step of ADER-DG. - */ - void TolerancesADERPredictorStep(void); - - /*! - * \brief Function, carries out the predictor step of the ADER-DG - time integration. - * \param[in] config - Definition of the particular problem. - * \param[in] elemBeg - Begin index of the element range to be computed. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - * \param[out] workArray - Work array. - */ - void ADER_DG_PredictorStep(CConfig *config, - const unsigned long elemBeg, - const unsigned long elemEnd, - su2double *workArray); - - /*! - * \brief Function, which interpolates the predictor solution of ADER-DG - to the time value that corresponds to iTime. - * \param[in] config - Definition of the particular problem. - * \param[in] iTime - Time index of the time integration point for the - integration over the time slab in the corrector - step of ADER-DG. - * \param[in] elemBeg - Begin index of the element range to be computed. This - range is for elements of the same time level. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - * \param[in] nAdjElem - Number of elements of the next time level, which are - adjacent to elements of the current time level. - * \param[in] adjElem - The ID's of the adjacent elements. - * \param[in] secondPartTimeInt - Whether or not this is the second part of the - time interval for the adjacent elements. - * \param[out] solTimeLevel - Array in which the interpolated solution for the - time level considered must be stored. - */ - void ADER_DG_TimeInterpolatePredictorSol(CConfig *config, - const unsigned short iTime, - const unsigned long elemBeg, - const unsigned long elemEnd, - const unsigned long nAdjElem, - const unsigned long *adjElem, - const bool secondPartTimeInt, - su2double *solTimeLevel); - - /*! - * \brief Compute the artificial viscosity for shock capturing in DG. It is a virtual - function, because this function is overruled for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] elemBeg - Begin index of the element range to be computed. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - * \param[out] workArray - Work array. - */ - virtual void Shock_Capturing_DG(CConfig *config, - const unsigned long elemBeg, - const unsigned long elemEnd, - su2double *workArray); - - /*! - * \brief Compute the volume contributions to the spatial residual. It is a virtual - function, because this function is overruled for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] elemBeg - Begin index of the element range to be computed. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - * \param[out] workArray - Work array. - */ - virtual void Volume_Residual(CConfig *config, - const unsigned long elemBeg, - const unsigned long elemEnd, - su2double *workArray); - - /*! - * \brief Function, which computes the spatial residual for the DG discretization. - * \param[in] timeLevel - Time level of the time accurate local time stepping, - if relevant. - * \param[in] config - Definition of the particular problem. - * \param[in] numerics - Description of the numerical method. - * \param[in] haloInfoNeededForBC - If true, treat boundaries for which halo data is needed. - If false, treat boundaries for which only owned data is needed. - * \param[out] workArray - Work array. - */ - void Boundary_Conditions(const unsigned short timeLevel, - CConfig *config, - CNumerics **numerics, - const bool haloInfoNeededForBC, - su2double *workArray); - - /*! - * \brief Compute the spatial residual for the given range of faces. It is a virtual - function, because this function is overruled for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] indFaceBeg - Starting index in the matching faces. - * \param[in] indFaceEnd - End index in the matching faces. - * \param[in,out] indResFaces - Index where to store the residuals in - the vector of face residuals. - * \param[in] numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void ResidualFaces(CConfig *config, - const unsigned long indFaceBeg, - const unsigned long indFaceEnd, - unsigned long &indResFaces, - CNumerics *numerics, - su2double *workArray); - - /*! - * \brief Function, which accumulates the space time residual of the ADER-DG - time integration scheme for the owned elements. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - time level for which the residuals must be - accumulated. - * \param[in] intPoint - Index of the time integration point. - */ - void AccumulateSpaceTimeResidualADEROwnedElem(CConfig *config, - const unsigned short timeLevel, - const unsigned short intPoint); - - /*! - * \brief Function, which accumulates the space time residual of the ADER-DG - time integration scheme for the halo elements. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - time level for which the residuals must be - accumulated. - * \param[in] intPoint - Index of the time integration point. - */ - void AccumulateSpaceTimeResidualADERHaloElem(CConfig *config, - const unsigned short timeLevel, - const unsigned short intPoint); - - /*! - * \brief Compute primitive variables and their gradients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iStep - Current step in the time accurate local time - stepping algorithm, if appropriate. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned short iStep, unsigned short RunTime_EqSystem, bool Output); - - /*! - * \brief - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh); - - /*! - * \brief Impose via the residual the Euler wall boundary condition. It is a - virtual function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void BC_Euler_Wall(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - su2double *workArray); - using CSolver::BC_Euler_Wall; - - /*! - * \brief Impose the far-field boundary condition. It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void BC_Far_Field(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - su2double *workArray); - using CSolver::BC_Far_Field; - - /*! - * \brief Impose the symmetry boundary condition. It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void BC_Sym_Plane(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - su2double *workArray); - using CSolver::BC_Sym_Plane; - - /*! - * \brief Impose the supersonic outlet boundary condition. It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void BC_Supersonic_Outlet(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - su2double *workArray); - using CSolver::BC_Supersonic_Outlet; - - /*! - * \brief Impose the subsonic inlet boundary condition. It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[out] workArray - Work array. - */ - virtual void BC_Inlet(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray); - using CSolver::BC_Inlet; - - /*! - * \brief Impose the outlet boundary condition.It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[out] workArray - Work array. - */ - virtual void BC_Outlet(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray); - using CSolver::BC_Outlet; - - /*! - * \brief Impose a constant heat-flux condition at the wall. It is a virtual - function, such that it can be overwritten for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[out] workArray - Work array. - */ - virtual void BC_HeatFlux_Wall(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray); - using CSolver::BC_HeatFlux_Wall; - - /*! - * \brief Impose an isothermal condition at the wall. It is a virtual - function, such that it can be overwritten for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[out] workArray - Work array. - */ - virtual void BC_Isothermal_Wall(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray); - using CSolver::BC_Isothermal_Wall; - - /*! - * \brief Impose the boundary condition using characteristic reconstruction. It is - * a virtual function, such that it can be overwritten for Navier-Stokes. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[out] workArray - Work array. - */ - virtual void BC_Riemann(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray); - using CSolver::BC_Riemann; - - /*! - * \brief Impose the user customized boundary condition. It is a virtual - function, because for Navier-Stokes it is overwritten. - * \param[in] config - Definition of the particular problem. - * \param[in] surfElemBeg - Start index in the list of surface elements. - * \param[in] surfElemEnd - End index (not included) in the list of surface elements. - * \param[in] surfElem - Array of surface elements for which the boundary - conditions must be imposed. - * \param[out] resFaces - Array where the residual contribution from the - surface elements must be stored. - * \param[in] conv_numerics - Description of the numerical method. - * \param[out] workArray - Work array. - */ - virtual void BC_Custom(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - su2double *workArray); - using CSolver::BC_Custom; - - /*! - * \brief Update the solution using a Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using the classical fourth-order Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - */ - void ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep); - - /*! - * \brief Update the solution using the classical fourth-order Runge-Kutta scheme. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetResidual_RMS_FEM(CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute the global error measures (L2, Linf) for verification cases. - * \param[in] geometry - Geometrical definition. - * \param[in] config - Definition of the particular problem. - */ - void ComputeVerificationError(CGeometry *geometry, CConfig *config); - - /*! - * \brief Update the solution for the ADER-DG scheme for the given range - of elements. - * \param[in] elemBeg - Begin index of the element range to be computed. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - */ - void ADER_DG_Iteration(const unsigned long elemBeg, - const unsigned long elemEnd); - - /*! - * \brief Compute the pressure forces and all the adimensional coefficients. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Pressure_Forces(CGeometry *geometry, CConfig *config); - - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - - /*! - * \brief Provide the non dimensional lift coefficient (inviscid contribution). - * \param val_marker Surface where the coefficient is going to be computed. - * \return Value of the lift coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCL_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient (inviscid contribution). - * \param val_marker Surface where the coefficient is going to be computed. - * \return Value of the z moment coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCMz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional lift coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the lift coefficient on the surface val_marker. - */ - su2double GetSurface_CL_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient on the surface val_marker. - */ - su2double GetSurface_CD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional side-force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the side-force coefficient on the surface val_marker. - */ - su2double GetSurface_CEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x force coefficient on the surface val_marker. - */ - su2double GetSurface_CFx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y force coefficient on the surface val_marker. - */ - su2double GetSurface_CFy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z force coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z force coefficient on the surface val_marker. - */ - su2double GetSurface_CFz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional x moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the x moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMx_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional y moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the y moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMy_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional z moment coefficient. - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient on the surface val_marker. - */ - su2double GetSurface_CMz_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional drag coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the drag coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCD_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional sideforce coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the sideforce coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCSF_Inv(unsigned short val_marker); - - /*! - * \brief Provide the non dimensional efficiency coefficient (inviscid contribution). - * \param val_marker Surface where the coeficient is going to be computed. - * \return Value of the efficiency coefficient (inviscid contribution) on the surface val_marker. - */ - su2double GetCEff_Inv(unsigned short val_marker); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CSF(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CEff(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional lift coefficient. - * \param[in] val_Total_CL - Value of the total lift coefficient. - */ - void SetTotal_CL(su2double val_Total_CL); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional lift coefficient. - * \return Value of the lift coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CL(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional drag coefficient. - * \return Value of the drag coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CD(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x moment coefficient. - * \return Value of the moment x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y moment coefficient. - * \return Value of the moment y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z moment coefficient. - * \return Value of the moment z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CMz(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional x force coefficient. - * \return Value of the force x coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFx(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional y force coefficient. - * \return Value of the force y coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFy(void); - - /*! - * \brief Provide the total (inviscid + viscous) non dimensional z force coefficient. - * \return Value of the force z coefficient (inviscid + viscous contribution). - */ - su2double GetTotal_CFz(void); - - /*! - * \brief Store the total (inviscid + viscous) non dimensional drag coefficient. - * \param[in] val_Total_CD - Value of the total drag coefficient. - */ - void SetTotal_CD(su2double val_Total_CD); - - /*! - * \brief Get the inviscid contribution to the lift coefficient. - * \return Value of the lift coefficient (inviscid contribution). - */ - su2double GetAllBound_CL_Inv(void); - - /*! - * \brief Get the inviscid contribution to the drag coefficient. - * \return Value of the drag coefficient (inviscid contribution). - */ - su2double GetAllBound_CD_Inv(void); - - /*! - * \brief Get the inviscid contribution to the sideforce coefficient. - * \return Value of the sideforce coefficient (inviscid contribution). - */ - su2double GetAllBound_CSF_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CEff_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CMz_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFx_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFy_Inv(void); - - /*! - * \brief Get the inviscid contribution to the efficiency coefficient. - * \return Value of the efficiency coefficient (inviscid contribution). - */ - su2double GetAllBound_CFz_Inv(void); - -protected: - - /*! - * \brief Routine that initiates the non-blocking communication between ranks - for the givem time level. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - The time level for which the communication must be - initiated. - */ - void Initiate_MPI_Communication(CConfig *config, - const unsigned short timeLevel); - - /*! - * \brief Routine that initiates the reverse non-blocking communication - between ranks. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - The time level for which the reverse communication - must be initiated. - */ - void Initiate_MPI_ReverseCommunication(CConfig *config, - const unsigned short timeLevel); - - /*! - * \brief Routine that completes the non-blocking communication between ranks. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - The time level for which the communication - may be completed. - * \param[in] commMustBeCompleted - Whether or not the communication must be completed. - * \return Whether or not the communication has been completed. - */ - bool Complete_MPI_Communication(CConfig *config, - const unsigned short timeLevel, - const bool commMustBeCompleted); - - /*! - * \brief Routine that completes the reverse non-blocking communication - between ranks. - * \param[in] config - Definition of the particular problem. - * \param[in] timeLevel - The time level for which the communication - may be completed. - * \param[in] commMustBeCompleted - Whether or not the communication must be completed. - * \return Whether or not the communication has been completed. - */ - bool Complete_MPI_ReverseCommunication(CConfig *config, - const unsigned short timeLevel, - const bool commMustBeCompleted); - - /*! - * \brief Function, which computes the inviscid fluxes in face points. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] nPoints - Number of points per face for which the fluxes - must be computed. - * \param[in] normalsFace - The normals in the points for the faces. - * \param[in] gridVelsFace - The grid velocities in the points for the faces. - * \param[in] solL - Solution in the left state of the points. - * \param[in] solR - Solution in the right state of the points. - * \param[out] fluxes - Inviscid fluxes in the points. - * \param[in] numerics - Object, which contains the Riemann solver. - */ - void ComputeInviscidFluxesFace(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const unsigned long nPoints, - const su2double *normalsFace[], - const su2double *gridVelsFace[], - const su2double *solL, - const su2double *solR, - su2double *fluxes, - CNumerics *numerics); - - /*! - * \brief Function, which computes the inviscid fluxes in the face integration - points of a chunk of matching internal faces. - * \param[in] config - Definition of the particular problem. - * \param[in] lBeg - Start index in matchingInternalFaces for which - the inviscid fluxes should be computed. - * \param[in] lEnd - End index (not included) in matchingInternalFaces - for which the inviscid fluxes should be computed. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[out] solIntL - Solution in the left state of the integration points. - * \param[out] solIntR - Solution in the right state of the integration points. - * \param[out] fluxes - Inviscid fluxes in the integration points. - * \param[in] numerics - Object, which contains the Riemann solver. - */ - void InviscidFluxesInternalMatchingFace(CConfig *config, - const unsigned long lBeg, - const unsigned long lEnd, - const unsigned short NPad, - su2double *solIntL, - su2double *solIntR, - su2double *fluxes, - CNumerics *numerics); - /*! - * \brief Function, which computes the left state of a boundary face. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary elements for which the left state must be computed. - * \param[out] solFace - Temporary storage for the solution in the DOFs. - * \param[out] solIntL - Left states in the integration points of the face. - */ - void LeftStatesIntegrationPointsBoundaryFace(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - su2double *solFace, - su2double *solIntL); - - /*! - * \brief Function, which computes the boundary states in the integration points - of the boundary face by applying the inviscid wall boundary conditions. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary elements for which the left state must - be computed. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] solIntR - Right states in the integration points of the face. - */ - void BoundaryStates_Euler_Wall(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - const su2double *solIntL, - su2double *solIntR); - - /*! - * \brief Function, which computes the boundary states in the integration points - of the boundary face by applying the inlet boundary conditions. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of fused faces, i.e. the number of faces - that are treated simultaneously to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary element for which the left state must be computed. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] solIntR - Right states in the integration points of the face. - */ - void BoundaryStates_Inlet(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - unsigned short val_marker, - const su2double *solIntL, - su2double *solIntR); - - /*! - * \brief Function, which computes the boundary states in the integration points - of the boundary face by applying the outlet boundary conditions. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of fused faces, i.e. the number of faces - that are treated simultaneously to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary element for which the left state must be computed. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] solIntR - Right states in the integration points of the face. - */ - void BoundaryStates_Outlet(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - unsigned short val_marker, - const su2double *solIntL, - su2double *solIntR); - - /*! - * \brief Function, which computes the boundary states in the integration points - of the boundary face by applying the Riemann boundary conditions. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of fused faces, i.e. the number of faces - that are treated simultaneously to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary element for which the left state must be computed. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] solIntR - Right states in the integration points of the face. - */ - void BoundaryStates_Riemann(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - unsigned short val_marker, - const su2double *solIntL, - su2double *solIntR); -private: - - /*! - * \brief Virtual function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using an - aliased discretization in 2D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - virtual void ADER_DG_AliasedPredictorResidual_2D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - - /*! - * \brief Virtual function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using an - aliased discretization in 3D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - virtual void ADER_DG_AliasedPredictorResidual_3D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - - /*! - * \brief Virtual function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using a - non-aliased discretization in 2D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - virtual void ADER_DG_NonAliasedPredictorResidual_2D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - - /*! - * \brief Virtual function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using a - non-aliased discretization in 3D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - virtual void ADER_DG_NonAliasedPredictorResidual_3D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - - /*! - * \brief Function, which computes the graph of the spatial discretization - for the locally owned DOFs. - * \param[in] DGGeometry - Geometrical definition of the DG problem. - * \param[in] config - Definition of the particular problem. - */ - void DetermineGraphDOFs(const CMeshFEM *FEMGeometry, - CConfig *config); - - /*! - * \brief Function, which determines the meta data needed for the computation - of the Jacobian of the spatial residual. - * \param[in] DGGeometry - Geometrical definition of the DG problem. - * \param[in] colorLocalDOFs - Color of the locally stored DOFs. - */ - void MetaDataJacobianComputation(const CMeshFEM *FEMGeometry, - const vector &colorLocalDOFs); - - /*! - * \brief Function, which sets up the list of tasks to be carried out in the - computationally expensive part of the solver. - * \param[in] config - Definition of the particular problem. - */ - void SetUpTaskList(CConfig *config); - - /*! - * \brief Function, which sets up the persistent communication of the flow - variables in the DOFs. - * \param[in] DGGeometry - Geometrical definition of the DG problem. - * \param[in] config - Definition of the particular problem. - */ - void Prepare_MPI_Communication(const CMeshFEM *FEMGeometry, - CConfig *config); - - /*! - * \brief Function, which creates the final residual by summing up - the contributions for the DOFs of the elements considered. - * \param[in] timeLevel - Time level of the elements for which the - final residual must be created. - * \param[in] ownedElements - Whether owned or halo elements must be treated. - */ - void CreateFinalResidual(const unsigned short timeLevel, - const bool ownedElements); - - /*! - * \brief Function, which multiplies the residual by the inverse - of the (lumped) mass matrix. - * \param[in] config - Definition of the particular problem. - * \param[in] useADER - Whether or not the ADER residual must be multiplied. - * \param[in] elemBeg - Begin index of the element range to be computed. - * \param[in] elemEnd - End index (not included) of the element range to be computed. - * \param[out] workArray - Work array. - */ - void MultiplyResidualByInverseMassMatrix(CConfig *config, - const bool useADER, - const unsigned long elemBeg, - const unsigned long elemEnd, - su2double *workArray); - - /*! - * \brief Function, which computes the residual contribution from a boundary - face in an inviscid computation when the boundary conditions have - already been applied. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] surfElem - Surface boundary element for which the - contribution to the residual must be computed. - * \param[in] solInt0 - Solution in the integration points of side 0. - It is not const, because the array is used for - temporary storage for the residual. - * \param[in] solInt1 - Solution in the integration points of side 1. - * \param[out] fluxes - Temporary storage for the fluxes in the - integration points. - * \param[out] resFaces - Array to store the residuals of the face. - * \param[in,out] indResFaces - Index in resFaces, where the current residual - should be stored. It is updated in the function - for the next boundary element. - */ - void ResidualInviscidBoundaryFace(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - CNumerics *conv_numerics, - const CSurfaceElementFEM *surfElem, - su2double *solInt0, - su2double *solInt1, - su2double *fluxes, - su2double *resFaces, - unsigned long &indResFaces); - -protected: - /*! - * \brief Template function, which determines some meta data for the chunk of - elements/faces that must be treated simulaneously. - * \param[in] elem - Const pointer the volume or face elements for which - the meta data must be computed. - * \param[in] l - Start index for the current chunk of elements/faces. - * \param[in] elemEnd - End index (index not included) of the elements to be - treated in the residual computation from which this - function is called. - * \param[in] nElemSimul - Desired number of elements/faces that must be treated - simultaneously for optimal performance. - * \param[in] nPadMin - Minimum number of the padding value in the gemm calls. - * \param[out] lEnd - Actual end index (not included) for this chunk of - elements. - * \param[out] ind - Index in the standard elements to which this chunk of - elements can be mapped. - * \param[out] llEnd - Actual number of elements/faces that are treated - simultaneously, llEnd = lEnd - l. - * \param[out] NPad - Actual padded N value in the gemm computations for - this chunk of elements. - */ - template - void MetaDataChunkOfElem(const TElemType *elem, - const unsigned long l, - const unsigned long elemEnd, - const unsigned short nElemSimul, - const unsigned short nPadMin, - unsigned long &lEnd, - unsigned short &ind, - unsigned short &llEnd, - unsigned short &NPad) { - - /* Determine the end index for this chunk of elements that must be - treated simulaneously. The elements of this chunk must have the - same standard element in order to make this work. */ - const unsigned long lEndMax = min(l+nElemSimul, elemEnd); - - ind = elem[l].indStandardElement; - for(lEnd=l+1; lEndval_marker. - */ - su2double GetCL_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional z moment coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the z moment coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCMz_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional sideforce coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the sideforce coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCSF_Visc(unsigned short val_marker); - - /*! - * \brief Get the non dimensional drag coefficient (viscous contribution). - * \param[in] val_marker - Surface marker where the coefficient is computed. - * \return Value of the drag coefficient (viscous contribution) on the surface val_marker. - */ - su2double GetCD_Visc(unsigned short val_marker); - - /*! - * \brief Get the total non dimensional lift coefficient (viscous contribution). - * \return Value of the lift coefficient (viscous contribution). - */ - su2double GetAllBound_CL_Visc(void); - - /*! - * \brief Get the total non dimensional sideforce coefficient (viscous contribution). - * \return Value of the lift coefficient (viscous contribution). - */ - su2double GetAllBound_CSF_Visc(void); - - /*! - * \brief Get the total non dimensional drag coefficient (viscous contribution). - * \return Value of the drag coefficient (viscous contribution). - */ - su2double GetAllBound_CD_Visc(void); - - /*! - * \brief Get the max Omega. - * \return Value of the max Omega. - */ - su2double GetOmega_Max(void); - - /*! - * \brief Get the max Strain rate magnitude. - * \return Value of the max Strain rate magnitude. - */ - su2double GetStrainMag_Max(void); - - /*! - * \brief A virtual member. - * \return Value of the StrainMag_Max - */ - void SetStrainMag_Max(su2double val_strainmag_max); - - /*! - * \brief A virtual member. - * \return Value of the Omega_Max - */ - void SetOmega_Max(su2double val_omega_max); - -private: - - /*! - * \brief Function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using an - aliased discretization in 2D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - void ADER_DG_AliasedPredictorResidual_2D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - -/*! - * \brief Function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using an - aliased discretization in 3D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - void ADER_DG_AliasedPredictorResidual_3D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - /*! - * \brief Function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using a - non-aliased discretization in 2D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - void ADER_DG_NonAliasedPredictorResidual_2D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - - /*! - * \brief Function, which computes the spatial residual of the ADER-DG - predictor step for the given volume element and solution using a - non-aliased discretization in 3D. - * \param[in] config - Definition of the particular problem. - * \param[in] elem - Volume element for which the spatial residual of the - predictor step must be computed. - * \param[in] sol - Solution for which the residual must be computed. - * \param[in] nSimul - Number of entities (typically time integration points) - that are treated simultaneously. - * \param[in] NPad - Padded N value in the matrix multiplications to - obtain better performance. The solution sol is stored - with this padded value to avoid a memcpy. - * \param[out] res - Residual of the spatial DOFs to be computed by this - function. - * \param[out] work - Work array. - */ - void ADER_DG_NonAliasedPredictorResidual_3D(CConfig *config, - CVolumeElementFEM *elem, - const su2double *sol, - const unsigned short nSimul, - const unsigned short NPad, - su2double *res, - su2double *work); - /*! - * \brief Function to compute the penalty terms in the integration - points of a face. - * \param[in] indFaceChunk - Index of the face in the chunk of fused faces. - * \param[in] nInt - Number of integration points of the face. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] solInt0 - Solution in the integration points of side 0. - * \param[in] solInt1 - Solution in the integration points of side 1. - * \param[in] viscosityInt0 - Viscosity in the integration points of side 0. - * \param[in] viscosityInt1 - Viscosity in the integration points of side 1. - * \param[in] kOverCvInt0 - Heat conductivity divided by Cv in the - integration points of side 0. - * \param[in] kOverCvInt1 - Heat conductivity divided by Cv in the - integration points of side 1. - * \param[in] ConstPenFace - Penalty constant for this face. - * \param[in] lenScale0 - Length scale of the element of side 0. - * \param[in] lenScale1 - Length scale of the element of side 1. - * \param[in] metricNormalsFace - Metric terms in the integration points, which - contain the normals. - * \param[out] penaltyFluxes - Penalty fluxes in the integration points. - */ - void PenaltyTermsFluxFace(const unsigned short indFaceChunk, - const unsigned short nInt, - const unsigned short NPad, - const su2double *solInt0, - const su2double *solInt1, - const su2double *viscosityInt0, - const su2double *viscosityInt1, - const su2double *kOverCvInt0, - const su2double *kOverCvInt1, - const su2double ConstPenFace, - const su2double lenScale0, - const su2double lenScale1, - const su2double *metricNormalsFace, - su2double *penaltyFluxes); - - /*! - * \brief Function, which performs the treatment of the boundary faces for - the Navier-Stokes equations for the most of the boundary conditions. - * \param[in] config - Definition of the particular problem. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] Wall_HeatFlux - The value of the prescribed heat flux. - * \param[in] HeatFlux_Prescribed - Whether or not the heat flux is prescribed by - e.g. the boundary conditions. - * \param[in] Wall_Temperature - The value of the prescribed wall temperature. - * \param[in] Temperature_Prescribed - Whether or not the temperature is precribed - by e.g. the boundary conditions. - * \param[in] surfElem - Surface boundary elements for which the - residuals mut be computed. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[in] solIntR - Right states in the integration points of the face. - * \param[out] workArray - Storage for the local arrays. - * \param[out] resFaces - Array to store the residuals of the face. - * \param[in,out] indResFaces - Index in resFaces, where the current residual - should be stored. It is updated in the function - for the next boundary element. - * \param[in,out] wallModel - Possible pointer to the wall model treatment. - NULL pointer indicates no wall model treatment. - */ - void ViscousBoundaryFacesBCTreatment(CConfig *config, - CNumerics *conv_numerics, - const unsigned short nFaceSimul, - const unsigned short NPad, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - const CSurfaceElementFEM *surfElem, - const su2double *solIntL, - const su2double *solIntR, - su2double *workArray, - su2double *resFaces, - unsigned long &indResFaces, - CWallModel *wallModel); - - /*! - * \brief Function, which computes the viscous fluxes in the integration - points for the boundary faces that must be treated simulaneously. - This function uses the standard approach for computing the fluxes, - i.e. no wall modeling. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] nInt - Number of integration points on the face. - * \param[in] nDOFsElem - Number of DOFs of the adjacent element. - * \param[in] Wall_HeatFlux - The value of the prescribed heat flux. - * \param[in] HeatFlux_Prescribed - Whether or not the heat flux is prescribed by - e.g. the boundary conditions. - * \param[in] derBasisElem - Array, which contains the derivatives of the - basis functions of the adjacent element - in the integration points. - * \param[in] surfElem - Surface boundary elements for which the - viscous fluxes must be computed. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] solElem - Storage for the solution in the adjacent elements. - * \param[out] gradSolInt - Storage for the gradients of the solution in the - integration points of the face. - * \param[out] viscFluxes - To be computed viscous fluxes in the - integration points. - * \param[out] viscosityInt - To be computed viscosity in the integration points. - * \param[out] kOverCvInt - To be computed thermal conductivity in the - integration points. - */ - void ComputeViscousFluxesBoundaryFaces(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const unsigned short nInt, - const unsigned short nDOFsElem, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double *derBasisElem, - const CSurfaceElementFEM *surfElem, - const su2double *solIntL, - su2double *solElem, - su2double *gradSolInt, - su2double *viscFluxes, - su2double *viscosityInt, - su2double *kOverCvInt); - - /*! - * \brief Function, which computes the viscous fluxes in the integration - points for the boundary faces that must be treated simulaneously. - The viscous fluxes are computed via a wall modeling approach. - * \param[in] config - Definition of the particular problem. - * \param[in] nFaceSimul - Number of faces that are treated simultaneously - to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] nInt - Number of integration points on the face. - * \param[in] Wall_HeatFlux - The value of the prescribed heat flux. - * \param[in] HeatFlux_Prescribed - Whether or not the heat flux is prescribed by - the boundary conditions. - * \param[in] Wall_Temperature - The value of the prescribed wall temperature. - * \param[in] Temperature_Prescribed - Whether or not the temperature is precribed - by the boundary conditions - * \param[in] surfElem - Surface boundary elements for which the - viscous fluxes must be computed. - * \param[in] solIntL - Left states in the integration points of the face. - * \param[out] workArray - Storage array - * \param[out] viscFluxes - To be computed viscous fluxes in the - integration points. - * \param[out] viscosityInt - To be computed viscosity in the integration points. - * \param[out] kOverCvInt - To be computed thermal conductivity in the - integration points. - * \param[in,out] wallModel - Pointer to the wall model treatment. - */ - void WallTreatmentViscousFluxes(CConfig *config, - const unsigned short nFaceSimul, - const unsigned short NPad, - const unsigned short nInt, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - const CSurfaceElementFEM *surfElem, - const su2double *solIntL, - su2double *workArray, - su2double *viscFluxes, - su2double *viscosityInt, - su2double *kOverCvInt, - CWallModel *wallModel); - - /*! - * \brief Function, which computes the residual contribution from a boundary - face in a viscous computation when the boundary conditions have - already been applied. - * \param[in] config - Definition of the particular problem. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] nFaceSimul - Number of fused faces, i.e. the number of faces - that are treated simultaneously to improve performance. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] surfElem - Surface boundary elements for which the - contribution to the residual must be computed. - * \param[in] solInt0 - Solution in the integration points of side 0. - * \param[in] solInt1 - Solution in the integration points of side 1. - * \param[out] paramFluxes - Array used for temporary storage. - * \param[out] fluxes - Temporary storage for the fluxes in the - integration points. - * \param[in,out] viscFluxes - On input this array contains the viscous fluxes - in the integration points. It is also used for - temporary storage. - * \param[in] viscosityInt - Temporary storage for the viscosity in the - integration points. - * \param[in] kOverCvInt - Temporary storage for the thermal conductivity - over Cv in the integration points. - * \param[out] resFaces - Array to store the residuals of the face. - * \param[in,out] indResFaces - Index in resFaces, where the current residual - should be stored. It is updated in the function - for the next boundary element. - */ - void ResidualViscousBoundaryFace(CConfig *config, - CNumerics *conv_numerics, - const unsigned short nFaceSimul, - const unsigned short NPad, - const CSurfaceElementFEM *surfElem, - const su2double *solInt0, - const su2double *solInt1, - su2double *paramFluxes, - su2double *fluxes, - su2double *viscFluxes, - const su2double *viscosityInt, - const su2double *kOverCvInt, - su2double *resFaces, - unsigned long &indResFaces); - - /*! - * \brief Function to compute the symmetrizing terms in the integration - points of a face. - * \param[in] indFaceChunk - Index of the face in the chunk of fused faces. - * \param[in] nInt - Number of integration points of the face. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] solInt0 - Solution in the integration points of side 0. - * \param[in] solInt1 - Solution in the integration points of side 1. - * \param[in] viscosityInt0 - Viscosity in the integration points of side 0. - * \param[in] viscosityInt1 - Viscosity in the integration points of side 1. - * \param[in] kOverCvInt0 - Heat conductivity divided by Cv in the - integration points of side 0. - * \param[in] kOverCvInt1 - Heat conductivity divided by Cv in the - integration points of side 1. - * \param[in] metricNormalsFace - Metric terms in the integration points, which - contain the normals. - * \param[out] symmFluxes - Symmetrizing fluxes in the integration points. - */ - void SymmetrizingFluxesFace(const unsigned short indFaceChunk, - const unsigned short nInt, - const unsigned short NPad, - const su2double *solInt0, - const su2double *solInt1, - const su2double *viscosityInt0, - const su2double *viscosityInt1, - const su2double *kOverCvInt0, - const su2double *kOverCvInt1, - const su2double *metricNormalsFace, - su2double *symmFluxes); - - /*! - * \brief Function, which transforms the symmetrizing fluxes in the integration points - such that they are suited to be multiplied by the parametric gradients of - the basis functions. - * \param[in] indFaceChunk - Index of the face in the chunk of fused faces. - * \param[in] nInt - Number of integration points of the face. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] halfTheta - Half times the theta parameter in the symmetrizing terms. - * \param[in] symmFluxes - Symmetrizing fluxes to be multiplied by the Cartesian - gradients of the basis functions. - * \param[in] weights - Integration weights of the integration points. - * \param[in] metricCoorFace - Derivatives of the parametric coordinates w.r.t. the - Cartesian coordinates in the integration points of - the face. - * \param[out] paramFluxes - Parametric fluxes in the integration points. - */ - void TransformSymmetrizingFluxes(const unsigned short indFaceChunk, - const unsigned short nInt, - const unsigned short NPad, - const su2double halfTheta, - const su2double *symmFluxes, - const su2double *weights, - const su2double *metricCoorFace, - su2double *paramFluxes); - - /*! - * \brief Function to compute the viscous normal fluxes in the integration points of a face. - * \param[in] adjVolElem - Pointer to the adjacent volume. - * \param[in] indFaceChunk - Index of the face in the chunk of fused faces. - * \param[in] nInt - Number of integration points of the face. - * \param[in] NPad - Value of the padding parameter to obtain optimal - performance in the gemm computations. - * \param[in] Wall_HeatFlux - The value of the prescribed heat flux. - * \param[in] HeatFlux_Prescribed - Whether or not the heat flux is prescribed by - e.g. the boundary conditions. - * \param[in] solInt - Solution in the integration points. - * \param[in] gradSolInt - Gradient of the solution in the integration points. - * \param[in] metricCoorDerivFace - Metric terms in the integration points, which - contain the derivatives of the parametric - coordinates w.r.t. the Cartesian coordinates. - Needed to compute the Cartesian gradients. - * \param[in] metricNormalsFace - Metric terms in the integration points, which - contain the normals. - * \param[in] wallDistanceInt - Wall distances in the integration points of the face. - * \param[out] viscNormFluxes - Viscous normal fluxes in the integration points. - * \param[out] viscosityInt - Viscosity in the integration points, which is - needed for other terms in the discretization. - * \param[out] kOverCvInt - Thermal conductivity over Cv in the integration points, - which is needed for other terms in the discretization. - */ - void ViscousNormalFluxFace(const CVolumeElementFEM *adjVolElem, - const unsigned short indFaceChunk, - const unsigned short nInt, - const unsigned short NPad, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double *solInt, - const su2double *gradSolInt, - const su2double *metricCoorDerivFace, - const su2double *metricNormalsFace, - const su2double *wallDistanceInt, - su2double *viscNormFluxes, - su2double *viscosityInt, - su2double *kOverCvInt); - - /*! - * \brief Function to compute the viscous normal flux in one integration point for a - 2D simulation. - * \param[in] sol - Conservative variables. - * \param[in] solGradCart - Cartesian gradients of the conservative variables. - * \param[in] normal - Normal vector - * \param[in] HeatFlux - Value of the prescribed heat flux. If not - prescribed, this value should be zero. - * \param[in] factHeatFlux - Multiplication factor for the heat flux. It is zero - when the heat flux is prescribed and one when it has - to be computed. - * \param[in] wallDist - Distance to the nearest viscous wall, if appropriate. - * \param[in lenScale_LES - LES length scale, if appropriate. - * \param[out] Viscosity - Total viscosity, to be computed. - * \param[out] kOverCv - Total thermal conductivity over Cv, to be computed. - * \param[out] normalFlux - Viscous normal flux, to be computed. - */ - void ViscousNormalFluxIntegrationPoint_2D(const su2double *sol, - const su2double solGradCart[4][2], - const su2double *normal, - const su2double HeatFlux, - const su2double factHeatFlux, - const su2double wallDist, - const su2double lenScale_LES, - su2double &Viscosity, - su2double &kOverCv, - su2double *normalFlux); - - /*! - * \brief Function to compute the viscous normal flux in one integration point for a - 3D simulation. - * \param[in] sol - Conservative variables. - * \param[in] solGradCart - Cartesian gradients of the conservative variables. - * \param[in] normal - Normal vector - * \param[in] HeatFlux - Value of the prescribed heat flux. If not - prescribed, this value should be zero. - * \param[in] factHeatFlux - Multiplication factor for the heat flux. It is zero - when the heat flux is prescribed and one when it has - to be computed. - * \param[in] wallDist - Distance to the nearest viscous wall, if appropriate. - * \param[in lenScale_LES - LES length scale, if appropriate. - * \param[out] Viscosity - Total viscosity, to be computed. - * \param[out] kOverCv - Total thermal conductivity over Cv, to be computed. - * \param[out] normalFlux - Viscous normal flux, to be computed. - */ - void ViscousNormalFluxIntegrationPoint_3D(const su2double *sol, - const su2double solGradCart[5][3], - const su2double *normal, - const su2double HeatFlux, - const su2double factHeatFlux, - const su2double wallDist, - const su2double lenScale_LES, - su2double &Viscosity, - su2double &kOverCv, - su2double *normalFlux); -}; - -#include "solver_structure.inl" diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl deleted file mode 100644 index 542917e1767f..000000000000 --- a/SU2_CFD/include/solver_structure.inl +++ /dev/null @@ -1,2459 +0,0 @@ -/*! - * \file solver_structure.inl - * \brief In-Line subroutines of the solver_structure.hpp file. - * \author F. Palacios, T. Economon - * \version 7.0.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -inline void CSolver::SetIterLinSolver(unsigned short val_iterlinsolver) { IterLinSolver = val_iterlinsolver; } - -inline void CSolver::SetResLinSolver(su2double val_reslinsolver) { ResLinSolver = val_reslinsolver; } - -inline void CSolver::SetNondimensionalization(CConfig *config, unsigned short iMesh) { } - -inline bool CSolver::GetAdjoint(void) { return adjoint; } - -inline unsigned short CSolver::GetIterLinSolver(void) { return IterLinSolver; } - -inline su2double CSolver::GetCSensitivity(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, - unsigned short iMesh, unsigned short RunTime_EqSystem) { } - -inline void CSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { } - -inline void CSolver::ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { } - -inline void CSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { } - -inline void CSolver::LoadRestart_FSI(CGeometry *geometry, CConfig *config, int val_iter) { } - -inline void CSolver::PredictStruct_Displacement(CGeometry **fea_geometry, CConfig *fea_config, CSolver ***fea_solution) { } - -inline void CSolver::ComputeAitken_Coefficient(CGeometry **fea_geometry, CConfig *fea_config, CSolver ***fea_solution, unsigned long iOuterIter) { } - -inline void CSolver::SetAitken_Relaxation(CGeometry **fea_geometry, CConfig *fea_config, CSolver ***fea_solution) { } - -inline void CSolver::Update_StructSolution(CGeometry **fea_geometry, CConfig *fea_config, CSolver ***fea_solution) { } - -inline void CSolver::Compute_OFRefGeom(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Compute_OFRefNode(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Compute_OFVolFrac(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Compute_OFCompliance(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::SetForceCoeff(su2double val_forcecoeff_history) { } - -inline void CSolver::SetFSI_Residual(su2double val_FSI_residual) { } - -inline void CSolver::SetRelaxCoeff(su2double val_relaxecoeff_history) { } - -inline su2double CSolver::GetRelaxCoeff(void) const { return 0.0; } - -inline su2double CSolver::GetForceCoeff(void) const { return 0.0; } - -inline su2double CSolver::GetFSI_Residual(void) const { return 0.0; } - -inline void CSolver::Stiffness_Penalty(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config) { } - -inline void CSolver::SetCSensitivity(unsigned short val_marker, unsigned long val_vertex, su2double val_sensitivity) { } - -inline void CSolver::Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { } - -inline void CSolver::Smooth_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { } - -inline void CSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { } - -inline su2double CSolver::GetPhi_Inf(unsigned short val_dim) { return 0; } - -inline su2double CSolver::GetPsiRho_Inf(void) { return 0; } - -inline su2double* CSolver::GetPsiRhos_Inf(void) { return NULL; } - -inline su2double CSolver::GetPsiE_Inf(void) { return 0; } - -inline void CSolver::SetPrimitive_Gradient_GG(CGeometry *geometry, CConfig *config, bool reconstruction) { } - -inline void CSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config, bool reconstruction) { } - -inline void CSolver::SetPrimitive_Limiter_MPI(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetPrimitive_Limiter(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetPreconditioner(CConfig *config, unsigned long iPoint) { } - -inline void CSolver::SetDistance(CGeometry *geometry, CConfig *config) { }; - -inline su2double CSolver::GetCD_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCL_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CL(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CD(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CSF(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CEff(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFx(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFy(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFz(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMx(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMy(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMz(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CL_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CD_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CSF_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CEff_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFx_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFy_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFz_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMx_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMy_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMz_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CL_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CD_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CSF_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CEff_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFx_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFy_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFz_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMx_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMy_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMz_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_Buffet_Metric(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CL_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CD_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CSF_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CEff_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFx_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFy_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CFz_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMx_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMy_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_CMz_Mnt(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetInflow_MassFlow(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetExhaust_MassFlow(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetInflow_Pressure(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetInflow_Mach(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCSF_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCEff_Inv(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_HF_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetSurface_MaxHF_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCL_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCSF_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetCD_Visc(unsigned short val_marker) { return 0; } - -inline su2double CSolver::GetAllBound_CL_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CD_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CSF_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CEff_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CMx_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CMy_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CMz_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CoPx_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CoPy_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CoPz_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CFx_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CFy_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CFz_Inv() { return 0; } - -inline su2double CSolver::GetAllBound_CL_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CD_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CSF_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CEff_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CMx_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CMy_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CMz_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CoPx_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CoPy_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CoPz_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CFx_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CFy_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CFz_Mnt() { return 0; } - -inline su2double CSolver::GetAllBound_CL_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CD_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CSF_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CEff_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CMx_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CMy_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CMz_Visc() { return 0; } - -inline su2double CSolver::GetTotal_Buffet_Metric() { return 0; } - -inline su2double CSolver::GetAllBound_CoPx_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CoPy_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CoPz_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CFx_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CFy_Visc() { return 0; } - -inline su2double CSolver::GetAllBound_CFz_Visc() { return 0; } - -inline void CSolver::SetForceProj_Vector(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::SetIntBoundary_Jump(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline su2double CSolver::GetTotal_CL() { return 0; } - -inline su2double CSolver::GetTotal_CD() { return 0; } - -inline su2double CSolver::GetTotal_NetThrust() { return 0; } - -inline su2double CSolver::GetTotal_Power() { return 0; } - -inline su2double CSolver::GetTotal_SolidCD() { return 0; } - -inline su2double CSolver::GetTotal_ReverseFlow() { return 0; } - -inline su2double CSolver::GetTotal_MFR() { return 0; } - -inline su2double CSolver::GetTotal_Prop_Eff() { return 0; } - -inline su2double CSolver::GetTotal_ByPassProp_Eff() { return 0; } - -inline su2double CSolver::GetTotal_Adiab_Eff() { return 0; } - -inline su2double CSolver::GetTotal_Poly_Eff() { return 0; } - -inline su2double CSolver::GetTotal_IDC_Mach() { return 0; } - -inline su2double CSolver::GetTotal_DC60() { return 0; } - -inline su2double CSolver::GetTotal_Custom_ObjFunc() { return 0; } - -inline su2double CSolver::GetTotal_CMx() { return 0; } - -inline su2double CSolver::GetTotal_CMy() { return 0; } - -inline su2double CSolver::GetTotal_CMz() { return 0; } - -inline su2double CSolver::GetTotal_CoPx() { return 0; } - -inline su2double CSolver::GetTotal_CoPy() { return 0; } - -inline su2double CSolver::GetTotal_CoPz() { return 0; } - -inline su2double CSolver::GetTotal_CFx() { return 0; } - -inline su2double CSolver::GetTotal_CFy() { return 0; } - -inline su2double CSolver::GetTotal_CFz() { return 0; } - -inline su2double CSolver::GetTotal_CSF() { return 0; } - -inline su2double CSolver::GetTotal_CEff() { return 0; } - -inline su2double CSolver::GetTotal_CT() { return 0; } - -inline void CSolver::SetTotal_CT(su2double val_Total_CT) { } - -inline su2double CSolver::GetTotal_CQ() { return 0; } - -inline su2double CSolver::GetTotal_HeatFlux() { return 0; } - -inline su2double CSolver::GetTotal_AvgTemperature() { return 0; } - -inline su2double CSolver::GetTotal_MaxHeatFlux() { return 0; } - -inline su2double CSolver::Get_PressureDrag() { return 0; } - -inline su2double CSolver::Get_ViscDrag() { return 0; } - -inline void CSolver::SetTotal_CQ(su2double val_Total_CQ) { } - -inline void CSolver::SetTotal_HeatFlux(su2double val_Total_Heat) { } - -inline void CSolver::SetTotal_MaxHeatFlux(su2double val_Total_Heat) { } - -inline su2double CSolver::GetTotal_CMerit() { return 0; } - -inline su2double CSolver::GetTotal_CEquivArea() { return 0; } - -inline su2double CSolver::GetTotal_AeroCD() { return 0; } - -inline su2double CSolver::GetTotal_IDR() { return 0; } - -inline su2double CSolver::GetTotal_IDC() { return 0; } - -inline su2double CSolver::GetTotal_CpDiff() { return 0; } - -inline su2double CSolver::GetTotal_HeatFluxDiff() { return 0; } - -inline su2double CSolver::GetTotal_CFEA() const { return 0; } - -inline su2double CSolver::GetTotal_CNearFieldOF() { return 0; } - -inline su2double CSolver::GetTotal_OFRefGeom() const { return 0; } - -inline su2double CSolver::GetTotal_OFRefNode() const { return 0; } - -inline su2double CSolver::GetTotal_OFVolFrac() const { return 0; } - -inline su2double CSolver::GetTotal_OFCompliance() const { return 0; } - -inline bool CSolver::IsElementBased(void) const { return false; } - -inline void CSolver::AddTotal_ComboObj(su2double val_obj) {} - -inline void CSolver::SetTotal_CEquivArea(su2double val_cequivarea) { } - -inline void CSolver::SetTotal_AeroCD(su2double val_aerocd) { } - -inline void CSolver::SetTotal_CpDiff(su2double val_pressure) { } - -inline void CSolver::SetTotal_HeatFluxDiff(su2double val_heat) { } - -inline void CSolver::SetTotal_CFEA(su2double val_cfea) { } - -inline void CSolver::SetTotal_OFRefGeom(su2double val_ofrefgeom) { } - -inline void CSolver::SetTotal_OFRefNode(su2double val_ofrefnode) { } - -inline su2double CSolver::GetWAitken_Dyn(void) const { return 0; } - -inline su2double CSolver::GetWAitken_Dyn_tn1(void) const { return 0; } - -inline void CSolver::SetWAitken_Dyn(su2double waitk) { } - -inline void CSolver::SetWAitken_Dyn_tn1(su2double waitk_tn1) { } - -inline void CSolver::SetLoad_Increment(su2double val_loadIncrement) { } - -inline su2double CSolver::GetLoad_Increment() const { return 0; } - -inline void CSolver::SetTotal_CNearFieldOF(su2double val_cnearfieldpress) { } - -inline su2double CSolver::GetTotal_CWave() { return 0; } - -inline su2double CSolver::GetTotal_CHeat() { return 0; } - -inline void CSolver::SetTotal_CL(su2double val_Total_CL) { } - -inline void CSolver::SetTotal_CD(su2double val_Total_CD) { } - -inline void CSolver::SetTotal_NetThrust(su2double val_Total_NetThrust) { } - -inline void CSolver::SetTotal_Power(su2double val_Total_Power) { } - -inline void CSolver::SetTotal_SolidCD(su2double val_Total_SolidCD) { } - -inline void CSolver::SetTotal_ReverseFlow(su2double val_Total_ReverseFlow) { } - -inline void CSolver::SetTotal_MFR(su2double val_Total_MFR) { } - -inline void CSolver::SetTotal_Prop_Eff(su2double val_Total_Prop_Eff) { } - -inline void CSolver::SetTotal_ByPassProp_Eff(su2double val_Total_ByPassProp_Eff) { } - -inline void CSolver::SetTotal_Adiab_Eff(su2double val_Total_Adiab_Eff) { } - -inline void CSolver::SetTotal_Poly_Eff(su2double val_Total_Poly_Eff) { } - -inline void CSolver::SetTotal_IDC(su2double val_Total_IDC) { } - -inline void CSolver::SetTotal_IDC_Mach(su2double val_Total_IDC_Mach) { } - -inline void CSolver::SetTotal_IDR(su2double val_Total_IDR) { } - -inline void CSolver::SetTotal_DC60(su2double val_Total_DC60) { } - -inline void CSolver::SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { } - -inline void CSolver::AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { } - -inline su2double CSolver::GetCPressure(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure) { } - -inline void CSolver::SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat) { } - -inline su2double *CSolver::GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { } - -inline su2double *CSolver::GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { } - -inline void CSolver::SetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { } - -inline su2double CSolver::GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var) { return 0; } - -inline su2double *CSolver::GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var) { return 0; } - -inline unsigned long CSolver::GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index) { } - -inline su2double CSolver::GetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex, su2double val_deltap) { } - -inline su2double CSolver::GetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline void CSolver::SetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex, su2double val_deltat) { } - -inline su2double CSolver::GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return 0; } - -inline void CSolver::SetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ttotal) { } - -inline void CSolver::SetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ptotal) { } - -inline void CSolver::SetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_flowdir) { } - -inline void CSolver::SetInlet_TurbVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_turb_var) { } - -inline void CSolver::SetUniformInlet(CConfig* config, unsigned short iMarker) {}; - -inline void CSolver::SetInletAtVertex(su2double *val_inlet, unsigned short iMarker, unsigned long iVertex) { }; - -inline su2double CSolver::GetInletAtVertex(su2double *val_inlet, unsigned long val_inlet_point, unsigned short val_kind_marker, string val_marker, CGeometry *geometry, CConfig *config) { return 0; } - -inline void CSolver::UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config) { } - -inline su2double CSolver::GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return 0; } - -inline su2double CSolver::GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetBuffetSensor(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetYPlus(unsigned short val_marker, unsigned long val_vertex) { return 0; } - -inline su2double CSolver::GetStrainMag_Max(void) { return 0; } - -inline su2double CSolver::GetOmega_Max(void) { return 0; } - -inline void CSolver::SetStrainMag_Max(su2double val_strainmag_max) { } - -inline void CSolver::SetOmega_Max(su2double val_omega_max) { } - -inline void CSolver::Viscous_Residual(CGeometry *geometry, - CSolver **solver_container, - CNumerics *numerics, CConfig - *config, unsigned short iMesh, - unsigned short iRKstep) { } - -inline void CSolver::AddStiffMatrix(su2double ** StiffMatrix_Elem, unsigned long Point_0, unsigned long Point_1, unsigned long Point_2, unsigned long Point_3) { } - -inline void CSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CNumerics *second_numerics, CConfig *config, unsigned short iMesh) { } - -inline void CSolver::Source_Template(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config, unsigned short iMesh) { } - -inline su2double CSolver::GetTotal_Sens_Geo() { return 0; } - -inline su2double CSolver::GetTotal_Sens_Mach() { return 0; } - -inline su2double CSolver::GetTotal_Sens_AoA() { return 0; } - -inline su2double CSolver::GetTotal_Sens_Press() { return 0; } - -inline su2double CSolver::GetTotal_Sens_Temp() { return 0; } - -inline su2double CSolver::GetTotal_Sens_BPress() { return 0; } - -inline su2double CSolver::GetTotal_Sens_Density() { return 0; } - -inline su2double CSolver::GetTotal_Sens_ModVel() { return 0; } - -inline su2double CSolver::GetDensity_Inf(void) { return 0; } - -inline su2double CSolver::GetDensity_Inf(unsigned short val_var) { return 0; } - -inline su2double CSolver::GetModVelocity_Inf(void) { return 0; } - -inline su2double CSolver::GetDensity_Energy_Inf(void) { return 0; } - -inline su2double CSolver::GetDensity_Velocity_Inf(unsigned short val_dim) { return 0; } - -inline su2double CSolver::GetDensity_Velocity_Inf(unsigned short val_dim, unsigned short val_var) { return 0; } - -inline su2double CSolver::GetVelocity_Inf(unsigned short val_dim) { return 0; } - -inline su2double* CSolver::GetVelocity_Inf(void) { return 0; } - -inline su2double CSolver::GetPressure_Inf(void) { return 0; } - -inline su2double CSolver::GetViscosity_Inf(void) { return 0; } - -inline su2double CSolver::GetNuTilde_Inf(void) { return 0; } - -inline su2double CSolver::GetTke_Inf(void) { return 0; } - -inline su2double CSolver::GetOmega_Inf(void) { return 0; } - -inline su2double CSolver::GetTotal_Sens_E(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetTotal_Sens_Nu(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetTotal_Sens_Rho(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetTotal_Sens_Rho_DL(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetTotal_Sens_EField(unsigned short iEField) { return 0.0; } - -inline su2double CSolver::GetTotal_Sens_DVFEA(unsigned short iDVFEA) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_E(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_Nu(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_Rho(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_Rho_DL(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_EField(unsigned short iEField) { return 0.0; } - -inline su2double CSolver::GetGlobal_Sens_DVFEA(unsigned short iDVFEA) { return 0.0; } - -inline su2double CSolver::GetVal_Young(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetVal_Poisson(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetVal_Rho(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetVal_Rho_DL(unsigned short iVal) { return 0.0; } - -inline unsigned short CSolver::GetnEField(void) { return 0; } - -inline unsigned short CSolver::GetnDVFEA(void) { return 0; } - -inline void CSolver::ReadDV(CConfig *config) { } - -inline su2double CSolver::GetVal_EField(unsigned short iVal) { return 0.0; } - -inline su2double CSolver::GetVal_DVFEA(unsigned short iVal) { return 0.0; } - -inline su2double* CSolver::GetConstants() { return NULL;} - -inline void CSolver::SetTotal_ComboObj(su2double ComboObj) {} - -inline su2double CSolver::GetTotal_ComboObj(void) { return 0;} - -inline void CSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Evaluate_ObjFunc(CConfig *config) {}; - -inline void CSolver::Solve_System(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::BC_Euler_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) { } - -inline void CSolver::BC_Clamped(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_DispDir(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Clamped_Post(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Normal_Displacement(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Normal_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Dir_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Sine_Load(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Damper(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Deforming(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Dirichlet(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short val_marker) { } - -inline void CSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config) { } - -inline void CSolver::BC_Interface_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Periodic(CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config) { } - -inline void CSolver::BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface) { } - -inline void CSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::PreprocessBC_Giles(CGeometry *geometry, CConfig *config, - CNumerics *conv_numerics,unsigned short marker_flag){} - -inline void CSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, - CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Neumann(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Dielec(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_Electrode(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short val_marker) { } - -inline void CSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } - -inline void CSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output) { } - -inline void CSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, - CConfig *config, - unsigned short iMesh, - bool Output) { } - -inline void CSolver::GetEllipticSpanLoad_Diff(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output) { } - -inline bool CSolver::FixedCL_Convergence(CConfig *config, bool convergence) { return false; } - -inline bool CSolver::GetStart_AoA_FD(void) { return false; } - -inline bool CSolver::GetEnd_AoA_FD(void) { return false; } - -inline unsigned long CSolver::GetIter_Update_AoA(void) { return 0; } - -inline su2double CSolver::GetPrevious_AoA(void) { return 0.0; } - -inline su2double CSolver::GetAoA_inc(void) { return 0.0; } - -inline void CSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output) { } - -inline void CSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration) { } - -inline void CSolver::CheckTimeSynchronization(CConfig *config, - const su2double TimeSync, - su2double &timeEvolved, - bool &syncTimeReached) {} - -inline void CSolver::ProcessTaskList_DG(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh) {} - -inline void CSolver::ADER_SpaceTimeIntegration(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem) {} - -inline void CSolver::ComputeSpatialJacobian(CGeometry *geometry, CSolver **solver_container, - CNumerics **numerics, CConfig *config, - unsigned short iMesh, unsigned short RunTime_EqSystem) {} - -inline void CSolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) { } - -inline void CSolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, CNumerics **numerics, - unsigned short iMesh) { } - -inline void CSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep) { } - -inline void CSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh) { } - -inline void CSolver::Convective_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, - CConfig *config, unsigned short iMesh, unsigned short iRKStep) { } - -inline void CSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { } - -inline void CSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, CNumerics **numerics, unsigned short iMesh, unsigned long Iteration, unsigned short RunTime_EqSystem, bool Output) { } - -inline void CSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetUpwind_Ducros_Sensor(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetUndivided_Laplacian(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Pressure_Forces(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Momentum_Forces(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Friction_Forces(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Buffet_Monitoring(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Inviscid_DeltaForces(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Viscous_DeltaForces(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::Wave_Strength(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iRKStep) { } - -inline void CSolver::ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iRKStep) { } - -inline void CSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, CConfig *config) { } - -inline void CSolver::ImplicitNewmark_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::ImplicitNewmark_Update(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::GeneralizedAlpha_UpdateLoads(CGeometry *geometry, CSolver **solver_container, CConfig *config) { } - -inline void CSolver::Compute_Residual(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) { } - -inline void CSolver::SetRes_RMS(unsigned short val_var, su2double val_residual) { Residual_RMS[val_var] = val_residual; } - -inline void CSolver::AddRes_RMS(unsigned short val_var, su2double val_residual) { Residual_RMS[val_var] += val_residual; } - -inline su2double CSolver::GetRes_RMS(unsigned short val_var) { return Residual_RMS[val_var]; } - -inline void CSolver::SetRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point) { Residual_Max[val_var] = val_residual; Point_Max[val_var] = val_point; } - -inline void CSolver::AddRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point, su2double* val_coord) { - if (val_residual > Residual_Max[val_var]) { - Residual_Max[val_var] = val_residual; - Point_Max[val_var] = val_point; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Point_Max_Coord[val_var][iDim] = val_coord[iDim]; - } -} - -inline void CSolver::AddRes_Max(unsigned short val_var, su2double val_residual, unsigned long val_point, const su2double* val_coord) { - if (val_residual > Residual_Max[val_var]) { - Residual_Max[val_var] = val_residual; - Point_Max[val_var] = val_point; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Point_Max_Coord[val_var][iDim] = val_coord[iDim]; - } -} - -inline su2double CSolver::GetRes_Max(unsigned short val_var) { return Residual_Max[val_var]; } - -inline void CSolver::SetRes_BGS(unsigned short val_var, su2double val_residual) { Residual_BGS[val_var] = val_residual; } - -inline void CSolver::AddRes_BGS(unsigned short val_var, su2double val_residual) { Residual_BGS[val_var] += val_residual; } - -inline su2double CSolver::GetRes_BGS(unsigned short val_var) { return Residual_BGS[val_var]; } - -inline void CSolver::SetRes_Max_BGS(unsigned short val_var, su2double val_residual, unsigned long val_point) { Residual_Max_BGS[val_var] = val_residual; Point_Max_BGS[val_var] = val_point; } - -inline void CSolver::AddRes_Max_BGS(unsigned short val_var, su2double val_residual, unsigned long val_point, su2double* val_coord) { - if (val_residual > Residual_Max_BGS[val_var]) { - Residual_Max_BGS[val_var] = val_residual; - Point_Max_BGS[val_var] = val_point; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Point_Max_Coord_BGS[val_var][iDim] = val_coord[iDim]; - } -} - -inline su2double CSolver::GetRes_Max_BGS(unsigned short val_var) { return Residual_Max_BGS[val_var]; } - -inline su2double CSolver::GetRes_FEM(unsigned short val_var) const { return 0.0; } - -inline unsigned long CSolver::GetPoint_Max(unsigned short val_var) { return Point_Max[val_var]; } - -inline su2double* CSolver::GetPoint_Max_Coord(unsigned short val_var) { return Point_Max_Coord[val_var]; } - -inline unsigned long CSolver::GetPoint_Max_BGS(unsigned short val_var) { return Point_Max_BGS[val_var]; } - -inline su2double* CSolver::GetPoint_Max_Coord_BGS(unsigned short val_var) { return Point_Max_Coord_BGS[val_var]; } - -inline void CSolver::Set_OldSolution(CGeometry *geometry) { base_nodes->Set_OldSolution(); } - -inline void CSolver::Set_NewSolution(CGeometry *geometry) { } - -inline unsigned short CSolver::GetnVar(void) { return nVar; } - -inline unsigned short CSolver::GetnOutputVariables(void) { return nOutputVariables; } - -inline unsigned short CSolver::GetnPrimVar(void) { return nPrimVar; } - -inline unsigned short CSolver::GetnPrimVarGrad(void) { return nPrimVarGrad; } - -inline unsigned short CSolver::GetnSecondaryVar(void) { return nSecondaryVar; } - -inline unsigned short CSolver::GetnSecondaryVarGrad(void) { return nSecondaryVarGrad; } - -inline su2double CSolver::GetMax_Delta_Time(void) { return Max_Delta_Time; } - -inline su2double CSolver::GetMin_Delta_Time(void) { return Min_Delta_Time; } - -inline su2double CSolver::GetMax_Delta_Time(unsigned short val_Species) { return 0.0; } - -inline su2double CSolver::GetMin_Delta_Time(unsigned short val_Species) { return 0.0; } - -inline void CSolver::Copy_Zone_Solution(CSolver ***solver1_solution, CGeometry **solver1_geometry, CConfig *solver1_config, - CSolver ***solver2_solution, CGeometry **solver2_geometry, CConfig *solver2_config) {}; - -inline CFluidModel* CSolver::GetFluidModel(void) { return NULL;} - -inline su2double* CSolver::GetVecSolDOFs(void) {return NULL;} - -inline unsigned long CSolver::GetnDOFsGlobal(void) {return 0;} - -inline su2double CSolver::Compute_LoadCoefficient(su2double CurrentTime, su2double RampTime, CConfig *config) { return 0.0; } - -inline void CSolver::Compute_StiffMatrix(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_MassRes(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_NodalStressRes(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::SetFSI_ConvValue(unsigned short val_index, su2double val_criteria) { }; - -inline su2double CSolver::GetFSI_ConvValue(unsigned short val_index) const { return 0.0; } - -inline void CSolver::RegisterSolution(CGeometry *geometry_container, CConfig *config){} - -inline void CSolver::RegisterOutput(CGeometry *geometry_container, CConfig *config){} - -inline void CSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config){} - -inline void CSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config){} - -inline void CSolver::RegisterObj_Func(CConfig *config){} - -inline void CSolver::SetSurface_Sensitivity(CGeometry *geometry, CConfig *config){} - -inline void CSolver::SetSensitivity(CGeometry *geometry, CSolver **solver, CConfig *config){} - -inline void CSolver::SetAdj_ObjFunc(CGeometry *geometry, CConfig *config){} - -inline unsigned long CSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) {return 0;} - -inline void CSolver::SetRecording(CGeometry *geometry, CConfig *config){} - -inline void CSolver::SetPressure_Inf(su2double p_inf){} - -inline void CSolver::SetTemperature_Inf(su2double t_inf){} - -inline void CSolver::SetDensity_Inf(su2double rho_inf){} - -inline void CSolver::SetVelocity_Inf(unsigned short val_dim, su2double val_velocity) { } - -inline void CSolver::RegisterVariables(CGeometry *geometry, CConfig *config, bool reset){} - -inline void CSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config){} - -inline void CSolver::SetFreeStream_Solution(CConfig *config){} - -inline su2double* CBaselineSolver_FEM::GetVecSolDOFs(void) {return VecSolDOFs.data();} - -inline void CSolver::SetTauWall_WF(CGeometry *geometry, CSolver** solver_container, CConfig* config){} - -inline void CSolver::SetNuTilde_WF(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) {} - -inline void CEulerSolver::Set_NewSolution(CGeometry *geometry) { nodes->SetSolution_New(); } - -inline void CSolver::InitTurboContainers(CGeometry *geometry, CConfig *config){} - -inline void CSolver::PreprocessAverage(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag){} - -inline void CSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag){} - -inline void CSolver::GatherInOutAverageValues(CConfig *config, CGeometry *geometry){ } - -inline su2double CSolver::GetAverageDensity(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetAveragePressure(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double* CSolver::GetAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan){return NULL;} - -inline su2double CSolver::GetAverageNu(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetAverageKine(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetAverageOmega(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetExtAverageNu(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetExtAverageKine(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline su2double CSolver::GetExtAverageOmega(unsigned short valMarker, unsigned short valSpan){return 0.0;} - -inline void CSolver::SetExtAverageDensity(unsigned short valMarker, unsigned short valSpan, su2double valDensity){ } - -inline void CSolver::SetExtAveragePressure(unsigned short valMarker, unsigned short valSpan, su2double valPressure){ } - -inline void CSolver::SetExtAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan, unsigned short valIndex, su2double valTurboVelocity){ } - -inline void CSolver::SetExtAverageNu(unsigned short valMarker, unsigned short valSpan, su2double valNu){ } - -inline void CSolver::SetExtAverageKine(unsigned short valMarker, unsigned short valSpan, su2double valKine){ } - -inline void CSolver::SetExtAverageOmega(unsigned short valMarker, unsigned short valSpan, su2double valOmega){ } - -inline su2double CSolver::GetDensityIn(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetPressureIn(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double* CSolver::GetTurboVelocityIn(unsigned short inMarkerTP, unsigned short valSpan){return NULL;} - -inline su2double CSolver::GetDensityOut(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetPressureOut(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double* CSolver::GetTurboVelocityOut(unsigned short inMarkerTP, unsigned short valSpan){return NULL;} - -inline su2double CSolver::GetKineIn(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetOmegaIn(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetNuIn(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetKineOut(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetOmegaOut(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline su2double CSolver::GetNuOut(unsigned short inMarkerTP, unsigned short valSpan){return 0;} - -inline void CSolver::SetDensityIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetPressureIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetTurboVelocityIn(su2double *value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetDensityOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetPressureOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetTurboVelocityOut(su2double *value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetKineIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetOmegaIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetNuIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetKineOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetOmegaOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetNuOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){ } - -inline void CSolver::SetFreeStream_TurboSolution(CConfig *config){ } - -inline void CSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh) { } - -inline void CSolver::SetRoe_Dissipation(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::SetDES_LengthScale(CSolver** solver, CGeometry *geometry, CConfig *config) { } - -inline void CSolver::DeformMesh(CGeometry **geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::SetMesh_Stiffness(CGeometry **geometry, CNumerics **numerics, CConfig *config) { } - -inline void CSolver::SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var) { } - -inline su2double CSolver::GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var) { return 0.0; } - -inline void CSolver::ComputeVerificationError(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::SetImplicitPeriodic(bool val_implicit_periodic) { implicit_periodic = val_implicit_periodic; } - -inline void CSolver::SetRotatePeriodic(bool val_rotate_periodic) { rotate_periodic = val_rotate_periodic; } - -inline string CSolver::GetSolverName(void) {return SolverName;} - -inline su2double CEulerSolver::GetDensity_Inf(void) { return Density_Inf; } - -inline su2double CEulerSolver::GetModVelocity_Inf(void) { - su2double Vel2 = 0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Vel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; - return sqrt(Vel2); -} - -inline su2double CEulerSolver::GetDensity_Energy_Inf(void) { return Density_Inf*Energy_Inf; } - -inline su2double CEulerSolver::GetDensity_Velocity_Inf(unsigned short val_dim) { return Density_Inf*Velocity_Inf[val_dim]; } - -inline su2double CEulerSolver::GetVelocity_Inf(unsigned short val_dim) { return Velocity_Inf[val_dim]; } - -inline su2double *CEulerSolver::GetVelocity_Inf(void) { return Velocity_Inf; } - -inline su2double CEulerSolver::GetPressure_Inf(void) { return Pressure_Inf; } - -inline su2double CEulerSolver::GetCPressure(unsigned short val_marker, unsigned long val_vertex) { return CPressure[val_marker][val_vertex]; } - -inline su2double CEulerSolver::GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex) { return CPressureTarget[val_marker][val_vertex]; } - -inline void CEulerSolver::SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure) { CPressureTarget[val_marker][val_vertex] = val_pressure; } - -inline su2double *CEulerSolver::GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) { return CharacPrimVar[val_marker][val_vertex]; } - -inline void CEulerSolver::SetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { CharacPrimVar[val_marker][val_vertex][val_var] = val_value; } - -inline su2double *CEulerSolver::GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex) { return DonorPrimVar[val_marker][val_vertex]; } - -inline void CEulerSolver::SetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { DonorPrimVar[val_marker][val_vertex][val_var] = val_value; } - -inline su2double CEulerSolver::GetDonorPrimVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var) { return DonorPrimVar[val_marker][val_vertex][val_var]; } - -inline unsigned long CEulerSolver::GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex) { return DonorGlobalIndex[val_marker][val_vertex]; } - -inline void CEulerSolver::SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index) { DonorGlobalIndex[val_marker][val_vertex] = val_index; } - -inline su2double CEulerSolver::GetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex) { return ActDisk_DeltaP[val_marker][val_vertex]; } - -inline void CEulerSolver::SetActDisk_DeltaP(unsigned short val_marker, unsigned long val_vertex, su2double val_deltap) { ActDisk_DeltaP[val_marker][val_vertex] = val_deltap; } - -inline su2double CEulerSolver::GetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex) { return ActDisk_DeltaT[val_marker][val_vertex]; } - -inline void CEulerSolver::SetActDisk_DeltaT(unsigned short val_marker, unsigned long val_vertex, su2double val_deltat) { ActDisk_DeltaT[val_marker][val_vertex] = val_deltat; } - -inline su2double CEulerSolver::GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex) { return Inlet_Ttotal[val_marker][val_vertex]; } - -inline su2double CEulerSolver::GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex) { return Inlet_Ptotal[val_marker][val_vertex]; } - -inline su2double CEulerSolver::GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return Inlet_FlowDir[val_marker][val_vertex][val_dim]; } - -inline void CEulerSolver::SetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ttotal) { - /*--- Since this call can be accessed indirectly using python, do some error - * checking to prevent segmentation faults ---*/ - if (val_marker >= nMarker) - SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_Ttotal == NULL || Inlet_Ttotal[val_marker] == NULL) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); - else if (val_vertex >= nVertex[val_marker]) - SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); - else - Inlet_Ttotal[val_marker][val_vertex] = val_ttotal; -} - -inline void CEulerSolver::SetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex, su2double val_ptotal) { - /*--- Since this call can be accessed indirectly using python, do some error - * checking to prevent segmentation faults ---*/ - if (val_marker >= nMarker) - SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_Ptotal == NULL || Inlet_Ptotal[val_marker] == NULL) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); - else if (val_vertex >= nVertex[val_marker]) - SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); - else - Inlet_Ptotal[val_marker][val_vertex] = val_ptotal; -} - -inline void CEulerSolver::SetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_flowdir) { - /*--- Since this call can be accessed indirectly using python, do some error - * checking to prevent segmentation faults ---*/ - if (val_marker >= nMarker) - SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_FlowDir == NULL || Inlet_FlowDir[val_marker] == NULL) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); - else if (val_vertex >= nVertex[val_marker]) - SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); - else - Inlet_FlowDir[val_marker][val_vertex][val_dim] = val_flowdir; -} - -inline su2double CEulerSolver::GetCL_Inv(unsigned short val_marker) { return CL_Inv[val_marker]; } - -inline su2double CEulerSolver::GetCD_Inv(unsigned short val_marker) { return CD_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CL(unsigned short val_marker) { return Surface_CL[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CD(unsigned short val_marker) { return Surface_CD[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CSF(unsigned short val_marker) { return Surface_CSF[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CEff(unsigned short val_marker) { return Surface_CEff[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFx(unsigned short val_marker) { return Surface_CFx[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFy(unsigned short val_marker) { return Surface_CFy[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFz(unsigned short val_marker) { return Surface_CFz[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMx(unsigned short val_marker) { return Surface_CMx[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMy(unsigned short val_marker) { return Surface_CMy[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMz(unsigned short val_marker) { return Surface_CMz[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CL_Inv(unsigned short val_marker) { return Surface_CL_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CD_Inv(unsigned short val_marker) { return Surface_CD_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CSF_Inv(unsigned short val_marker) { return Surface_CSF_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CEff_Inv(unsigned short val_marker) { return Surface_CEff_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFx_Inv(unsigned short val_marker) { return Surface_CFx_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFy_Inv(unsigned short val_marker) { return Surface_CFy_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFz_Inv(unsigned short val_marker) { return Surface_CFz_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMx_Inv(unsigned short val_marker) { return Surface_CMx_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMy_Inv(unsigned short val_marker) { return Surface_CMy_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMz_Inv(unsigned short val_marker) { return Surface_CMz_Inv[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CL_Mnt(unsigned short val_marker) { return Surface_CL_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CD_Mnt(unsigned short val_marker) { return Surface_CD_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CSF_Mnt(unsigned short val_marker) { return Surface_CSF_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CEff_Mnt(unsigned short val_marker) { return Surface_CEff_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFx_Mnt(unsigned short val_marker) { return Surface_CFx_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFy_Mnt(unsigned short val_marker) { return Surface_CFy_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CFz_Mnt(unsigned short val_marker) { return Surface_CFz_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMx_Mnt(unsigned short val_marker) { return Surface_CMx_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMy_Mnt(unsigned short val_marker) { return Surface_CMy_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetSurface_CMz_Mnt(unsigned short val_marker) { return Surface_CMz_Mnt[val_marker]; } - -inline su2double CEulerSolver::GetInflow_MassFlow(unsigned short val_marker) { return Inflow_MassFlow[val_marker]; } - -inline su2double CEulerSolver::GetExhaust_MassFlow(unsigned short val_marker) { return Exhaust_MassFlow[val_marker]; } - -inline su2double CEulerSolver::GetInflow_Pressure(unsigned short val_marker) { return Inflow_Pressure[val_marker]; } - -inline su2double CEulerSolver::GetInflow_Mach(unsigned short val_marker) { return Inflow_Mach[val_marker]; } - -inline su2double CEulerSolver::GetCSF_Inv(unsigned short val_marker) { return CSF_Inv[val_marker]; } - -inline su2double CEulerSolver::GetCEff_Inv(unsigned short val_marker) { return CEff_Inv[val_marker]; } - -inline su2double CEulerSolver::GetTotal_CL() { return Total_CL; } - -inline void CEulerSolver::SetTotal_ComboObj(su2double ComboObj) {Total_ComboObj = ComboObj; } - -inline su2double CEulerSolver::GetTotal_ComboObj() { return Total_ComboObj; } - -inline su2double CEulerSolver::GetTotal_CD() { return Total_CD; } - -inline su2double CEulerSolver::GetTotal_NetThrust() { return Total_NetThrust; } - -inline su2double CEulerSolver::GetTotal_Power() { return Total_Power; } - -inline su2double CEulerSolver::GetTotal_SolidCD() { return Total_SolidCD; } - -inline su2double CEulerSolver::GetTotal_ReverseFlow() { return Total_ReverseFlow; } - -inline su2double CEulerSolver::GetTotal_MFR() { return Total_MFR; } - -inline su2double CEulerSolver::GetTotal_Prop_Eff() { return Total_Prop_Eff; } - -inline su2double CEulerSolver::GetTotal_ByPassProp_Eff() { return Total_ByPassProp_Eff; } - -inline su2double CEulerSolver::GetTotal_Adiab_Eff() { return Total_Adiab_Eff; } - -inline su2double CEulerSolver::GetTotal_Poly_Eff() { return Total_Poly_Eff; } - -inline su2double CEulerSolver::GetTotal_IDC_Mach() { return Total_IDC_Mach; } - -inline su2double CEulerSolver::GetTotal_DC60() { return Total_DC60; } - -inline su2double CEulerSolver::GetTotal_Custom_ObjFunc() { return Total_Custom_ObjFunc; } - -inline su2double CEulerSolver::GetTotal_CMx() { return Total_CMx; } - -inline su2double CEulerSolver::GetTotal_CMy() { return Total_CMy; } - -inline su2double CEulerSolver::GetTotal_CMz() { return Total_CMz; } - -inline su2double CEulerSolver::GetTotal_CoPx() { return Total_CoPx; } - -inline su2double CEulerSolver::GetTotal_CoPy() { return Total_CoPy; } - -inline su2double CEulerSolver::GetTotal_CoPz() { return Total_CoPz; } - -inline su2double CEulerSolver::GetTotal_CFx() { return Total_CFx; } - -inline su2double CEulerSolver::GetTotal_CFy() { return Total_CFy; } - -inline su2double CEulerSolver::GetTotal_CFz() { return Total_CFz; } - -inline su2double CEulerSolver::GetTotal_CSF() { return Total_CSF; } - -inline su2double CEulerSolver::GetTotal_CEff() { return Total_CEff; } - -inline su2double CEulerSolver::GetTotal_CT() { return Total_CT; } - -inline void CEulerSolver::SetTotal_CT(su2double val_Total_CT) { Total_CT = val_Total_CT; } - -inline su2double CEulerSolver::GetTotal_CQ() { return Total_CQ; } - -inline su2double CEulerSolver::GetTotal_HeatFlux() { return Total_Heat; } - -inline su2double CEulerSolver::GetTotal_MaxHeatFlux() { return Total_MaxHeat; } - -inline void CEulerSolver::SetTotal_CQ(su2double val_Total_CQ) { Total_CQ = val_Total_CQ; } - -inline void CEulerSolver::SetTotal_HeatFlux(su2double val_Total_Heat) { Total_Heat = val_Total_Heat; } - -inline void CEulerSolver::SetTotal_MaxHeatFlux(su2double val_Total_MaxHeat) { Total_MaxHeat = val_Total_MaxHeat; } - -inline su2double CEulerSolver::GetTotal_CMerit() { return Total_CMerit; } - -inline su2double CEulerSolver::GetTotal_CEquivArea() { return Total_CEquivArea; } - -inline su2double CEulerSolver::GetTotal_AeroCD() { return Total_AeroCD; } - -inline su2double CEulerSolver::GetTotal_IDR() { return Total_IDR; } - -inline su2double CEulerSolver::GetTotal_IDC() { return Total_IDC; } - -inline su2double CEulerSolver::GetTotal_CpDiff() { return Total_CpDiff; } - -inline su2double CEulerSolver::GetTotal_HeatFluxDiff() { return Total_HeatFluxDiff; } - -inline su2double CEulerSolver::GetTotal_CNearFieldOF() { return Total_CNearFieldOF; } - -inline void CEulerSolver::AddTotal_ComboObj(su2double val_obj) {Total_ComboObj +=val_obj;} - -inline void CEulerSolver::SetTotal_CEquivArea(su2double val_cequivarea) { Total_CEquivArea = val_cequivarea; } - -inline void CEulerSolver::SetTotal_AeroCD(su2double val_aerocd) { Total_AeroCD = val_aerocd; } - -inline void CEulerSolver::SetTotal_CpDiff(su2double pressure) { Total_CpDiff = pressure; } - -inline void CEulerSolver::SetTotal_HeatFluxDiff(su2double heat) { Total_HeatFluxDiff = heat; } - -inline void CEulerSolver::SetTotal_CNearFieldOF(su2double cnearfieldpress) { Total_CNearFieldOF = cnearfieldpress; } - -inline void CEulerSolver::SetTotal_CL(su2double val_Total_CL) { Total_CL = val_Total_CL; } - -inline void CEulerSolver::SetTotal_CD(su2double val_Total_CD) { Total_CD = val_Total_CD; } - -inline void CEulerSolver::SetTotal_NetThrust(su2double val_Total_NetThrust) { Total_NetThrust = val_Total_NetThrust; } - -inline void CEulerSolver::SetTotal_Power(su2double val_Total_Power) { Total_Power = val_Total_Power; } - -inline void CEulerSolver::SetTotal_SolidCD(su2double val_Total_SolidCD) { Total_SolidCD = val_Total_SolidCD; } - -inline void CEulerSolver::SetTotal_ReverseFlow(su2double val_Total_ReverseFlow) { Total_ReverseFlow = val_Total_ReverseFlow; } - -inline void CEulerSolver::SetTotal_MFR(su2double val_Total_MFR) { Total_MFR = val_Total_MFR; } - -inline void CEulerSolver::SetTotal_Prop_Eff(su2double val_Total_Prop_Eff) { Total_Prop_Eff = val_Total_Prop_Eff; } - -inline void CEulerSolver::SetTotal_ByPassProp_Eff(su2double val_Total_ByPassProp_Eff) { Total_ByPassProp_Eff = val_Total_ByPassProp_Eff; } - -inline void CEulerSolver::SetTotal_Adiab_Eff(su2double val_Total_Adiab_Eff) { Total_Adiab_Eff = val_Total_Adiab_Eff; } - -inline void CEulerSolver::SetTotal_Poly_Eff(su2double val_Total_Poly_Eff) { Total_Poly_Eff = val_Total_Poly_Eff; } - -inline void CEulerSolver::SetTotal_IDC(su2double val_Total_IDC) { Total_IDC = val_Total_IDC; } - -inline void CEulerSolver::SetTotal_IDC_Mach(su2double val_Total_IDC_Mach) { Total_IDC_Mach = val_Total_IDC_Mach; } - -inline void CEulerSolver::SetTotal_IDR(su2double val_Total_IDR) { Total_IDR = val_Total_IDR; } - -inline void CEulerSolver::SetTotal_DC60(su2double val_Total_DC60) { Total_DC60 = val_Total_DC60; } - -inline void CEulerSolver::SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { Total_Custom_ObjFunc = val_total_custom_objfunc*val_weight; } - -inline void CEulerSolver::AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { Total_Custom_ObjFunc += val_total_custom_objfunc*val_weight; } - -inline su2double CEulerSolver::GetAllBound_CL_Inv() { return AllBound_CL_Inv; } - -inline su2double CEulerSolver::GetAllBound_CD_Inv() { return AllBound_CD_Inv; } - -inline su2double CEulerSolver::GetAllBound_CSF_Inv() { return AllBound_CSF_Inv; } - -inline su2double CEulerSolver::GetAllBound_CEff_Inv() { return AllBound_CEff_Inv; } - -inline su2double CEulerSolver::GetAllBound_CMx_Inv() { return AllBound_CMx_Inv; } - -inline su2double CEulerSolver::GetAllBound_CMy_Inv() { return AllBound_CMy_Inv; } - -inline su2double CEulerSolver::GetAllBound_CMz_Inv() { return AllBound_CMz_Inv; } - -inline su2double CEulerSolver::GetAllBound_CoPx_Inv() { return AllBound_CoPx_Inv; } - -inline su2double CEulerSolver::GetAllBound_CoPy_Inv() { return AllBound_CoPy_Inv; } - -inline su2double CEulerSolver::GetAllBound_CoPz_Inv() { return AllBound_CoPz_Inv; } - -inline su2double CEulerSolver::GetAllBound_CFx_Inv() { return AllBound_CFx_Inv; } - -inline su2double CEulerSolver::GetAllBound_CFy_Inv() { return AllBound_CFy_Inv; } - -inline su2double CEulerSolver::GetAllBound_CFz_Inv() { return AllBound_CFz_Inv; } - -inline su2double CEulerSolver::GetAllBound_CL_Mnt() { return AllBound_CL_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CD_Mnt() { return AllBound_CD_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CSF_Mnt() { return AllBound_CSF_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CEff_Mnt() { return AllBound_CEff_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CMx_Mnt() { return AllBound_CMx_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CMy_Mnt() { return AllBound_CMy_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CMz_Mnt() { return AllBound_CMz_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CoPx_Mnt() { return AllBound_CoPx_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CoPy_Mnt() { return AllBound_CoPy_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CoPz_Mnt() { return AllBound_CoPz_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CFx_Mnt() { return AllBound_CFx_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CFy_Mnt() { return AllBound_CFy_Mnt; } - -inline su2double CEulerSolver::GetAllBound_CFz_Mnt() { return AllBound_CFz_Mnt; } - -inline su2double CEulerSolver::GetAverageDensity(unsigned short valMarker, unsigned short valSpan){return AverageDensity[valMarker][valSpan];} - -inline su2double CEulerSolver::GetAveragePressure(unsigned short valMarker, unsigned short valSpan){return AveragePressure[valMarker][valSpan];} - -inline su2double* CEulerSolver::GetAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan){return AverageTurboVelocity[valMarker][valSpan];} - -inline su2double CEulerSolver::GetAverageNu(unsigned short valMarker, unsigned short valSpan){return AverageNu[valMarker][valSpan];} - -inline su2double CEulerSolver::GetAverageKine(unsigned short valMarker, unsigned short valSpan){return AverageKine[valMarker][valSpan];} - -inline su2double CEulerSolver::GetAverageOmega(unsigned short valMarker, unsigned short valSpan){return AverageOmega[valMarker][valSpan];} - -inline su2double CEulerSolver::GetExtAverageNu(unsigned short valMarker, unsigned short valSpan){return ExtAverageNu[valMarker][valSpan];} - -inline su2double CEulerSolver::GetExtAverageKine(unsigned short valMarker, unsigned short valSpan){return ExtAverageKine[valMarker][valSpan];} - -inline su2double CEulerSolver::GetExtAverageOmega(unsigned short valMarker, unsigned short valSpan){return ExtAverageOmega[valMarker][valSpan];} - -inline void CEulerSolver::SetExtAverageDensity(unsigned short valMarker, unsigned short valSpan, su2double valDensity){ExtAverageDensity[valMarker][valSpan] = valDensity;} - -inline void CEulerSolver::SetExtAveragePressure(unsigned short valMarker, unsigned short valSpan, su2double valPressure){ExtAveragePressure[valMarker][valSpan] = valPressure;} - -inline void CEulerSolver::SetExtAverageTurboVelocity(unsigned short valMarker, unsigned short valSpan, unsigned short valIndex, su2double valTurboVelocity){ExtAverageTurboVelocity[valMarker][valSpan][valIndex] = valTurboVelocity;} - -inline void CEulerSolver::SetExtAverageNu(unsigned short valMarker, unsigned short valSpan, su2double valNu){ExtAverageNu[valMarker][valSpan] = valNu;} - -inline void CEulerSolver::SetExtAverageKine(unsigned short valMarker, unsigned short valSpan, su2double valKine){ExtAverageKine[valMarker][valSpan] = valKine;} - -inline void CEulerSolver::SetExtAverageOmega(unsigned short valMarker, unsigned short valSpan, su2double valOmega){ExtAverageOmega[valMarker][valSpan] = valOmega;} - -inline su2double CEulerSolver::GetDensityIn(unsigned short inMarkerTP, unsigned short valSpan){return DensityIn[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetPressureIn(unsigned short inMarkerTP, unsigned short valSpan){return PressureIn[inMarkerTP][valSpan];} - -inline su2double* CEulerSolver::GetTurboVelocityIn(unsigned short inMarkerTP, unsigned short valSpan){return TurboVelocityIn[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetDensityOut(unsigned short inMarkerTP, unsigned short valSpan){return DensityOut[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetPressureOut(unsigned short inMarkerTP, unsigned short valSpan){return PressureOut[inMarkerTP][valSpan];} - -inline su2double* CEulerSolver::GetTurboVelocityOut(unsigned short inMarkerTP, unsigned short valSpan){return TurboVelocityOut[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetKineIn(unsigned short inMarkerTP, unsigned short valSpan){return KineIn[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetOmegaIn(unsigned short inMarkerTP, unsigned short valSpan){return OmegaIn[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetNuIn(unsigned short inMarkerTP, unsigned short valSpan){return NuIn[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetKineOut(unsigned short inMarkerTP, unsigned short valSpan){return KineOut[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetOmegaOut(unsigned short inMarkerTP, unsigned short valSpan){return OmegaOut[inMarkerTP][valSpan];} - -inline su2double CEulerSolver::GetNuOut(unsigned short inMarkerTP, unsigned short valSpan){return NuOut[inMarkerTP][valSpan];} - -inline void CEulerSolver::SetDensityIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){DensityIn[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetPressureIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){PressureIn[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetTurboVelocityIn(su2double *value, unsigned short inMarkerTP, unsigned short valSpan){ - unsigned short iDim; - - for(iDim = 0; iDim < nDim; iDim++) - TurboVelocityIn[inMarkerTP][valSpan][iDim] = value[iDim]; -} - -inline void CEulerSolver::SetDensityOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){DensityOut[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetPressureOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){PressureOut[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetTurboVelocityOut(su2double *value, unsigned short inMarkerTP, unsigned short valSpan){ - unsigned short iDim; - - for(iDim = 0; iDim < nDim; iDim++) - TurboVelocityOut[inMarkerTP][valSpan][iDim] = value[iDim]; -} - -inline void CEulerSolver::SetKineIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){KineIn[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetOmegaIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){OmegaIn[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetNuIn(su2double value, unsigned short inMarkerTP, unsigned short valSpan){NuIn[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetKineOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){KineOut[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetOmegaOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){OmegaOut[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::SetNuOut(su2double value, unsigned short inMarkerTP, unsigned short valSpan){NuOut[inMarkerTP][valSpan] = value;} - -inline void CEulerSolver::ComputeTurboVelocity(const su2double *cartesianVelocity, const su2double *turboNormal, su2double *turboVelocity, - unsigned short marker_flag, unsigned short kind_turb) { - - if ((kind_turb == AXIAL && nDim == 3) || (kind_turb == CENTRIPETAL_AXIAL && marker_flag == OUTFLOW) || (kind_turb == AXIAL_CENTRIFUGAL && marker_flag == INFLOW) ){ - turboVelocity[2] = turboNormal[0]*cartesianVelocity[0] + cartesianVelocity[1]*turboNormal[1]; - turboVelocity[1] = turboNormal[0]*cartesianVelocity[1] - turboNormal[1]*cartesianVelocity[0]; - turboVelocity[0] = cartesianVelocity[2]; - } - else{ - turboVelocity[0] = turboNormal[0]*cartesianVelocity[0] + cartesianVelocity[1]*turboNormal[1]; - turboVelocity[1] = turboNormal[0]*cartesianVelocity[1] - turboNormal[1]*cartesianVelocity[0]; - if (marker_flag == INFLOW){ - turboVelocity[0] *= -1.0; - turboVelocity[1] *= -1.0; - } - if(nDim == 3) - turboVelocity[2] = cartesianVelocity[2]; - } -} - -inline void CEulerSolver::ComputeBackVelocity(const su2double *turboVelocity, const su2double *turboNormal, su2double *cartesianVelocity, - unsigned short marker_flag, unsigned short kind_turb){ - - if ((kind_turb == AXIAL && nDim == 3) || (kind_turb == CENTRIPETAL_AXIAL && marker_flag == OUTFLOW) || (kind_turb == AXIAL_CENTRIFUGAL && marker_flag == INFLOW)){ - cartesianVelocity[0] = turboVelocity[2]*turboNormal[0] - turboVelocity[1]*turboNormal[1]; - cartesianVelocity[1] = turboVelocity[2]*turboNormal[1] + turboVelocity[1]*turboNormal[0]; - cartesianVelocity[2] = turboVelocity[0]; - } - else{ - cartesianVelocity[0] = turboVelocity[0]*turboNormal[0] - turboVelocity[1]*turboNormal[1]; - cartesianVelocity[1] = turboVelocity[0]*turboNormal[1] + turboVelocity[1]*turboNormal[0]; - - if (marker_flag == INFLOW){ - cartesianVelocity[0] *= -1.0; - cartesianVelocity[1] *= -1.0; - } - - if(nDim == 3) - cartesianVelocity[2] = turboVelocity[2]; - } -} - - -inline CFluidModel* CEulerSolver::GetFluidModel(void) { return FluidModel;} - -inline void CEulerSolver::SetPressure_Inf(su2double p_inf) {Pressure_Inf = p_inf;} - -inline void CEulerSolver::SetTemperature_Inf(su2double t_inf) {Temperature_Inf = t_inf;} - -inline bool CEulerSolver::GetStart_AoA_FD(void) { return Start_AoA_FD; } - -inline bool CEulerSolver::GetEnd_AoA_FD(void) { return End_AoA_FD; } - -inline unsigned long CEulerSolver::GetIter_Update_AoA(void) { return Iter_Update_AoA; } - -inline su2double CEulerSolver::GetPrevious_AoA(void) { return AoA_Prev; } - -inline su2double CEulerSolver::GetAoA_inc(void) { return AoA_inc; } - -inline su2double CNSSolver::GetViscosity_Inf(void) { return Viscosity_Inf; } - -inline su2double CNSSolver::GetTke_Inf(void) { return Tke_Inf; } - -inline su2double CNSSolver::GetSurface_HF_Visc(unsigned short val_marker) { return Surface_HF_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_MaxHF_Visc(unsigned short val_marker) { return Surface_MaxHF_Visc[val_marker]; } - -inline su2double CNSSolver::GetCL_Visc(unsigned short val_marker) { return CL_Visc[val_marker]; } - -inline su2double CNSSolver::GetCSF_Visc(unsigned short val_marker) { return CSF_Visc[val_marker]; } - -inline su2double CNSSolver::GetCD_Visc(unsigned short val_marker) { return CD_Visc[val_marker]; } - -inline su2double CNSSolver::GetAllBound_CL_Visc() { return AllBound_CL_Visc; } - -inline su2double CNSSolver::GetAllBound_CD_Visc() { return AllBound_CD_Visc; } - -inline su2double CNSSolver::GetAllBound_CSF_Visc() { return AllBound_CSF_Visc; } - -inline su2double CNSSolver::GetAllBound_CEff_Visc() { return AllBound_CEff_Visc; } - -inline su2double CNSSolver::GetAllBound_CMx_Visc() { return AllBound_CMx_Visc; } - -inline su2double CNSSolver::GetAllBound_CMy_Visc() { return AllBound_CMy_Visc; } - -inline su2double CNSSolver::GetAllBound_CMz_Visc() { return AllBound_CMz_Visc; } - -inline su2double CNSSolver::GetAllBound_CoPx_Visc() { return AllBound_CoPx_Visc; } - -inline su2double CNSSolver::GetAllBound_CoPy_Visc() { return AllBound_CoPy_Visc; } - -inline su2double CNSSolver::GetAllBound_CoPz_Visc() { return AllBound_CoPz_Visc; } - -inline su2double CNSSolver::GetAllBound_CFx_Visc() { return AllBound_CFx_Visc; } - -inline su2double CNSSolver::GetAllBound_CFy_Visc() { return AllBound_CFy_Visc; } - -inline su2double CNSSolver::GetAllBound_CFz_Visc() { return AllBound_CFz_Visc; } - -inline su2double CNSSolver::GetTotal_Buffet_Metric() { return Total_Buffet_Metric; } - -inline su2double CNSSolver::GetSurface_CL_Visc(unsigned short val_marker) { return Surface_CL_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CD_Visc(unsigned short val_marker) { return Surface_CD_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CSF_Visc(unsigned short val_marker) { return Surface_CSF_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CEff_Visc(unsigned short val_marker) { return Surface_CEff_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CFx_Visc(unsigned short val_marker) { return Surface_CFx_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CFy_Visc(unsigned short val_marker) { return Surface_CFy_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CFz_Visc(unsigned short val_marker) { return Surface_CFz_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CMx_Visc(unsigned short val_marker) { return Surface_CMx_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CMy_Visc(unsigned short val_marker) { return Surface_CMy_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_CMz_Visc(unsigned short val_marker) { return Surface_CMz_Visc[val_marker]; } - -inline su2double CNSSolver::GetSurface_Buffet_Metric(unsigned short val_marker) { return Surface_Buffet_Metric[val_marker]; } - -inline su2double CNSSolver::GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return CSkinFriction[val_marker][val_dim][val_vertex]; } - -inline su2double CNSSolver::GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) { return HeatFlux[val_marker][val_vertex]; } - -inline su2double CNSSolver::GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex) { return HeatFluxTarget[val_marker][val_vertex]; } - -inline void CNSSolver::SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat) { HeatFluxTarget[val_marker][val_vertex] = val_heat; } - -inline su2double CNSSolver::GetBuffetSensor(unsigned short val_marker, unsigned long val_vertex) { return Buffet_Sensor[val_marker][val_vertex]; } - -inline su2double CNSSolver::GetYPlus(unsigned short val_marker, unsigned long val_vertex) { return YPlus[val_marker][val_vertex]; } - -inline su2double CNSSolver::GetStrainMag_Max(void) { return StrainMag_Max; } - -inline su2double CNSSolver::GetOmega_Max(void) { return Omega_Max; } - -inline void CNSSolver::SetStrainMag_Max(su2double val_strainmag_max) { StrainMag_Max = val_strainmag_max; } - -inline void CNSSolver::SetOmega_Max(su2double val_omega_max) { Omega_Max = val_omega_max; } - -inline su2double CNSSolver::GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var) { return HeatConjugateVar[val_marker][val_vertex][pos_var]; } - -inline void CNSSolver::SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var) { - HeatConjugateVar[val_marker][val_vertex][pos_var] = relaxation_factor*val_var + (1.0-relaxation_factor)*HeatConjugateVar[val_marker][val_vertex][pos_var]; } - -inline CFluidModel* CFEM_DG_EulerSolver::GetFluidModel(void) { return FluidModel;} - -inline su2double* CFEM_DG_EulerSolver::GetVecSolDOFs(void) {return VecSolDOFs.data();} - -inline unsigned long CFEM_DG_EulerSolver::GetnDOFsGlobal(void) {return nDOFsGlobal;} - -inline su2double CFEM_DG_EulerSolver::GetDensity_Inf(void) { return Density_Inf; } - -inline su2double CFEM_DG_EulerSolver::GetModVelocity_Inf(void) { - su2double Vel2 = 0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Vel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; - return sqrt(Vel2); -} - -inline su2double CFEM_DG_EulerSolver::GetDensity_Energy_Inf(void) { return Density_Inf*Energy_Inf; } - -inline su2double CFEM_DG_EulerSolver::GetDensity_Velocity_Inf(unsigned short val_dim) { return Density_Inf*Velocity_Inf[val_dim]; } - -inline su2double CFEM_DG_EulerSolver::GetVelocity_Inf(unsigned short val_dim) { return Velocity_Inf[val_dim]; } - -inline su2double *CFEM_DG_EulerSolver::GetVelocity_Inf(void) { return Velocity_Inf; } - -inline su2double CFEM_DG_EulerSolver::GetPressure_Inf(void) { return Pressure_Inf; } - -inline su2double CFEM_DG_EulerSolver::GetCL_Inv(unsigned short val_marker) { return CL_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetCMz_Inv(unsigned short val_marker) { return CMz_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetCD_Inv(unsigned short val_marker) { return CD_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CL(unsigned short val_marker) { return Surface_CL[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CD(unsigned short val_marker) { return Surface_CD[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CSF(unsigned short val_marker) { return Surface_CSF[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CEff(unsigned short val_marker) { return Surface_CEff[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFx(unsigned short val_marker) { return Surface_CFx[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFy(unsigned short val_marker) { return Surface_CFy[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFz(unsigned short val_marker) { return Surface_CFz[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMx(unsigned short val_marker) { return Surface_CMx[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMy(unsigned short val_marker) { return Surface_CMy[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMz(unsigned short val_marker) { return Surface_CMz[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CL_Inv(unsigned short val_marker) { return Surface_CL_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CD_Inv(unsigned short val_marker) { return Surface_CD_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CSF_Inv(unsigned short val_marker) { return Surface_CSF_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CEff_Inv(unsigned short val_marker) { return Surface_CEff_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFx_Inv(unsigned short val_marker) { return Surface_CFx_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFy_Inv(unsigned short val_marker) { return Surface_CFy_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CFz_Inv(unsigned short val_marker) { return Surface_CFz_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMx_Inv(unsigned short val_marker) { return Surface_CMx_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMy_Inv(unsigned short val_marker) { return Surface_CMy_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetSurface_CMz_Inv(unsigned short val_marker) { return Surface_CMz_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetCSF_Inv(unsigned short val_marker) { return CSF_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetCEff_Inv(unsigned short val_marker) { return CEff_Inv[val_marker]; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CL() { return Total_CL; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CD() { return Total_CD; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CMx() { return Total_CMx; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CMy() { return Total_CMy; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CMz() { return Total_CMz; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CFx() { return Total_CFx; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CFy() { return Total_CFy; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CFz() { return Total_CFz; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CSF() { return Total_CSF; } - -inline su2double CFEM_DG_EulerSolver::GetTotal_CEff() { return Total_CEff; } - -inline void CFEM_DG_EulerSolver::SetTotal_CL(su2double val_Total_CL) { Total_CL = val_Total_CL; } - -inline void CFEM_DG_EulerSolver::SetTotal_CD(su2double val_Total_CD) { Total_CD = val_Total_CD; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CL_Inv() { return AllBound_CL_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CD_Inv() { return AllBound_CD_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CSF_Inv() { return AllBound_CSF_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CEff_Inv() { return AllBound_CEff_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CMx_Inv() { return AllBound_CMx_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CMy_Inv() { return AllBound_CMy_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CMz_Inv() { return AllBound_CMz_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CFx_Inv() { return AllBound_CFx_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CFy_Inv() { return AllBound_CFy_Inv; } - -inline su2double CFEM_DG_EulerSolver::GetAllBound_CFz_Inv() { return AllBound_CFz_Inv; } - -inline void CFEM_DG_EulerSolver::SetPressure_Inf(su2double p_inf){Pressure_Inf = p_inf;} - -inline void CFEM_DG_EulerSolver::SetTemperature_Inf(su2double t_inf){Temperature_Inf = t_inf;} - -inline void CFEM_DG_EulerSolver::BC_HeatFlux_Wall(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray) {} - -inline void CFEM_DG_EulerSolver::BC_Isothermal_Wall(CConfig *config, - const unsigned long surfElemBeg, - const unsigned long surfElemEnd, - const CSurfaceElementFEM *surfElem, - su2double *resFaces, - CNumerics *conv_numerics, - unsigned short val_marker, - su2double *workArray) {} - -inline su2double CFEM_DG_NSSolver::GetViscosity_Inf(void) { return Viscosity_Inf; } - -inline su2double CFEM_DG_NSSolver::GetTke_Inf(void) { return Tke_Inf; } - -inline su2double CFEM_DG_NSSolver::GetCL_Visc(unsigned short val_marker) { return CL_Visc[val_marker]; } - -inline su2double CFEM_DG_NSSolver::GetCMz_Visc(unsigned short val_marker) { return CMz_Visc[val_marker]; } - -inline su2double CFEM_DG_NSSolver::GetCSF_Visc(unsigned short val_marker) { return CSF_Visc[val_marker]; } - -inline su2double CFEM_DG_NSSolver::GetCD_Visc(unsigned short val_marker) { return CD_Visc[val_marker]; } - -inline su2double CFEM_DG_NSSolver::GetAllBound_CL_Visc() { return AllBound_CL_Visc; } - -inline su2double CFEM_DG_NSSolver::GetAllBound_CSF_Visc() { return AllBound_CSF_Visc; } - -inline su2double CFEM_DG_NSSolver::GetAllBound_CD_Visc() { return AllBound_CD_Visc; } - -inline su2double CFEM_DG_NSSolver::GetStrainMag_Max(void) { return StrainMag_Max; } - -inline su2double CFEM_DG_NSSolver::GetOmega_Max(void) { return Omega_Max; } - -inline void CFEM_DG_NSSolver::SetStrainMag_Max(su2double val_strainmag_max) { StrainMag_Max = val_strainmag_max; } - -inline void CFEM_DG_NSSolver::SetOmega_Max(su2double val_omega_max) { Omega_Max = val_omega_max; } - -inline su2double CAdjEulerSolver::GetCSensitivity(unsigned short val_marker, unsigned long val_vertex) { return CSensitivity[val_marker][val_vertex]; } - -inline void CAdjEulerSolver::SetCSensitivity(unsigned short val_marker, unsigned long val_vertex, su2double val_sensitivity) { CSensitivity[val_marker][val_vertex] = val_sensitivity; } - -inline unsigned long CAdjEulerSolver::GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex) { return DonorGlobalIndex[val_marker][val_vertex]; } - -inline void CAdjEulerSolver::SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index) { DonorGlobalIndex[val_marker][val_vertex] = val_index; } - -inline void CAdjEulerSolver::SetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value) { DonorAdjVar[val_marker][val_vertex][val_var] = val_value; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_Geo() { return Total_Sens_Geo; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_Mach() { return Total_Sens_Mach; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_AoA() { return Total_Sens_AoA; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_Press() { return Total_Sens_Press; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_Temp() { return Total_Sens_Temp; } - -inline su2double CAdjEulerSolver::GetTotal_Sens_BPress() { return Total_Sens_BPress; } - -inline su2double CAdjEulerSolver::GetPsiRho_Inf(void) { return PsiRho_Inf; } - -inline su2double CAdjEulerSolver::GetPsiE_Inf(void) { return PsiE_Inf; } - -inline su2double *CAdjEulerSolver::GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex) { return DonorAdjVar[val_marker][val_vertex]; } - -inline su2double CAdjEulerSolver::GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var) { return DonorAdjVar[val_marker][val_vertex][val_var]; } - -inline su2double CAdjEulerSolver::GetPhi_Inf(unsigned short val_dim) { return Phi_Inf[val_dim]; } - -inline void CSolver::RefGeom_Sensitivity(CGeometry *geometry, CSolver **solver_container, CConfig *config){ } - -inline void CSolver::DE_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config){ } - -inline void CSolver::Stiffness_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config){ } - -inline unsigned short CSolver::Get_iElem_iDe(unsigned long iElem) const { return 0; } - -inline void CSolver::Set_DV_Val(su2double val_EField, unsigned short i_DV){ } - -inline su2double CSolver::Get_DV_Val(unsigned short i_DV){ return 0.0; } - -inline su2double CSolver::Get_val_I(void){ return 0.0; } - -inline su2double CIncEulerSolver::GetDensity_Inf(void) { return Density_Inf; } - -inline su2double CIncEulerSolver::GetModVelocity_Inf(void) { - su2double Vel2 = 0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Vel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; - return sqrt(Vel2); -} - -inline CFluidModel* CIncEulerSolver::GetFluidModel(void) { return FluidModel;} - -inline su2double CIncEulerSolver::GetDensity_Velocity_Inf(unsigned short val_dim) { return Density_Inf*Velocity_Inf[val_dim]; } - -inline su2double CIncEulerSolver::GetVelocity_Inf(unsigned short val_dim) { return Velocity_Inf[val_dim]; } - -inline void CIncEulerSolver::SetVelocity_Inf(unsigned short val_dim, su2double val_velocity) { Velocity_Inf[val_dim] = val_velocity; } - -inline su2double *CIncEulerSolver::GetVelocity_Inf(void) { return Velocity_Inf; } - -inline su2double CIncEulerSolver::GetPressure_Inf(void) { return Pressure_Inf; } - -inline su2double CIncEulerSolver::GetTemperature_Inf(void) { return Temperature_Inf; } - -inline su2double CIncEulerSolver::GetCPressure(unsigned short val_marker, unsigned long val_vertex) { return CPressure[val_marker][val_vertex]; } - -inline su2double CIncEulerSolver::GetCPressureTarget(unsigned short val_marker, unsigned long val_vertex) { return CPressureTarget[val_marker][val_vertex]; } - -inline void CIncEulerSolver::SetCPressureTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_pressure) { CPressureTarget[val_marker][val_vertex] = val_pressure; } - -inline su2double *CIncEulerSolver::GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) { return CharacPrimVar[val_marker][val_vertex]; } - -inline su2double CIncEulerSolver::GetInlet_Ttotal(unsigned short val_marker, unsigned long val_vertex) { return Inlet_Ttotal[val_marker][val_vertex]; } - -inline su2double CIncEulerSolver::GetInlet_Ptotal(unsigned short val_marker, unsigned long val_vertex) { return Inlet_Ptotal[val_marker][val_vertex]; } - -inline su2double CIncEulerSolver::GetInlet_FlowDir(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return Inlet_FlowDir[val_marker][val_vertex][val_dim]; } - -inline su2double CIncEulerSolver::GetCD_Inv(unsigned short val_marker) { return CD_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CL(unsigned short val_marker) { return Surface_CL[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CD(unsigned short val_marker) { return Surface_CD[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CSF(unsigned short val_marker) { return Surface_CSF[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CEff(unsigned short val_marker) { return Surface_CEff[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFx(unsigned short val_marker) { return Surface_CFx[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFy(unsigned short val_marker) { return Surface_CFy[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFz(unsigned short val_marker) { return Surface_CFz[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMx(unsigned short val_marker) { return Surface_CMx[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMy(unsigned short val_marker) { return Surface_CMy[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMz(unsigned short val_marker) { return Surface_CMz[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CL_Inv(unsigned short val_marker) { return Surface_CL_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CD_Inv(unsigned short val_marker) { return Surface_CD_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CSF_Inv(unsigned short val_marker) { return Surface_CSF_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CEff_Inv(unsigned short val_marker) { return Surface_CEff_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFx_Inv(unsigned short val_marker) { return Surface_CFx_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFy_Inv(unsigned short val_marker) { return Surface_CFy_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFz_Inv(unsigned short val_marker) { return Surface_CFz_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMx_Inv(unsigned short val_marker) { return Surface_CMx_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMy_Inv(unsigned short val_marker) { return Surface_CMy_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMz_Inv(unsigned short val_marker) { return Surface_CMz_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetCSF_Inv(unsigned short val_marker) { return CSF_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetCEff_Inv(unsigned short val_marker) { return CEff_Inv[val_marker]; } - -inline su2double CIncEulerSolver::GetTotal_CL() { return Total_CL; } - -inline su2double CIncEulerSolver::GetTotal_CD() { return Total_CD; } - -inline su2double CIncEulerSolver::GetTotal_CMx() { return Total_CMx; } - -inline su2double CIncEulerSolver::GetTotal_CMy() { return Total_CMy; } - -inline su2double CIncEulerSolver::GetTotal_CMz() { return Total_CMz; } - -inline su2double CIncEulerSolver::GetTotal_CoPx() { return Total_CoPx; } - -inline su2double CIncEulerSolver::GetTotal_CoPy() { return Total_CoPy; } - -inline su2double CIncEulerSolver::GetTotal_CoPz() { return Total_CoPz; } - -inline su2double CIncEulerSolver::GetTotal_CFx() { return Total_CFx; } - -inline su2double CIncEulerSolver::GetTotal_CFy() { return Total_CFy; } - -inline su2double CIncEulerSolver::GetTotal_CFz() { return Total_CFz; } - -inline su2double CIncEulerSolver::GetTotal_CSF() { return Total_CSF; } - -inline su2double CIncEulerSolver::GetTotal_CEff() { return Total_CEff; } - -inline su2double CIncEulerSolver::GetTotal_CT() { return Total_CT; } - -inline void CIncEulerSolver::SetTotal_CT(su2double val_Total_CT) { Total_CT = val_Total_CT; } - -inline su2double CIncEulerSolver::GetTotal_CQ() { return Total_CQ; } - -inline su2double CIncEulerSolver::GetTotal_HeatFlux() { return Total_Heat; } - -inline su2double CIncEulerSolver::GetTotal_MaxHeatFlux() { return Total_MaxHeat; } - -inline void CIncEulerSolver::SetTotal_CQ(su2double val_Total_CQ) { Total_CQ = val_Total_CQ; } - -inline void CIncEulerSolver::SetTotal_HeatFlux(su2double val_Total_Heat) { Total_Heat = val_Total_Heat; } - -inline void CIncEulerSolver::SetTotal_MaxHeatFlux(su2double val_Total_MaxHeat) { Total_MaxHeat = val_Total_MaxHeat; } - -inline su2double CIncEulerSolver::GetTotal_CMerit() { return Total_CMerit; } - -inline su2double CIncEulerSolver::GetTotal_CpDiff() { return Total_CpDiff; } - -inline su2double CIncEulerSolver::GetTotal_HeatFluxDiff() { return Total_HeatFluxDiff; } - -inline void CIncEulerSolver::SetTotal_CpDiff(su2double pressure) { Total_CpDiff = pressure; } - -inline void CIncEulerSolver::SetTotal_HeatFluxDiff(su2double heat) { Total_HeatFluxDiff = heat; } - -inline void CIncEulerSolver::SetTotal_CD(su2double val_Total_CD) { Total_CD = val_Total_CD; } - -inline su2double CIncEulerSolver::GetTotal_Custom_ObjFunc() { return Total_Custom_ObjFunc; } - -inline void CIncEulerSolver::SetTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { Total_Custom_ObjFunc = val_total_custom_objfunc*val_weight; } - -inline void CIncEulerSolver::AddTotal_Custom_ObjFunc(su2double val_total_custom_objfunc, su2double val_weight) { Total_Custom_ObjFunc += val_total_custom_objfunc*val_weight; } - -inline su2double CIncEulerSolver::GetAllBound_CL_Inv() { return AllBound_CL_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CD_Inv() { return AllBound_CD_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CSF_Inv() { return AllBound_CSF_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CEff_Inv() { return AllBound_CEff_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CMx_Inv() { return AllBound_CMx_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CMy_Inv() { return AllBound_CMy_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CMz_Inv() { return AllBound_CMz_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CoPx_Inv() { return AllBound_CoPx_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CoPy_Inv() { return AllBound_CoPy_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CoPz_Inv() { return AllBound_CoPz_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CFx_Inv() { return AllBound_CFx_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CFy_Inv() { return AllBound_CFy_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CFz_Inv() { return AllBound_CFz_Inv; } - -inline su2double CIncEulerSolver::GetAllBound_CL_Mnt() { return AllBound_CL_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CD_Mnt() { return AllBound_CD_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CSF_Mnt() { return AllBound_CSF_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CEff_Mnt() { return AllBound_CEff_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CMx_Mnt() { return AllBound_CMx_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CMy_Mnt() { return AllBound_CMy_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CMz_Mnt() { return AllBound_CMz_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CoPx_Mnt() { return AllBound_CoPx_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CoPy_Mnt() { return AllBound_CoPy_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CoPz_Mnt() { return AllBound_CoPz_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CFx_Mnt() { return AllBound_CFx_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CFy_Mnt() { return AllBound_CFy_Mnt; } - -inline su2double CIncEulerSolver::GetAllBound_CFz_Mnt() { return AllBound_CFz_Mnt; } - -inline su2double CIncEulerSolver::GetSurface_CL_Mnt(unsigned short val_marker) { return Surface_CL_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CD_Mnt(unsigned short val_marker) { return Surface_CD_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CSF_Mnt(unsigned short val_marker) { return Surface_CSF_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CEff_Mnt(unsigned short val_marker) { return Surface_CEff_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFx_Mnt(unsigned short val_marker) { return Surface_CFx_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFy_Mnt(unsigned short val_marker) { return Surface_CFy_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CFz_Mnt(unsigned short val_marker) { return Surface_CFz_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMx_Mnt(unsigned short val_marker) { return Surface_CMx_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMy_Mnt(unsigned short val_marker) { return Surface_CMy_Mnt[val_marker]; } - -inline su2double CIncEulerSolver::GetSurface_CMz_Mnt(unsigned short val_marker) { return Surface_CMz_Mnt[val_marker]; } - -inline void CIncEulerSolver::SetPressure_Inf(su2double p_inf){Pressure_Inf = p_inf;} - -inline void CIncEulerSolver::SetTemperature_Inf(su2double t_inf){Temperature_Inf = t_inf;} - -inline void CIncEulerSolver::SetDensity_Inf(su2double rho_inf){Density_Inf = rho_inf;} - -inline void CIncEulerSolver::SetTotal_ComboObj(su2double ComboObj) {Total_ComboObj = ComboObj; } - -inline su2double CIncEulerSolver::GetTotal_ComboObj() { return Total_ComboObj; } - -inline su2double CIncNSSolver::GetViscosity_Inf(void) { return Viscosity_Inf; } - -inline su2double CIncNSSolver::GetTke_Inf(void) { return Tke_Inf; } - -inline su2double CIncNSSolver::GetSurface_HF_Visc(unsigned short val_marker) { return Surface_HF_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_MaxHF_Visc(unsigned short val_marker) { return Surface_MaxHF_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetCL_Visc(unsigned short val_marker) { return CL_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetCSF_Visc(unsigned short val_marker) { return CSF_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetCD_Visc(unsigned short val_marker) { return CD_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetAllBound_CL_Visc() { return AllBound_CL_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CSF_Visc() { return AllBound_CSF_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CD_Visc() { return AllBound_CD_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CEff_Visc() { return AllBound_CEff_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CMx_Visc() { return AllBound_CMx_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CMy_Visc() { return AllBound_CMy_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CMz_Visc() { return AllBound_CMz_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CoPx_Visc() { return AllBound_CoPx_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CoPy_Visc() { return AllBound_CoPy_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CoPz_Visc() { return AllBound_CoPz_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CFx_Visc() { return AllBound_CFx_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CFy_Visc() { return AllBound_CFy_Visc; } - -inline su2double CIncNSSolver::GetAllBound_CFz_Visc() { return AllBound_CFz_Visc; } - -inline su2double CIncNSSolver::GetSurface_CL_Visc(unsigned short val_marker) { return Surface_CL_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CD_Visc(unsigned short val_marker) { return Surface_CD_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CSF_Visc(unsigned short val_marker) { return Surface_CSF_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CEff_Visc(unsigned short val_marker) { return Surface_CEff_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CFx_Visc(unsigned short val_marker) { return Surface_CFx_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CFy_Visc(unsigned short val_marker) { return Surface_CFy_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CFz_Visc(unsigned short val_marker) { return Surface_CFz_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CMx_Visc(unsigned short val_marker) { return Surface_CMx_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CMy_Visc(unsigned short val_marker) { return Surface_CMy_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetSurface_CMz_Visc(unsigned short val_marker) { return Surface_CMz_Visc[val_marker]; } - -inline su2double CIncNSSolver::GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) { return CSkinFriction[val_marker][val_dim][val_vertex]; } - -inline su2double CIncNSSolver::GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) { return HeatFlux[val_marker][val_vertex]; } - -inline su2double CIncNSSolver::GetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex) { return HeatFluxTarget[val_marker][val_vertex]; } - -inline void CIncNSSolver::SetHeatFluxTarget(unsigned short val_marker, unsigned long val_vertex, su2double val_heat) { HeatFluxTarget[val_marker][val_vertex] = val_heat; } - -inline su2double CIncNSSolver::GetYPlus(unsigned short val_marker, unsigned long val_vertex) { return YPlus[val_marker][val_vertex]; } - -inline su2double CIncNSSolver::GetStrainMag_Max(void) { return StrainMag_Max; } - -inline su2double CIncNSSolver::GetOmega_Max(void) { return Omega_Max; } - -inline void CIncNSSolver::SetStrainMag_Max(su2double val_strainmag_max) { StrainMag_Max = val_strainmag_max; } - -inline void CIncNSSolver::SetOmega_Max(su2double val_omega_max) { Omega_Max = val_omega_max; } - -inline su2double CIncNSSolver::GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var) { return HeatConjugateVar[val_marker][val_vertex][pos_var]; } - -inline void CIncNSSolver::SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var) { - HeatConjugateVar[val_marker][val_vertex][pos_var] = relaxation_factor*val_var + (1.0-relaxation_factor)*HeatConjugateVar[val_marker][val_vertex][pos_var]; } - -inline su2double CHeatSolverFVM::GetTotal_HeatFlux() { return Total_HeatFlux; } - -inline su2double CHeatSolverFVM::GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) { return HeatFlux[val_marker][val_vertex]; } - -inline su2double CHeatSolverFVM::GetTotal_AvgTemperature() { return Total_AverageT; } - -inline su2double CHeatSolverFVM::GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var) { return ConjugateVar[val_marker][val_vertex][pos_var]; } - -inline void CHeatSolverFVM::SetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var, su2double relaxation_factor, su2double val_var) { - ConjugateVar[val_marker][val_vertex][pos_var] = relaxation_factor*val_var + (1.0-relaxation_factor)*ConjugateVar[val_marker][val_vertex][pos_var]; } - -inline void CSolver::SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::ExtractAdjoint_Geometry(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::ExtractAdjoint_CrossTerm(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::ExtractAdjoint_CrossTerm_Geometry(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::ExtractAdjoint_CrossTerm_Geometry_Flow(CGeometry *geometry, CConfig *config) {} - -inline void CSolver::SetMesh_Recording(CGeometry **geometry, CVolumetricMovement *grid_movement, CConfig *config) {} - -inline su2double CDiscAdjSolver::GetTotal_Sens_Geo() { return Total_Sens_Geo; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_Mach() { return Total_Sens_Mach; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_AoA() { return Total_Sens_AoA; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_Press() { return Total_Sens_Press; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_Temp() { return Total_Sens_Temp; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_BPress() { return Total_Sens_BPress; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_Density() { return Total_Sens_Density; } - -inline su2double CDiscAdjSolver::GetTotal_Sens_ModVel() { return Total_Sens_ModVel; } - -inline su2double CDiscAdjSolver::GetCSensitivity(unsigned short val_marker, unsigned long val_vertex) { return CSensitivity[val_marker][val_vertex]; } - -inline void CEulerSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ - SlidingState[val_marker][val_vertex][val_state][donor_index] = component; -} - -inline void CIncEulerSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ - SlidingState[val_marker][val_vertex][val_state][donor_index] = component; -} - -inline void CSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ } - -inline su2double CEulerSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return SlidingState[val_marker][val_vertex][val_state][donor_index]; } - -inline su2double CIncEulerSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return SlidingState[val_marker][val_vertex][val_state][donor_index]; } - -inline su2double CSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return 0; } - -inline int CEulerSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return SlidingStateNodes[val_marker][val_vertex]; } - -inline int CIncEulerSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return SlidingStateNodes[val_marker][val_vertex]; } - -inline int CSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return 0; } - -inline void CEulerSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){ SlidingStateNodes[val_marker][val_vertex] = value; } - -inline void CIncEulerSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){ SlidingStateNodes[val_marker][val_vertex] = value; } - -inline void CSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){} - -inline void CSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){} - -inline void CEulerSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){ - int iVar; - - for( iVar = 0; iVar < nPrimVar+1; iVar++){ - if( SlidingState[val_marker][val_vertex][iVar] != NULL ) - delete [] SlidingState[val_marker][val_vertex][iVar]; - } - - for( iVar = 0; iVar < nPrimVar+1; iVar++) - SlidingState[val_marker][val_vertex][iVar] = new su2double[ GetnSlidingStates(val_marker, val_vertex) ]; -} - - -inline void CIncEulerSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){ - int iVar; - - for( iVar = 0; iVar < nPrimVar+1; iVar++){ - if( SlidingState[val_marker][val_vertex][iVar] != NULL ) - delete [] SlidingState[val_marker][val_vertex][iVar]; - } - - for( iVar = 0; iVar < nPrimVar+1; iVar++) - SlidingState[val_marker][val_vertex][iVar] = new su2double[ GetnSlidingStates(val_marker, val_vertex) ]; -} - - - -inline void CTurbSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ - SlidingState[val_marker][val_vertex][val_state][donor_index] = component; -} - -inline int CTurbSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return SlidingStateNodes[val_marker][val_vertex]; } - -inline void CTurbSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){ - int iVar; - - for( iVar = 0; iVar < nVar+1; iVar++){ - if( SlidingState[val_marker][val_vertex][iVar] != NULL ) - delete [] SlidingState[val_marker][val_vertex][iVar]; - } - - for( iVar = 0; iVar < nVar+1; iVar++) - SlidingState[val_marker][val_vertex][iVar] = new su2double[ GetnSlidingStates(val_marker, val_vertex) ]; -} - -inline void CTurbSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){ SlidingStateNodes[val_marker][val_vertex] = value; } - -inline su2double CTurbSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return SlidingState[val_marker][val_vertex][val_state][donor_index]; } - -inline void CTurbSolver::SetInlet_TurbVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim, su2double val_turb_var) { - /*--- Since this call can be accessed indirectly using python, do some error - * checking to prevent segmentation faults ---*/ - if (val_marker >= nMarker) - SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_TurbVars == NULL || Inlet_TurbVars[val_marker] == NULL) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); - else if (val_vertex >= nVertex[val_marker]) - SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); - else if (val_dim >= nVar) - SU2_MPI::Error("Out-of-bounds index used for inlet turbulence variable.", CURRENT_FUNCTION); - else - Inlet_TurbVars[val_marker][val_vertex][val_dim] = val_turb_var; -} - -inline void CTurbSASolver::SetFreeStream_Solution(CConfig *config) { - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) nodes->SetSolution(iPoint, 0, nu_tilde_Inf); -} - -inline su2double CTurbSASolver::GetNuTilde_Inf(void) { return nu_tilde_Inf; } - -inline void CTurbSSTSolver::SetFreeStream_Solution(CConfig *config){ - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++){ - nodes->SetSolution(iPoint, 0, kine_Inf); - nodes->SetSolution(iPoint, 1, omega_Inf); - } -} - -inline su2double CTurbSSTSolver::GetTke_Inf(void) { return kine_Inf; } - -inline su2double CTurbSSTSolver::GetOmega_Inf(void) { return omega_Inf; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_E(unsigned short iVal) { return Total_Sens_E[iVal]; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_Nu(unsigned short iVal) { return Total_Sens_Nu[iVal]; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_Rho(unsigned short iVal) { return Total_Sens_Rho[iVal]; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_Rho_DL(unsigned short iVal) { return Total_Sens_Rho_DL[iVal]; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_EField(unsigned short iEField) { return Total_Sens_EField[iEField]; } - -inline su2double CDiscAdjFEASolver::GetTotal_Sens_DVFEA(unsigned short iDVFEA) { return Total_Sens_DV[iDVFEA]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_E(unsigned short iVal) { return Global_Sens_E[iVal]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_Nu(unsigned short iVal) { return Global_Sens_Nu[iVal]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_Rho(unsigned short iVal) { return Global_Sens_Rho[iVal]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_Rho_DL(unsigned short iVal) { return Global_Sens_Rho_DL[iVal]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_EField(unsigned short iEField) { return Global_Sens_EField[iEField]; } - -inline su2double CDiscAdjFEASolver::GetGlobal_Sens_DVFEA(unsigned short iDVFEA) { return Global_Sens_DV[iDVFEA]; } - -inline su2double CDiscAdjFEASolver::GetVal_Young(unsigned short iVal) { return E_i[iVal]; } - -inline su2double CDiscAdjFEASolver::GetVal_Poisson(unsigned short iVal) { return Nu_i[iVal]; } - -inline su2double CDiscAdjFEASolver::GetVal_Rho(unsigned short iVal) { return Rho_i[iVal]; } - -inline su2double CDiscAdjFEASolver::GetVal_Rho_DL(unsigned short iVal) { return Rho_DL_i[iVal]; } - -inline unsigned short CDiscAdjFEASolver::GetnEField(void) { return nEField; } - -inline unsigned short CDiscAdjFEASolver::GetnDVFEA(void) { return nDV; } - -inline su2double CDiscAdjFEASolver::GetVal_EField(unsigned short iVal) { return EField[iVal]; } - -inline su2double CDiscAdjFEASolver::GetVal_DVFEA(unsigned short iVal) { return DV_Val[iVal]; } - -inline void CSolver::SetDualTime_Mesh(void){ } - -inline vector CSolver::GetSolutionFields(){return fields;} From 03b6a5c5a5bf7aeb9a6d0e54ff3e1b7f150080e3 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 29 Jan 2020 09:50:22 +0100 Subject: [PATCH 048/326] Remove regression testing upon push, as Draft PR to develop get triggerd anyway. --- .github/workflows/regression.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 7ad1657228da..2b1b6b5b1b4e 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -5,7 +5,6 @@ on: branches: - 'develop' - 'master' - - 'feature_periodic_streamwise' pull_request: branches: - 'develop' From e120ec3f533654b21087f14ff42d2856ab50ddd7 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 31 Jan 2020 16:32:12 +0100 Subject: [PATCH 049/326] Make build working again. --- Common/include/CConfig.hpp | 28 ++++++++++++++-------------- Common/include/option_structure.hpp | 12 ++++++------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 330f24760c0b..33041cff58ed 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5846,73 +5846,73 @@ class CConfig { * \brief Get information about the streamwise periodicity (None, Pressure_Drop, Massflow). * \return Driving force identification. */ - unsigned short GetKind_Streamwise_Periodic(void); + unsigned short GetKind_Streamwise_Periodic(void) const { return Kind_Streamwise_Periodic; } /*! * \brief Get information about the streamwise periodicity Energy equation handling. * \return Real periodic treatment of energy equation. */ - bool GetStreamwise_Periodic_Temperature(void); + bool GetStreamwise_Periodic_Temperature(void) const { return Streamwise_Periodic_Temperature; } /*! * \brief Get the value of the artificial periodic outlet heat. * \return Heat value. */ - su2double GetStreamwise_Periodic_OutletHeat(void); + su2double GetStreamwise_Periodic_OutletHeat(void) const { return Streamwise_Periodic_OutletHeat; } /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. */ - su2double GetStreamwise_Periodic_PressureDrop(void); + su2double GetStreamwise_Periodic_PressureDrop(void) const { return Streamwise_Periodic_PressureDrop; } /*! * \brief Set the value of the pressure delta from which body force vector is computed. * \param[in] delta_p - pressure difference between in- and outlet. */ - void SetStreamwise_Periodic_PressureDrop(su2double delta_p); + void SetStreamwise_Periodic_PressureDrop(su2double delta_p) { Streamwise_Periodic_PressureDrop = delta_p; } /*! * \brief Get the value of the massflow from which body force vector is computed. * \return Massflow for body force computation. */ - su2double GetStreamwise_Periodic_TargetMassFlow(void); + su2double GetStreamwise_Periodic_TargetMassFlow(void) const { return Streamwise_Periodic_TargetMassFlow; } /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - vector GetStreamwise_Periodic_RefNode(void); + vector GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - void SetStreamwise_Periodic_RefNode(vector RefNode); + void SetStreamwise_Periodic_RefNode(vector RefNode) { Streamwise_Periodic_RefNode = RefNode; } /*! * \brief Get the massflow of the streamwise periodic donor/outlet boundary. * \return The streamwise periodic donor/outlet massflow. */ - su2double GetStreamwise_Periodic_MassFlow(); + su2double GetStreamwise_Periodic_MassFlow() const { return Streamwise_Periodic_MassFlow; } /*! * \brief Set the massflow at the streamwise periodic donor/outlet boundary. * \param[in] val_massflow - Massflow at the streamwise periodic donor marker. */ - void SetStreamwise_Periodic_MassFlow(su2double val_massflow); + void SetStreamwise_Periodic_MassFlow(su2double val_massflow) { Streamwise_Periodic_MassFlow = val_massflow; } /*! * \brief Get the net sum of the heatflow into the domain. * \return The net sum of the heatflow into the domain. */ - su2double GetStreamwise_Periodic_IntegratedHeatFlow(); + su2double GetStreamwise_Periodic_IntegratedHeatFlow() const { return Streamwise_Periodic_IntegratedHeatFlow; } /*! * \brief Set the net sum of the heatflow into the domain. * \param[in] val_heatflow - Net sum of the heatflow into the domain. */ - void SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow); + void SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow) { Streamwise_Periodic_IntegratedHeatFlow = val_heatflow; } /*! * \brief Get information about the rotational frame. @@ -6307,14 +6307,14 @@ class CConfig { /*! * \brief Translation vector for a translational (TK:: rotational in Toms code) periodic boundary. */ - su2double *GetPeriodicTranslation(string val_marker); + su2double *GetPeriodicTranslation(string val_marker) ; /*! * \brief Get the translation vector for a periodic transformation. * \param[in] val_index - Index corresponding to the periodic transformation. * \return The translation vector. */ - su2double* GetPeriodicTranslation(unsigned short val_index); + su2double* GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } /*! * \brief Get the rotationally periodic donor marker for boundary val_marker. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bfa1a105d7fc..4b04a7a4ebe2 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2145,14 +2145,14 @@ static const MapType Verification_Solution_ * \brief types of streamwise periodicity. */ enum ENUM_STREAMWISE_PERIODIC { - NO_STREAMWISE_PERIODIC = 0, /*!< \brief No projection. */ - PRESSURE_DROP = 1, /*!< \brief Prescribed pressure drop. */ - STREAMWISE_MASSFLOW = 2, /*!< \brief Prescribed massflow. */ + NO_STREAMWISE_PERIODIC = 0, /*!< \brief No projection. */ + PRESSURE_DROP = 1, /*!< \brief Prescribed pressure drop. */ + STREAMWISE_MASSFLOW = 2, /*!< \brief Prescribed massflow. */ }; static const MapType Streamwise_Periodic_Map = { - MakePair("NONE" , NO_STREAMWISE_PERIODIC) - MakePair("PRESSURE_DROP" , PRESSURE_DROP) - MakePair("MASSFLOW" , STREAMWISE_MASSFLOW); + MakePair("NONE", NO_STREAMWISE_PERIODIC) + MakePair("PRESSURE_DROP", PRESSURE_DROP) + MakePair("MASSFLOW", STREAMWISE_MASSFLOW) }; #undef MakePair From e667b3327bd5f015eaff703e3a0818dbcce7c72b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 27 Mar 2020 10:15:22 +0100 Subject: [PATCH 050/326] Some minor stylistic changes. --- SU2_CFD/include/iteration_structure.hpp | 13 +++++++++++++ SU2_CFD/src/iteration_structure.cpp | 12 ++++++++++++ SU2_CFD/src/output/CFlowOutput.cpp | 1 + SU2_CFD/src/solvers/CIncEulerSolver.cpp | 16 ++++++++-------- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/SU2_CFD/include/iteration_structure.hpp b/SU2_CFD/include/iteration_structure.hpp index 85a6f82e7b3a..428b07b0bd1f 100644 --- a/SU2_CFD/include/iteration_structure.hpp +++ b/SU2_CFD/include/iteration_structure.hpp @@ -757,6 +757,19 @@ class CHeatIteration : public CFluidIteration { CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst); + + void Postprocess(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); + }; /*! diff --git a/SU2_CFD/src/iteration_structure.cpp b/SU2_CFD/src/iteration_structure.cpp index 353816cac7d2..0d52251b5f43 100644 --- a/SU2_CFD/src/iteration_structure.cpp +++ b/SU2_CFD/src/iteration_structure.cpp @@ -1304,6 +1304,18 @@ void CHeatIteration::Update(COutput *output, } } +void CHeatIteration::Postprocess(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) { } + CFEAIteration::CFEAIteration(CConfig *config) : CIteration(config) { } CFEAIteration::~CFEAIteration(void) { } void CFEAIteration::Preprocess() { } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 6e3a9aedf8de..982843cf23b3 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -510,6 +510,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi su2double TotalPressure = Surface_TotalPressure_Total[iMarker_Analyze] * config->GetPressure_Ref(); SetHistoryOutputPerSurfaceValue("AVG_TOTALPRESS", TotalPressure, iMarker_Analyze); Tot_Surface_TotalPressure += TotalPressure; + config->SetSurface_TotalPressure(0, Tot_Surface_TotalPressure); //TK:: otherwise the OBJ_FUNCTION SURFACE_TOTAL_PRESSURE cannot be used in singlezonem mode } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 770982f2abcc..574939168265 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2083,7 +2083,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Gradient of the primitive variables ---*/ numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), NULL); - + } /*--- Compute the streamwise periodic source residual ---*/ @@ -2099,7 +2099,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(!streamwise_periodic_temperature && energy) { //loop markers and find the "outlet marker" - + //compute "outlet" area su2double Area_Local = 0.0, Area_Global = 0.0, @@ -2118,13 +2118,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Only "inlet"/master periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { - + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->node[iPoint]->GetDomain()) { geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - + if (axisymmetric) { if (geometry->node[iPoint]->GetCoord(1) != 0.0) AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); @@ -2133,19 +2133,19 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } else { AxiFactor = 1.0; } - + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ FaceArea = 0.0; for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } Area_Local += sqrt(FaceArea); FaceArea = sqrt(FaceArea); Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); - + } // if domain } // loop vertices } // loop periodic boundaries } // loop MarkerAll - + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); @@ -2153,7 +2153,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(rank==MASTER_NODE && false) cout << "Source Res outlet area: " << Area_Global << endl << "Outlet Area Avg Temperature: " << Temperature_Global* config->GetTemperature_Ref() << endl; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - + /*--- Only "inlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { From 3ba79035e6544d0ace77c91bc91da71b9c566c95 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 17 Apr 2020 17:42:38 +0200 Subject: [PATCH 051/326] Debugging massflow adjoint changes. --- Common/include/CConfig.hpp | 4 ++++ Common/src/grid_movement_structure.cpp | 7 ++++--- SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp | 4 +++- SU2_CFD/src/numerics/flow/flow_sources.cpp | 4 ++-- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 5 +++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 0587644e07af..797d5286ffec 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -61,6 +61,7 @@ using namespace std; class CConfig { private: + bool DirectRunActive = false; /*!< \brief Indicates whether currently the primal is taped during discrete adjoint run.*/ SU2_MPI::Comm SU2_Communicator; /*!< \brief MPI communicator of SU2.*/ int rank, size; /*!< \brief MPI rank and size.*/ bool base_config; @@ -9474,4 +9475,7 @@ class CConfig { */ unsigned long GetEdgeColoringGroupSize(void) const { return edgeColorGroupSize; } + void SetDirectRunActive() { DirectRunActive = true; } + bool GetDirectRunActive() const { return DirectRunActive; } + }; diff --git a/Common/src/grid_movement_structure.cpp b/Common/src/grid_movement_structure.cpp index 6cde32a5671e..08a8ff7c54a2 100644 --- a/Common/src/grid_movement_structure.cpp +++ b/Common/src/grid_movement_structure.cpp @@ -1632,9 +1632,10 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig plane, internal and periodic bc the receive boundaries and periodic boundaries. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (((config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && + if ((//(config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) && - (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY))) { + (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { @@ -1671,7 +1672,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig /*--- Set to zero displacements of the normal component for the symmetry plane condition ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) ) { + if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) && false ) { su2double *Coord_0 = NULL; for (iDim = 0; iDim < nDim; iDim++) MeanCoord[iDim] = 0.0; diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 18d7da37d96d..4c27764f8266 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -400,6 +400,8 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ void CDiscAdjSinglezoneDriver::DirectRun(unsigned short kind_recording){ + config->SetDirectRunActive(); + /*--- Mesh movement ---*/ direct_iteration->SetMesh_Deformation(geometry_container[ZONE_0][INST_0], solver, numerics, config, kind_recording); @@ -426,7 +428,7 @@ void CDiscAdjSinglezoneDriver::Print_DirectResidual(unsigned short kind_recordin /*--- Print the residuals of the direct iteration that we just recorded ---*/ /*--- This routine should be moved to the output, once the new structure is in place ---*/ - if ((rank == MASTER_NODE) && (kind_recording == MainVariables)){ + if ((rank == MASTER_NODE)){ //&& (kind_recording == MainVariables)){ switch (config->GetKind_Solver()) { diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 381487b8b4b5..2cb65071b28b 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -579,7 +579,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ Streamwise_Coord_Vector[iDim] = config->GetPeriodicTranslation(0)[iDim]; /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: - dot_prod(t*t) = (|t|_2)^2 ---*/ + dot_prod(t*t) = (|t|_2)^2 ---*/ norm2_translation = 0.0; for (iDim = 0; iDim < nDim; iDim++) norm2_translation += Streamwise_Coord_Vector[iDim] * Streamwise_Coord_Vector[iDim]; @@ -595,7 +595,7 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, delta_p = config->GetStreamwise_Periodic_PressureDrop(); massflow = config->GetStreamwise_Periodic_MassFlow(); integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); - + //cout << "Delta p: " << delta_p << endl; /*--- Initialize the Jacobian contribution to zero ---*/ if (implicit) { for (iVar=0; iVar < nVar; iVar++) diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index ae15603447f8..ce30c0afd551 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -108,7 +108,7 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the adjoint Velocity z-component. AddHistoryOutput("RMS_ADJ_VELOCITY-Z", "rms[A_W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity z-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the temperature. - AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", " Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ switch(turb_model){ case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 9da82eb936f0..41c370e22451 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -18,7 +18,7 @@ * * SU2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public @@ -6021,7 +6021,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at best ---*/ if((nZone==1 && InnerIter > 0) || - (nZone>1 && OuterIter > 0)) + (nZone>1 && OuterIter > 0) || + (config->GetDirectRunActive())) // Otherwise this is not done during the adjoint run. config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); /*--- Output the new value of Delta P and ddp ---*/ From 5a9e4a3f05d385649919ca6d6d5a201cc0089f6f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 17 Apr 2020 18:53:27 +0200 Subject: [PATCH 052/326] Monitor SWdp sens for debugging. --- SU2_CFD/include/solvers/CDiscAdjSolver.hpp | 2 +- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp index f654c2637356..8b0ce4d82813 100644 --- a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp @@ -50,7 +50,7 @@ class CDiscAdjSolver final : public CSolver { su2double Total_Sens_Density; /*!< \brief Total sensitivity to initial density (incompressible). */ su2double Total_Sens_ModVel; /*!< \brief Total sensitivity to inlet velocity (incompressible). */ su2double ObjFunc_Value; /*!< \brief Value of the objective function. */ - su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel; + su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel, SWPressureDrop, Local_Sens_SWPressureDrop; su2double TemperatureRad, Total_Sens_Temp_Rad; su2double *Solution_Geometry; /*!< \brief Auxiliary vector for the geometry solution (dimension nDim instead of nVar). */ diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index 6523ea691858..9527a208d9ce 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -339,6 +339,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo ModVel = config->GetIncInlet_BC(); BPressure = config->GetIncPressureOut_BC(); Temperature = config->GetIncTemperature_BC(); + SWPressureDrop = config->GetStreamwise_Periodic_PressureDrop(); /*--- Register the variables for AD. ---*/ @@ -346,6 +347,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo AD::RegisterInput(ModVel); AD::RegisterInput(BPressure); AD::RegisterInput(Temperature); + AD::RegisterInput(SWPressureDrop); } /*--- Set the BC values in the config class. ---*/ @@ -353,6 +355,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo config->SetIncInlet_BC(ModVel); config->SetIncPressureOut_BC(BPressure); config->SetIncTemperature_BC(Temperature); + config->SetStreamwise_Periodic_PressureDrop(SWPressureDrop); } @@ -591,6 +594,9 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_BPress = SU2_TYPE::GetDerivative(BPressure); Local_Sens_Temp = SU2_TYPE::GetDerivative(Temperature); + Local_Sens_SWPressureDrop = SU2_TYPE::GetDerivative(SWPressureDrop); + cout << "Local_Sens_SWPressureDrop: " << Local_Sens_SWPressureDrop << endl; + SU2_MPI::Allreduce(&Local_Sens_ModVel, &Total_Sens_ModVel, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); @@ -714,6 +720,8 @@ void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { direct_solver->GetNodes()->SetAdjointSolution(iPoint,Solution); } } + + SU2_TYPE::SetDerivative(SWPressureDrop, SU2_TYPE::GetValue(Local_Sens_SWPressureDrop)); } void CDiscAdjSolver::SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config){ From 1f9b5a39815f0dfbe69cacba2d88069437ced776 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 17 Apr 2020 19:33:01 +0200 Subject: [PATCH 053/326] Streamwise massflow gradient debugging --- SU2_CFD/include/solvers/CDiscAdjSolver.hpp | 2 +- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp index 8b0ce4d82813..da6c31cc0512 100644 --- a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp @@ -50,7 +50,7 @@ class CDiscAdjSolver final : public CSolver { su2double Total_Sens_Density; /*!< \brief Total sensitivity to initial density (incompressible). */ su2double Total_Sens_ModVel; /*!< \brief Total sensitivity to inlet velocity (incompressible). */ su2double ObjFunc_Value; /*!< \brief Value of the objective function. */ - su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel, SWPressureDrop, Local_Sens_SWPressureDrop; + su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel, SWPressureDrop, Local_Sens_SWPressureDrop, Output_SWPressureDrop; su2double TemperatureRad, Total_Sens_Temp_Rad; su2double *Solution_Geometry; /*!< \brief Auxiliary vector for the geometry solution (dimension nDim instead of nVar). */ diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index 9527a208d9ce..fc676e43bad0 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -394,6 +394,8 @@ void CDiscAdjSolver::RegisterOutput(CGeometry *geometry, CConfig *config) { /*--- Register variables as output of the solver iteration ---*/ direct_solver->GetNodes()->RegisterSolution(input, push_index); + + Output_SWPressureDrop = config->GetStreamwise_Periodic_PressureDrop(); } void CDiscAdjSolver::RegisterObj_Func(CConfig *config) { @@ -721,7 +723,7 @@ void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { } } - SU2_TYPE::SetDerivative(SWPressureDrop, SU2_TYPE::GetValue(Local_Sens_SWPressureDrop)); + SU2_TYPE::SetDerivative(Output_SWPressureDrop, SU2_TYPE::GetValue(Local_Sens_SWPressureDrop)); } void CDiscAdjSolver::SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config){ From 2c91a514e0dde8d4016789087a6b333b13f29141 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 29 Apr 2020 09:58:26 +0200 Subject: [PATCH 054/326] commit to merge develop --- Common/src/grid_movement_structure.cpp | 5 +++-- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/src/grid_movement_structure.cpp b/Common/src/grid_movement_structure.cpp index 08a8ff7c54a2..013c8714e3e1 100644 --- a/Common/src/grid_movement_structure.cpp +++ b/Common/src/grid_movement_structure.cpp @@ -1634,8 +1634,9 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((//(config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) && - (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY))) { + (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) //&& + //(config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) + )) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index fc676e43bad0..02e26407c472 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -597,7 +597,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_Temp = SU2_TYPE::GetDerivative(Temperature); Local_Sens_SWPressureDrop = SU2_TYPE::GetDerivative(SWPressureDrop); - cout << "Local_Sens_SWPressureDrop: " << Local_Sens_SWPressureDrop << endl; + //cout << "Local_Sens_SWPressureDrop: " << Local_Sens_SWPressureDrop << endl; SU2_MPI::Allreduce(&Local_Sens_ModVel, &Total_Sens_ModVel, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); From e5a74bea929e4b178d8a9084bf41ec47525fa88c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 4 May 2020 09:46:23 +0200 Subject: [PATCH 055/326] Resolve build error due to merge --- SU2_CFD/src/iteration_structure.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/SU2_CFD/src/iteration_structure.cpp b/SU2_CFD/src/iteration_structure.cpp index 755277b2a98b..d3df3c5d4311 100644 --- a/SU2_CFD/src/iteration_structure.cpp +++ b/SU2_CFD/src/iteration_structure.cpp @@ -1182,18 +1182,6 @@ void CHeatIteration::Update(COutput *output, } } -void CHeatIteration::Postprocess(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) { } - CFEAIteration::CFEAIteration(CConfig *config) : CIteration(config) { } CFEAIteration::~CFEAIteration(void) { } void CFEAIteration::Preprocess() { } From 896cd66898d539d8141dbe59d25f83e81d2c7c15 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 7 May 2020 14:32:09 +0200 Subject: [PATCH 056/326] Make FD.py run for multizone cases. --- SU2_DOT/src/SU2_DOT.cpp | 41 ++++++++++++++++++------------------ SU2_PY/SU2/eval/functions.py | 14 +++++++----- SU2_PY/SU2/eval/gradients.py | 17 ++++++++++----- SU2_PY/SU2/io/config.py | 14 ++++++++++++ SU2_PY/SU2/io/tools.py | 17 +++++++++------ SU2_PY/SU2/run/direct.py | 3 +++ 6 files changed, 70 insertions(+), 36 deletions(-) diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 5b3f00380e98..ef80aeb29927 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -292,26 +292,20 @@ int main(int argc, char *argv[]) { SetSensitivity_Files(geometry_container, config_container, nZone); } + su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; // move allocation outwards + /*--- Initialize structure to store the gradient ---*/ + for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { + Gradient[iDV] = new su2double[config_container[ZONE_0]->GetnDV_Value(iDV)] (); + } + ofstream Gradient_file; + for (iZone = 0; iZone < nZone; iZone++){ if ((config_container[iZone]->GetDesign_Variable(0) != NONE) && (config_container[iZone]->GetDesign_Variable(0) != SURFACE_FILE)) { - /*--- Initialize structure to store the gradient ---*/ - - su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; - - for (auto iDV = 0u; iDV < config_container[iZone]->GetnDV(); iDV++) { - Gradient[iDV] = new su2double[config_container[iZone]->GetnDV_Value(iDV)] (); - } - if (rank == MASTER_NODE) cout << "\n---------- Start gradient evaluation using sensitivity information ----------" << endl; - /*--- Write the gradient in a external file ---*/ - - ofstream Gradient_file; - if (rank == MASTER_NODE) - Gradient_file.open(config_container[iZone]->GetObjFunc_Grad_FileName().c_str(), ios::out); /*--- Definition of the Class for surface deformation ---*/ @@ -329,17 +323,24 @@ int main(int argc, char *argv[]) { else SetProjection_FD(geometry_container[iZone][INST_0], config_container[iZone], surface_movement[iZone] , Gradient); - /*--- Print gradients to screen and file ---*/ - - OutputGradient(Gradient, config_container[iZone], Gradient_file); - for (auto iDV = 0u; iDV < config_container[iZone]->GetnDV(); iDV++){ - delete [] Gradient[iDV]; - } - delete [] Gradient; } } + /*--- Write the gradient in a external file ---*/ + + if (rank == MASTER_NODE) + Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); + + /*--- Print gradients to screen and file ---*/ + + OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); + + for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++){ + delete [] Gradient[iDV]; + } + delete [] Gradient; + delete config; config = nullptr; diff --git a/SU2_PY/SU2/eval/functions.py b/SU2_PY/SU2/eval/functions.py index 9317a5386366..6738291c581d 100644 --- a/SU2_PY/SU2/eval/functions.py +++ b/SU2_PY/SU2/eval/functions.py @@ -222,6 +222,8 @@ def aerodynamics( config, state=None ): name = files['MESH'] name = su2io.expand_part(name,config) link.extend(name) + + pull.extend(config.get('CONFIG_LIST',[])) if 'FLOW_META' in files: pull.append(files['FLOW_META']) @@ -299,10 +301,11 @@ def aerodynamics( config, state=None ): su2io.update_persurface(konfig,state) # return output funcs = su2util.ordered_bunch() - for key in su2io.historyOutFields: - if key in state['FUNCTIONS']: + for key in state['FUNCTIONS']: funcs[key] = state['FUNCTIONS'][key] - + + print('funcs output') + print(funcs) return funcs #: def aerodynamics() @@ -883,7 +886,6 @@ def update_mesh(config,state=None): log_decomp = None log_deform = None - # ---------------------------------------------------- # Deformation # ---------------------------------------------------- @@ -897,7 +899,9 @@ def update_mesh(config,state=None): pull = [] link = config['MESH_FILENAME'] link = su2io.expand_part(link,config) - + + pull.extend(config.get('CONFIG_LIST',[])) + # output redirection with redirect_folder('DEFORM',pull,link) as push: with redirect_output(log_deform): diff --git a/SU2_PY/SU2/eval/gradients.py b/SU2_PY/SU2/eval/gradients.py index 9738ed10ece2..9e3162f96913 100644 --- a/SU2_PY/SU2/eval/gradients.py +++ b/SU2_PY/SU2/eval/gradients.py @@ -742,15 +742,21 @@ def findiff( config, state=None ): else: step = 0.001 + + opt_names = [] + for i in range(config['NZONES']): + for key in sorted(su2io.historyOutFields): + if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + if (config['NZONES'] == 1): + opt_names.append(key) + else: + opt_names.append(key + '[' + str(i) + ']') + # ---------------------------------------------------- # Redundancy Check # ---------------------------------------------------- # master redundancy check - opt_names = [] - for key in sorted(su2io.historyOutFields): - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': - opt_names.append(key) findiff_todo = all([key in state.GRADIENTS for key in opt_names]) if findiff_todo: grads = state['GRADIENTS'] @@ -802,7 +808,8 @@ def findiff( config, state=None ): # files to pull files = state['FILES'] - pull = []; link = [] + pull = []; link = [] + pull.extend(config.get('CONFIG_LIST',[])) # files: mesh name = files['MESH'] name = su2io.expand_part(name,konfig) diff --git a/SU2_PY/SU2/io/config.py b/SU2_PY/SU2/io/config.py index 4e3b227edb8a..5ebd3ff0bd26 100755 --- a/SU2_PY/SU2/io/config.py +++ b/SU2_PY/SU2/io/config.py @@ -451,6 +451,10 @@ def read_config(filename): data_dict[this_param] = this_value.strip("()").split(",") data_dict[this_param] = [i.strip(" ") for i in data_dict[this_param]] break + if case("CONFIG_LIST"): + data_dict[this_param] = this_value.strip("()").split(",") + data_dict[this_param] = [i.strip(" ") for i in data_dict[this_param]] + break if case("HISTORY_OUTPUT"): data_dict[this_param] = this_value.strip("()").split(",") data_dict[this_param] = [i.strip(" ") for i in data_dict[this_param]] @@ -891,6 +895,16 @@ def write_config(filename,param_dict): output_file.write(", ") output_file.write(")") break + + if case("CONFIG_LIST"): + n_lists = len(new_value) + output_file.write("(") + for i_value in range(n_lists): + output_file.write(new_value[i_value]) + if i_value+1 < n_lists: + output_file.write(", ") + output_file.write(")") + break if case("HISTORY_OUTPUT"): n_lists = len(new_value) diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index acf98a047b59..11b1ec762c8f 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -154,10 +154,13 @@ def read_history( History_filename, nZones = 1): for key in plot_data.keys(): var = key for field in historyOutFields: - if key == historyOutFields[field]['HEADER']: - var = field + + if key.split('[')[0] == historyOutFields[field]['HEADER']: + var = field + '[' + key.split('[')[1] + history_data[var] = plot_data[key] - + print('history_data output') + print(history_data) return history_data #: def read_history() @@ -323,9 +326,11 @@ def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_av # pull only these functions Func_Values = ordered_bunch() for this_objfun in historyOutFields: - if this_objfun in history_data: - if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': - Func_Values[this_objfun] = history_data[this_objfun] + for iZone in range(nZones): + # TODO check and change for one zone + if this_objfun + '[' + str(iZone) + ']' in history_data: + if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': + Func_Values[this_objfun + '[' + str(iZone) + ']'] = history_data[this_objfun + '[' + str(iZone) + ']'] if 'TIME_MARCHING' in special_cases: # for unsteady cases, average time-accurate objective function values diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index 2b7a181d6b24..4ac9ac1deffc 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -91,10 +91,13 @@ def direct ( config ): # adapt the history_filename, if a restart solution is chosen # check for 'RESTART_ITER' is to avoid forced restart situation in "compute_polar.py"... if konfig.get('RESTART_SOL','NO') == 'YES' and konfig.get('RESTART_ITER',1) != 1: + konfig['CONV_FILENAME'] = 'config_CFD' restart_iter = '_'+str(konfig['RESTART_ITER']).zfill(5) history_filename = konfig['CONV_FILENAME'] + restart_iter + plot_extension else: + konfig['CONV_FILENAME'] = 'config_CFD' history_filename = konfig['CONV_FILENAME'] + plot_extension + special_cases = su2io.get_specialCases(konfig) From 66f824d3522bdff1baa597a2ecf2293d930efd64 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 8 May 2020 15:28:19 +0200 Subject: [PATCH 057/326] Added LINSOL output to heat solver --- SU2_CFD/src/output/CHeatOutput.cpp | 10 +++++++--- SU2_CFD/src/solvers/CHeatSolver.cpp | 12 ++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 1fe6c03d773e..ef32206c8546 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -90,16 +90,16 @@ void CHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver if (multiZone) SetHistoryOutputValue("BGS_TEMPERATURE", log10(heat_solver->GetRes_BGS(0))); - SetHistoryOutputValue("LINSOL_ITER", heat_solver->GetIterLinSolver()); SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + SetHistoryOutputValue("LINSOL_ITER", heat_solver->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL", log10(heat_solver->GetResLinSolver())); + } void CHeatOutput::SetHistoryOutputFields(CConfig *config){ - AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL_ITER", "Linear solver iterations"); - AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root mean square residual of the temperature", HistoryFieldType::RESIDUAL); AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature", HistoryFieldType::RESIDUAL); AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "Block-Gauss seidel residual of the temperature", HistoryFieldType::RESIDUAL); @@ -109,6 +109,10 @@ void CHeatOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("AVG_TEMPERATURE", "AvgTemp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total average temperature on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT); AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + /// DESCRIPTION: Linear solver iterations + AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); + AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); + } diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 65ce69480f48..5e17e4caea24 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1584,7 +1584,7 @@ void CHeatSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { unsigned short iVar; - unsigned long iPoint, total_index; + unsigned long iPoint, total_index, IterLinSol = 0;; su2double Delta, Vol, *local_Res_TruncError; bool flow = ((config->GetKind_Solver() == INC_NAVIER_STOKES) || (config->GetKind_Solver() == INC_RANS) @@ -1656,7 +1656,15 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ /*--- Solve or smooth the linear system ---*/ - System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + IterLinSol = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + + /*--- Store the value of the residual. ---*/ + + SetResLinSolver(System.GetResidual()); + + /*--- The the number of iterations of the linear solver ---*/ + + SetIterLinSolver(IterLinSol); for (iPoint = 0; iPoint < nPointDomain; iPoint++) { for (iVar = 0; iVar < nVar; iVar++) { From db45aca0d8e24b37820161c4c95e6d8e3f5e79f8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 15 May 2020 12:40:00 +0200 Subject: [PATCH 058/326] Added empty symmetry BC to HeatSolver. --- SU2_CFD/include/solvers/CHeatSolver.hpp | 16 ++++++++++++++++ SU2_CFD/src/solvers/CHeatSolver.cpp | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index 5c6a54649245..4384f6864a63 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -168,6 +168,22 @@ class CHeatSolver final : public CSolver { void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) override; +/*! + * \brief Impose the symmetry boundary condition using the residual. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_Sym_Plane(CGeometry *geometry, + CSolver **solver_container, + CNumerics *conv_numerics, + CNumerics *visc_numerics, + CConfig *config, + unsigned short val_marker) override final; + /*! * \brief Impose the Navier-Stokes boundary condition (strong). * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 5e17e4caea24..44604c22de8e 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -780,6 +780,17 @@ void CHeatSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) { delete[] Local_Surface_Areas; } +void CHeatSolver::BC_Sym_Plane(CGeometry *geometry, + CSolver **solver_container, + CNumerics *conv_numerics, + CNumerics *visc_numerics, + CConfig *config, + unsigned short val_marker) { + + /* In case of a heat solver nothing has to be done for the symmetry BC. */ + +} + void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { From 88c373e7a46950c9a9cf013d11397bbae31927c7 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 15 May 2020 16:09:17 +0200 Subject: [PATCH 059/326] Merge changes node -> nodes in own code. --- Common/src/geometry/CPhysicalGeometry.cpp | 4 ++-- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 26 +++++++++++------------ SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 468d8601f023..c1b3526c9723 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8119,13 +8119,13 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, /*--- Get the squared norm of the current point. ---*/ norm = 0.0; for (iDim = 0; iDim < nDim; iDim++) - norm += pow(node[vertex[iMarker][iPoint]->GetNode()]->GetCoord(iDim),2); + norm += pow(nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim),2); /*--- Check if new unique reference node is found. ---*/ if (norm < min_norm || iPoint == 0) { min_norm = norm; for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = node[vertex[iMarker][iPoint]->GetNode()]->GetCoord(iDim); + Buffer_Send_RefNode[iDim] = nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim); } else if (norm == min_norm) { // TK::write code later diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 019651bdb408..976ac559d64a 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2074,7 +2074,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont 0.0); /*--- Load the volume of the dual mesh cell ---*/ - numerics->SetVolume(geometry->node[iPoint]->GetVolume()); + numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); /*--- If viscous, we need gradients for extra terms. ---*/ if (viscous) { @@ -2121,12 +2121,12 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->node[iPoint]->GetDomain()) { + if (geometry->nodes->GetDomain(iPoint)) { geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { - if (geometry->node[iPoint]->GetCoord(1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + if (geometry->nodes->GetCoord(iPoint,1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint,1); else AxiFactor = 1.0; } else { @@ -2160,12 +2160,12 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->node[iPoint]->GetDomain()) { + if (geometry->nodes->GetDomain(iPoint)) { geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { - if (geometry->node[iPoint]->GetCoord(1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); else AxiFactor = 1.0; } else { @@ -5953,13 +5953,13 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->node[iPoint]->GetDomain()) { + if (geometry->nodes->GetDomain(iPoint)) { geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { - if (geometry->node[iPoint]->GetCoord(1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); else AxiFactor = 1.0; } else { @@ -6064,13 +6064,13 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->node[iPoint]->GetDomain()) { + if (geometry->nodes->GetDomain(iPoint)) { geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); if (axisymmetric) { - if (geometry->node[iPoint]->GetCoord(1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); else AxiFactor = 1.0; } else { diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 1c96a9ef1000..77ce24e18418 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -797,7 +797,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) - dot_product += fabs( (geometry->node[iPoint]->GetCoord(iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); + dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; From a68ad99fe24c71ddd6b3df83b0e597424ad38a36 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 18 May 2020 10:44:08 +0200 Subject: [PATCH 060/326] Updated pipe3Dslice testcase. --- .../streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg index 92d90eb8d036..d7c602a8dd67 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg @@ -31,6 +31,8 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +HISTORY_OUTPUT= (FLOW_COEFF, LINSOL) + % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -212,10 +214,11 @@ SOLUTION_FILENAME= solution_flow SOLUTION_ADJ_FILENAME= solution_adj % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW, PARAVIEW_MULTIBLOCK, SURFACE_PARAVIEW_ASCII, SURFACE_TECPLOT_ASCII ) +OUTPUT_WRT_FREQ= 10 % % Output file convergence history (w/o extension) -CONV_FILENAME= history +%CONV_FILENAME= history % % Output file restart flow RESTART_FILENAME= solution_flow From fb80c479a5fdf6c135f158685532ed3c46c376d6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 19 May 2020 10:46:14 +0200 Subject: [PATCH 061/326] Added streamwise periodic testcases folder structure --- TestCases/.gitignore | 1 + .../streamwise_periodic/README.md | 26 ++- .../sp_da_pinArray_2d_dp_hf_tp/README.md | 0 .../sp_da_pinArray_cht_2d_mf_hf/README.md | 0 .../sp_pinArray_2d_dp_hf_tp/README.md | 0 .../sp_pinArray_2d_mf_hf/README.md | 0 .../sp_pinArray_3d_mf_hf_tp/README.md | 0 .../sp_pinArray_cht_2d_mf_hf/README.md | 0 .../sp_pipeSlice_3d_dp_hf_tp/README.md | 0 .../pipeslice.geo | 0 .../plots.py | 1 + .../sp_pipeSlice_3d_dp_hf_tp.cfg} | 0 TestCases/streamwise_periodic_regression.py | 154 ++++++++++++++++++ 13 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md rename TestCases/incomp_navierstokes/streamwise_periodic/{pipe_slice_3D => sp_pipeSlice_3d_dp_hf_tp}/pipeslice.geo (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{pipe_slice_3D => sp_pipeSlice_3d_dp_hf_tp}/plots.py (99%) mode change 100644 => 100755 rename TestCases/incomp_navierstokes/streamwise_periodic/{pipe_slice_3D/pipe3Dslice.cfg => sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg} (100%) create mode 100755 TestCases/streamwise_periodic_regression.py diff --git a/TestCases/.gitignore b/TestCases/.gitignore index bbf17aef58e0..92011897f495 100644 --- a/TestCases/.gitignore +++ b/TestCases/.gitignore @@ -12,6 +12,7 @@ *.su2 *.dat *.vtk +*.vtm *.csv *.plt *.szplt diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md index 14ecbec447df..4c08439c07bd 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/README.md +++ b/TestCases/incomp_navierstokes/streamwise_periodic/README.md @@ -1,12 +1,30 @@ # Streamwise Periodicity testcases -## `half_cylinder_2D` -half cylinder massflow prescribed heated cylinder +All Testcases use the incompressible solver implemented by Thomas Economon. + +## `pipe_slice_3D` + +Overview: Hagen Poiseuille flow through a 1-primal-cell thick pipe slice in 3D. -## `pipe_slice_3D` -analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed, heated walls +Analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed, heated walls `Re = rho * v * L / mu = 1.0 * ? * 5e-3 / 1.8e-5` bei v -> averaged (mass or area weighted?) velocity the critical Re ~= 2300 (v = 0.6 for now) makes Re=167 It would nice to have a Re ~= 1500 to have a better testcase (achieve that with v~5 or 6 i.e. scale Delta P by factor 10 from 0.001 to 0.01) +## `half_cylinder_2D` +half cylinder massflow prescribed heated cylinder - probably discontinued + +## 2D_pinArray_dp_hf + +## 2D_pinArray_mf + +## 2D_pinArray_cht_dp_hf + +### Discrete Adjoint + +## 3D_pinArray_mf_hf + +## 3D_pinArray_cht_dp_hf + +### Discrete Adjoint \ No newline at end of file diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/pipeslice.geo similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipeslice.geo rename to TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/pipeslice.geo diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/plots.py old mode 100644 new mode 100755 similarity index 99% rename from TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py rename to TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/plots.py index 583c39545679..b5a82d392f10 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/plots.py +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/plots.py @@ -1,3 +1,4 @@ +#! /usr/bin/python3.5 # --------------------------------------------------------------------------- # # Kattmann, 16.07.2019 # This python script provides some plots to test the match between analytical diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/pipe_slice_3D/pipe3Dslice.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py new file mode 100755 index 000000000000..b40b907e8558 --- /dev/null +++ b/TestCases/streamwise_periodic_regression.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python + +## \file serial_regression.py +# \brief Python script for automated regression testing of SU2 examples +# \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron +# \version 7.0.4 "Blackbird" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +from __future__ import print_function, division, absolute_import +import sys +from TestCase import TestCase + +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 + to make sure nothing is broken. ''' + + test_list = [] + + ################################# + ## Streamwise Periodic primal ### + ################################# + + # Laminar cylinder in channel, streamwise periodic + streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') + streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" + streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" + streamwise_periodic_cylinder.test_iter = 30 + streamwise_periodic_cylinder.test_vals = [30, -7.841567, -6.794739, -6.997455] #last 4 lines + streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" + streamwise_periodic_cylinder.timeout = 1600 + streamwise_periodic_cylinder.tol = 0.00001 + test_list.append(streamwise_periodic_cylinder) + + # 3D laminar channnel with 1 cell in flow direction, streamwise periodic + sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') + sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp" + 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 = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pipeSlice_3d_dp_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pipeSlice_3d_dp_hf_tp.timeout = 1600 + sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 + test_list.append(sp_pipeSlice_3d_dp_hf_tp) + + # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity (without turbulence model for now) + sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') + sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_pinArray_2d_dp_hf_tp" + sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" + sp_pinArray_2d_dp_hf_tp.test_iter = 10 + sp_pinArray_2d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_2d_dp_hf_tp.timeout = 1600 + sp_pinArray_2d_dp_hf_tp.tol = 0.00001 + test_list.append(sp_pinArray_2d_dp_hf_tp) + + # create 2D pin case massflow periodic with heatflux BC and prescribed heat (without turbulence model for now) + sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') + sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf" + sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" + sp_pinArray_2d_mf_hf.test_iter = 10 + sp_pinArray_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" + sp_pinArray_2d_mf_hf.timeout = 1600 + sp_pinArray_2d_mf_hf.tol = 0.00001 + test_list.append(sp_pinArray_2d_mf_hf) + + # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) + sp_pinArray_3d_mf_hf_tp = TestCase('sp_pinArray_3d_mf_hf_tp') + sp_pinArray_3d_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp" + sp_pinArray_3d_mf_hf_tp.cfg_file = "sp_pinArray_3d_mf_hf_tp.cfg" + sp_pinArray_3d_mf_hf_tp.test_iter = 10 + sp_pinArray_3d_mf_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_3d_mf_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_3d_mf_hf_tp.timeout = 1600 + sp_pinArray_3d_mf_hf_tp.tol = 0.00001 + test_list.append(sp_pinArray_3d_mf_hf_tp) + + # create 2D CHT case with HF BC and + sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') + sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" + sp_pinArray_cht_2d_mf_hf.cfg_file = "sp_pinArray_cht_2d_mf_hf.cfg" + sp_pinArray_cht_2d_mf_hf.test_iter = 10 + sp_pinArray_cht_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" + sp_pinArray_cht_2d_mf_hf.timeout = 1600 + sp_pinArray_cht_2d_mf_hf.tol = 0.00001 + test_list.append(sp_pinArray_cht_2d_mf_hf) + + ################################## + ## Streamwise Periodic adjoint ### + ################################## + + # 2D DA case single zone pressure drop + sp_da_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') + sp_da_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_pinArray_2d_dp_hf_tp" + sp_da_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" + sp_da_pinArray_2d_dp_hf_tp.test_iter = 10 + sp_da_pinArray_2d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_da_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" + sp_da_pinArray_2d_dp_hf_tp.timeout = 1600 + sp_da_pinArray_2d_dp_hf_tp.tol = 0.00001 + test_list.append(sp_pinArray_2d_dp_hf_tp) + + # 2D DA case cht pressure drop, heat obj function + sp_da_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') + sp_da_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" + sp_da_pinArray_cht_2d_mf_hf.cfg_file = "sp_pinArray_cht_2d_mf_hf.cfg" + sp_da_pinArray_cht_2d_mf_hf.test_iter = 10 + sp_da_pinArray_cht_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_da_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" + sp_da_pinArray_cht_2d_mf_hf.timeout = 1600 + sp_da_pinArray_cht_2d_mf_hf.tol = 0.00001 + test_list.append(sp_pinArray_cht_2d_mf_hf) + + pass_list = [ test.run_test() for test in test_list ] + + # Tests summary + print('==================================================================') + print('Summary of the serial tests') + print('python version:', sys.version) + for i, test in enumerate(test_list): + if (pass_list[i]): + print(' passed - %s'%test.tag) + else: + print('* FAILED - %s'%test.tag) + + if all(pass_list): + sys.exit(0) + else: + sys.exit(1) + # done + +if __name__ == '__main__': + main() From 535f20c0dc890bc7386a4378b1ad277e3b345415 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 4 Jun 2020 13:26:57 +0200 Subject: [PATCH 062/326] Adding testcases for streamwise periodicity --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 +- .../streamwise_periodic/README.md | 3 +- .../sp_pinArray_2d_dp_hf_tp.cfg | 382 +++++++++++++++++ .../sp_pinArray_2d_mf_hf.cfg | 386 +++++++++++++++++ .../sp_pinArray_cht_2d_mf_hf/configFluid.cfg | 389 ++++++++++++++++++ .../sp_pinArray_cht_2d_mf_hf/configMaster.cfg | 156 +++++++ .../sp_pinArray_cht_2d_mf_hf/configSolid.cfg | 141 +++++++ TestCases/streamwise_periodic_regression.py | 2 +- config_template.cfg | 78 +++- 9 files changed, 1523 insertions(+), 18 deletions(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 976ac559d64a..0dd6d1296a82 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2145,7 +2145,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } // loop periodic boundaries } // loop MarkerAll - // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); Temperature_Global /= Area_Global; @@ -6092,7 +6092,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry } // loop Heatflux marker } // loop AllMarker - // Mpi Communication sum up integrated Heatfdlux from all processes + // Mpi Communication sum up integrated Heatflux from all processes SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); /*--- Set the Integrated Heatflux ---*/ diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md index 4c08439c07bd..12deef756f6d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/README.md +++ b/TestCases/incomp_navierstokes/streamwise_periodic/README.md @@ -1,6 +1,7 @@ # Streamwise Periodicity testcases All Testcases use the incompressible solver implemented by Thomas Economon. +For all Testcases the respective gmsh geo file has to be provided. ## `pipe_slice_3D` @@ -27,4 +28,4 @@ half cylinder massflow prescribed heated cylinder - probably discontinued ## 3D_pinArray_cht_dp_hf -### Discrete Adjoint \ No newline at end of file +### Discrete Adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg new file mode 100644 index 000000000000..a471c2a4be5a --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg @@ -0,0 +1,382 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 20.05.2020 +% File Version 7.0.4 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +SOLVER= INC_RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +KIND_TURB_MODEL= SST +% +RESTART_SOL= NO +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. +INC_DENSITY_MODEL= CONSTANT +% +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = YES +% +% Initial density for incompressible flows +INC_DENSITY_INIT= 1045.0 +% +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +% Reference temperature for incompressible flows that include the +% energy equation (1.0 K by default) +INC_TEMPERATURE_INIT= 338.0 +% +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= DIMENSIONAL +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP= 3540.0 +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) +% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! +FLUID_MODEL= CONSTANT_DENSITY +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% POLYNOMIAL_CONDUCTIVITY). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 11.7 +% +% Definition of the turbulent thermal conductivity model for RANS +% (CONSTANT_PRANDTL_TURB by default, NONE). +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +% +% Turbulent Prandtl number (0.9 (air) by default) +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +% +% Delta P [Pa] value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +% +% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.85 +INC_OUTLET_DAMPING= 0.01 +% +% Use streamwise periodic temperature (default=NO, YES) +% If YES, the heatflux is taken out at the outlet +% This option is only necessary if INC_ENERGY_EQUATION=YES +STREAMWISE_PERIODIC_TEMPERATURE= YES +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +% Implementation identical to MARKER_EULER. +MARKER_SYM= ( fluid_symmetry ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation with velocity inlet and pressure outlet +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% Objective function in gradient evaluation +OBJECTIVE_FUNCTION= DRAG +% +% List of weighting values when using more than one OBJECTIVE_FUNCTION. +OBJECTIVE_WEIGHT= 1.0 +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Number of iterations for single-zone problems +ITER= 3500 +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1e2 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1e-3 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 20 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, +% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +CONV_NUM_METHOD_FLOW= FDS +% +% 2nd and 4th order artificial dissipation coefficients for +% the JST method ( 0.5, 0.02 by default ) +%JST_SENSOR_COEFF= ( 0.5, 0.05 ) +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= NONE +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_TURB= NONE +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (default=RESIDUAL, CAUCHY) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -26 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= fluid_FFD.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +% Output tabular file format (TECPLOT, CSV) +TABULAR_FORMAT= CSV +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) +SCREEN_WRT_FREQ_INNER= 25 +% +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +READ_BINARY_RESTART= YES +% +% Writing frequency for volume/surface output +OUTPUT_WRT_FREQ= 5000 +% +% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) +VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) +% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) +% +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) +% +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +DV_KIND= FFD_SETTING +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +DV_PARAM= ( 1.0 ) +%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +DV_VALUE= 1.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES +% +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +%DEFORM_MESH= YES +% +% Optimization objective function with scaling factor, separated by semicolons. +% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. +% ex= Objective * Scale +OPT_OBJECTIVE= DRAG +% +% Finite difference step size for python scripts (0.001 default, recommended +% 0.001 x REF_LENGTH) +FIN_DIFF_STEP= 0.00001 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg new file mode 100644 index 000000000000..8c46dbf71b40 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg @@ -0,0 +1,386 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 20.05.2020 +% File Version 7.0.4 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +SOLVER= INC_RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +KIND_TURB_MODEL= SST +% +RESTART_SOL= NO +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. +INC_DENSITY_MODEL= CONSTANT +% +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = YES +% +% Initial density for incompressible flows +INC_DENSITY_INIT= 1045.0 +% +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +% Reference temperature for incompressible flows that include the +% energy equation (1.0 K by default) +INC_TEMPERATURE_INIT= 338.0 +% +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= DIMENSIONAL +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP= 3540.0 +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) +% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! +FLUID_MODEL= CONSTANT_DENSITY +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% POLYNOMIAL_CONDUCTIVITY). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 11.7 +% +% Definition of the turbulent thermal conductivity model for RANS +% (CONSTANT_PRANDTL_TURB by default, NONE). +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +% +% Turbulent Prandtl number (0.9 (air) by default) +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= MASSFLOW +% +% Delta P [Pa] value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +% +% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.85 +% +INC_OUTLET_DAMPING= 0.0001 +% +% Use streamwise periodic temperature (default=NO, YES) +% If YES, the heatflux is taken out at the outlet +% This option is only necessary if INC_ENERGY_EQUATION=YES +STREAMWISE_PERIODIC_TEMPERATURE= NO +% +% Cummulated pin arc-length/area is one full circle = 2*pi*r = 2*pi*0.002 +% Integrated heatflux into the domain is Area*const-heatflux = 2*pi*r*5e5 = 6283.185307 +STREAMWISE_PERIODIC_OUTLET_HEAT= -6283.185307 +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +% Implementation identical to MARKER_EULER. +MARKER_SYM= ( fluid_symmetry ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation with velocity inlet and pressure outlet +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% Objective function in gradient evaluation +OBJECTIVE_FUNCTION= DRAG +% +% List of weighting values when using more than one OBJECTIVE_FUNCTION. +OBJECTIVE_WEIGHT= 1.0 +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Number of iterations for single-zone problems +ITER= 3500 +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1e2 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1e-3 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 20 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, +% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +CONV_NUM_METHOD_FLOW= FDS +% +% 2nd and 4th order artificial dissipation coefficients for +% the JST method ( 0.5, 0.02 by default ) +%JST_SENSOR_COEFF= ( 0.5, 0.05 ) +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= NONE +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_TURB= NONE +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (default=RESIDUAL, CAUCHY) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -26 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= fluid_FFD.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +% Output tabular file format (TECPLOT, CSV) +TABULAR_FORMAT= CSV +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) +SCREEN_WRT_FREQ_INNER= 25 +% +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +READ_BINARY_RESTART= YES +% +% Writing frequency for volume/surface output +OUTPUT_WRT_FREQ= 5000 +% +% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) +VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) +% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) +% +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) +% +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +DV_KIND= FFD_SETTING +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +DV_PARAM= ( 1.0 ) +%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +DV_VALUE= 1.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES +% +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +%DEFORM_MESH= YES +% +% Optimization objective function with scaling factor, separated by semicolons. +% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. +% ex= Objective * Scale +OPT_OBJECTIVE= DRAG +% +% Finite difference step size for python scripts (0.001 default, recommended +% 0.001 x REF_LENGTH) +FIN_DIFF_STEP= 0.00001 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg new file mode 100644 index 000000000000..9bbb4207781f --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg @@ -0,0 +1,389 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 20.05.2020 +% File Version 7.0.4 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +SOLVER= INC_RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +KIND_TURB_MODEL= SST +% +RESTART_SOL= NO +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. +INC_DENSITY_MODEL= CONSTANT +% +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = YES +% +% Initial density for incompressible flows +INC_DENSITY_INIT= 1045.0 +% +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +% Reference temperature for incompressible flows that include the +% energy equation (1.0 K by default) +INC_TEMPERATURE_INIT= 338.0 +% +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= DIMENSIONAL +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP= 3540.0 +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) +% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! +FLUID_MODEL= CONSTANT_DENSITY +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% POLYNOMIAL_CONDUCTIVITY). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 11.7 +% +% Definition of the turbulent thermal conductivity model for RANS +% (CONSTANT_PRANDTL_TURB by default, NONE). +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +% +% Turbulent Prandtl number (0.9 (air) by default) +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +% +% Delta P [Pa] value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +% +% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.85 +INC_OUTLET_DAMPING= 0.001 +% +% Use streamwise periodic temperature (default=NO, YES) +% If YES, the heatflux is taken out at the outlet +% This option is only necessary if INC_ENERGY_EQUATION=YES +STREAMWISE_PERIODIC_TEMPERATURE= NO +% +% Prescibe integrated heat [W] extracted at the periodic "outlet". +% Only active if STREAMWISE_PERIODIC_TEMPERATURE= NO. +% If set to zero, the heat is integrated by the program over the MARKER_HEATFLUX. +% inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi +% with 5e5 W/m that is Q = 1884.96 +STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +% Implementation identical to MARKER_EULER. +MARKER_SYM= ( fluid_symmetry ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation with velocity inlet and pressure outlet +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING= ( fluid_pin2_interface ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% Objective function in gradient evaluation +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +% +% List of weighting values when using more than one OBJECTIVE_FUNCTION. +OBJECTIVE_WEIGHT= 0.0 +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Number of iterations for single-zone problems +%ITER= 3500 +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1e3 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1e-15 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 10 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, +% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +CONV_NUM_METHOD_FLOW= FDS +% +% 2nd and 4th order artificial dissipation coefficients for +% the JST method ( 0.5, 0.02 by default ) +%JST_SENSOR_COEFF= ( 0.5, 0.05 ) +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= NONE +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_TURB= NONE +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (default=RESIDUAL, CAUCHY) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -26 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +%MESH_FILENAME= fluid_FFD.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +% Output tabular file format (TECPLOT, CSV) +TABULAR_FORMAT= CSV +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) +% +% History output groups (use 'SU2_CFD -d ' to view list of available fields) +SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) +SCREEN_WRT_FREQ_INNER= 25 +% +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +READ_BINARY_RESTART= YES +% +% Writing frequency for volume/surface output +OUTPUT_WRT_FREQ= 5000 +% +% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) +VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) +% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) +% +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) +% +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +DV_KIND= FFD_SETTING +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +DV_PARAM= ( 1.0 ) +%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +DV_VALUE= 1.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES +% +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +%DEFORM_MESH= YES +% +% Optimization objective function with scaling factor, separated by semicolons. +% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. +% ex= Objective * Scale +OPT_OBJECTIVE= DRAG +% +% Finite difference step size for python scripts (0.001 default, recommended +% 0.001 x REF_LENGTH) +FIN_DIFF_STEP= 0.00001 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg new file mode 100644 index 000000000000..85f56cf0c09f --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg @@ -0,0 +1,156 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: 2D cylinder array with CHT couplings % +% Author: O. Burghardt, T. Economon % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: August 8, 2019 % +% File Version 6.0.1 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +% When do I have to use this again!? There was a rather nasty bug I recall if the option is nnot set +%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION +% +SOLVER= MULTIPHYSICS +% +CONFIG_LIST= (configFluid.cfg, configSolid.cfg) +% +MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +TIME_DOMAIN = NO +% +SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +% +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], HEAT[1], LINSOL[0], LINSOL[1], HEAT[0] ) +% +CONV_RESIDUAL_MINVAL= -26 +% +% Number of total iterations +OUTER_ITER= 4000 +% +OUTPUT_WRT_FREQ= 1000 +% +SCREEN_WRT_FREQ_OUTER= 25 +% +%CHT_ROBIN= NO +% +OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) +% +% Mesh input file +MESH_FILENAME= 2D-PinArray.su2 +% +%SPECIFIC_HEAT_CP = 871.0 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +% +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +%DV_KIND= FFD_SETTING +DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +%DV_PARAM= ( 1.0 ) +DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +%DV_VALUE= 1.0 +%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 10 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES + + +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +%DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg new file mode 100644 index 000000000000..3b1b6edd08d9 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg @@ -0,0 +1,141 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (solid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 20.05.2020 +% File Version 7.0.4 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +SOLVER= HEAT_EQUATION +% +RESTART_SOL= NO +% +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% +% +% !!!!! is this doing s.th. here +INC_NONDIM= DIMENSIONAL +% +% Solids temperature at freestream conditions +SOLID_TEMPERATURE_INIT= 345.0 +% +% Density used in solids +SOLID_DENSITY= 2719 +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP = 871.0 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% !!!!!! do we need that shit here ??? +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM = 6.99091 +% +% Thermal conductivity used for heat equation +% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later +% used for the viscous res +SOLID_THERMAL_CONDUCTIVITY= 200 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) +% +MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING = ( solid_pin2_interface ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING = ( solid_pin2_inner ) +% +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +% +OBJECTIVE_WEIGHT= 1.0 +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1e4 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% !!!! still used! !!! what does it do? +BETA_FACTOR= 50 +% +% !!!! still used! !!! what does it do? +% Maximum Delta Time in local time stepping simulations +MAX_DELTA_TIME= 1.0 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-15 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 20 +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +RESIDUAL_REDUCTION= 10 +% +CONV_RESIDUAL_MINVAL= -20 +% +CONV_STARTITER= 10000000000 +% +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% +% +!!! this is not used here +CONV_NUM_METHOD_HEAT= SPACE_CENTERED +% +!!! this is not used here +MUSCL_HEAT= YES +% +% !!! this is not used here +JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) +% +!!! this is not used here +TIME_DISCRE_HEAT= EULER_IMPLICIT +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= solid.su2 +% +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_heat +RESTART_FILENAME= solution_heat +% +VOLUME_FILENAME= heat +SURFACE_FILENAME= surface_heat +READ_BINARY_RESTART= YES +% +HISTORY_OUTPUT= (ITER, RMS_RES, HEAT, LINSOL) +% +CONV_FILENAME= history +% +WRT_CON_FREQ= 1 \ No newline at end of file diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index b40b907e8558..b96020dfe3b9 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -52,7 +52,7 @@ def main(): test_list.append(streamwise_periodic_cylinder) # 3D laminar channnel with 1 cell in flow direction, streamwise periodic - sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') + sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp" sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 diff --git a/config_template.cfg b/config_template.cfg index 87080e8c1057..7236ad4b858f 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -12,9 +12,10 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Solver type (EULER, NAVIER_STOKES, RANS, -% INC_EULER, INC_NAVIER_STOKES, INC_RANS -% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, -% HEAT_EQUATION_FVM, ELASTICITY) +% INC_EULER, INC_NAVIER_STOKES, INC_RANS +% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, +% HEAT_EQUATION_FVM, ELASTICITY, +% MULTIPHYSICS) SOLVER= EULER % % Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) @@ -56,9 +57,15 @@ DISCARD_INFILES= NO % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= SI % +% List of config files for each zone in a multizone setup with SOLVER=MULTIPHYSICS +% Order here has to match the order in the meshfile if just one is used. +CONFIG_LIST= (configA.cfg, configB.cfg) % % ------------------------------- SOLVER CONTROL ------------------------------% % +% Number of iterations for single-zone problems +ITER= 1 +% % Maximum number of inner iterations INNER_ITER= 9999 % @@ -175,6 +182,12 @@ FREESTREAM_VELOCITY= ( 1.0, 0.00, 0.00 ) % Free-stream viscosity (1.853E-5 N s/m^2, 3.87E-7 lbf s/ft^2 by default) FREESTREAM_VISCOSITY= 1.853E-5 % +% Documentation missing +FREESTREAM_TURBULENCEINTENSITY= 0.05 +% +% Documentation missing +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% % Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, % FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) REF_DIMENSIONALIZATION= DIMENSIONAL @@ -229,7 +242,20 @@ INC_OUTLET_TYPE= PRESSURE_OUTLET % % Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) INC_OUTLET_DAMPING= 0.1 - +% +% Epsilon^2 multipier in Beta calculation for incompressible preconditioner. Default= 4.1 +BETA_FACTOR= 4.1); +% ----------------------------- SOLID ZONE HEAT VARIABLES-----------------------% +% +% Thermal conductivity used for heat equation +SOLID_THERMAL_CONDUCTIVITY= 0.0 +% +% Solids temperature at freestream conditions +SOLID_TEMPERATURE_INIT= 288.15 +% +% Density used in solids +SOLID_DENSITY= 2710.0 +% % ----------------------------- CL DRIVER DEFINITION ---------------------------% % % Activate fixed lift mode (specify a CL instead of AoA, NO/YES) @@ -288,7 +314,7 @@ CRITICAL_PRESSURE= 3588550.0 ACENTRIC_FACTOR= 0.035 % % Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS) and heat equation. SPECIFIC_HEAT_CP= 1004.703 % % Thermal expansion coefficient (0.00347 K^-1 (air)) @@ -647,20 +673,27 @@ BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) % Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= NONE % -% Use streamwise periodic temperature (default=NO, YES) -% If YES, the heatflux is taken out at the outlet -% This option is only necessary if INC_ENERGY_EQUATION=YES -STREAMWISE_PERIODIC_TEMPERATURE= NO -% -% Delta P value that drives the flow as a source term in the momentum equations. +% Delta P [Pa] value that drives the flow as a source term in the momentum equations. % Defaults to 1.0. STREAMWISE_PERIODIC_PRESSURE_DROP= 1.0 % -% Target massflow. Necessary pressure drop is determined iteratively. +% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. % Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. % Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. STREAMWISE_PERIODIC_MASSFLOW= 0.0 - +% +% Use streamwise periodic temperature (default=NO, YES) +% If YES, the heatflux is taken out at the outlet +% This option is only necessary if INC_ENERGY_EQUATION=YES +STREAMWISE_PERIODIC_TEMPERATURE= NO +% +% Prescibe integrated heat [W] extracted at the periodic "outlet". +% Only active if STREAMWISE_PERIODIC_TEMPERATURE= NO. +% If set to zero, the heat is integrated by the program over the MARKER_HEATFLUX. +% Are MARKER_ISOTHERMAL possible? they should be. +% Defaults to 0.0. +STREAMWISE_PERIODIC_OUTLET_HEAT= 0.0 +% % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Euler wall boundary marker(s) (NONE = no marker) @@ -1098,7 +1131,19 @@ CFL_REDUCTION_TURB= 1.0 % % Value of the thermal diffusivity THERMAL_DIFFUSIVITY= 1.0 - +% +% Convective numerical method +CONV_NUM_METHOD_HEAT= SPACE_CENTERED +% +% Check if the MUSCL scheme should be used +MUSCL_HEAT= YES +% +% 2nd and 4th order artificial dissipation coefficients for the JST method +JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) +% +% Time discretization +TIME_DISCRE_HEAT= EULER_IMPLICIT +% % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % % Frozen the slope limiter in the discrete adjoint formulation (NO, YES) @@ -1397,6 +1442,11 @@ HISTORY_WRT_FREQ_OUTER= 1 % HISTORY_WRT_FREQ_TIME= 1 % +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% Writing convergence history frequency for the dual time +WRT_CON_FREQ_DUALTIME= 10 +% % Writing frequency for volume/surface output OUTPUT_WRT_FREQ= 10 % From a9791238cf0836f80ac4906e0c730f1568df2821 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 15 Jun 2020 10:25:43 +0200 Subject: [PATCH 063/326] Update streamwise periodic config file --- .../sp_pinArray_cht_2d_mf_hf/configSolid.cfg | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg index 3b1b6edd08d9..22cffa0c6b0c 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg @@ -101,24 +101,22 @@ LINEAR_SOLVER_ITER= 20 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -RESIDUAL_REDUCTION= 10 -% CONV_RESIDUAL_MINVAL= -20 % CONV_STARTITER= 10000000000 % % -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% % -!!! this is not used here +%!!! this is not used here CONV_NUM_METHOD_HEAT= SPACE_CENTERED % -!!! this is not used here +%!!! this is not used here MUSCL_HEAT= YES % % !!! this is not used here JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) % -!!! this is not used here +%!!! this is not used here TIME_DISCRE_HEAT= EULER_IMPLICIT % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -138,4 +136,4 @@ HISTORY_OUTPUT= (ITER, RMS_RES, HEAT, LINSOL) % CONV_FILENAME= history % -WRT_CON_FREQ= 1 \ No newline at end of file +WRT_CON_FREQ= 1 From c6d39ee2d9bcf1967e7706545402ef53ad21cf2e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 9 Jun 2020 12:43:07 +0100 Subject: [PATCH 064/326] fix compilation error on gcc 5.4, remove obsolete option from testcases --- Common/include/CConfig.hpp | 12 ++++++------ SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp | 4 ++-- SU2_CFD/include/fluid/CPolynomialConductivity.hpp | 4 ++-- .../include/fluid/CPolynomialConductivityRANS.hpp | 4 ++-- SU2_CFD/include/fluid/CPolynomialViscosity.hpp | 4 ++-- TestCases/disc_adj_fea/configAD_fem.cfg | 1 - 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 7dad5da7578e..31f6a7902aa2 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -821,9 +821,9 @@ class CConfig { su2double* CpPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for specific heat Cp. */ su2double* MuPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for viscosity. */ su2double* KtPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for thermal conductivity. */ - array CpPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */ - arrayMuPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ - arrayKtPolyCoefficientsND{0.0}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ + array CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */ + array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ + array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ su2double Thermal_Conductivity_Solid, /*!< \brief Thermal conductivity in solids. */ Thermal_Diffusivity_Solid, /*!< \brief Thermal diffusivity in solids. */ Temperature_Freestream_Solid, /*!< \brief Temperature in solids at freestream conditions. */ @@ -1017,9 +1017,9 @@ class CConfig { su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */ su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */ su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */ - array default_cp_polycoeffs{0.0}; /*!< \brief Array for specific heat polynomial coefficients. */ - array default_mu_polycoeffs{0.0}; /*!< \brief Array for viscosity polynomial coefficients. */ - array default_kt_polycoeffs{0.0}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ + array default_cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */ + array default_mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */ + array default_kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ diff --git a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp index afa12924dcab..4599056133c2 100644 --- a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp @@ -74,9 +74,9 @@ class CIncIdealGasPolynomial final : public CFluidModel { /* Evaluate the new Cp from the coefficients and temperature. */ Cp = coeffs_[0]; + su2double t_i = 1.0; for (int i = 1; i < N; ++i) { - su2double t_i = t; - for (int j = 1; j < i; ++j) t_i *= t; + t_i *= t; Cp += coeffs_[i] * t_i; } Cv = Cp / Gamma; diff --git a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp index 53cc2a9ba1a1..d23eacb15492 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp @@ -67,9 +67,9 @@ class CPolynomialConductivity final : public CConductivityModel { void SetConductivity(su2double t, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp) override { /* Evaluate the new kt from the coefficients and temperature. */ kt_ = coeffs_[0]; + su2double t_i = 1.0; for (int i = 1; i < N; ++i) { - su2double t_i = t; - for (int j = 1; j < i; ++j) t_i *= t; + t_i *= t; kt_ += coeffs_[i] * t_i; } } diff --git a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp index 196b9443eb23..612915951e60 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp @@ -69,9 +69,9 @@ class CPolynomialConductivityRANS final : public CConductivityModel { void SetConductivity(su2double t, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp) override { /* Evaluate the new kt from the coefficients and temperature. */ kt_ = coeffs_[0]; + su2double t_i = 1.0; for (int i = 1; i < N; ++i) { - su2double t_i = t; - for (int j = 1; j < i; ++j) t_i *= t; + t_i *= t; kt_ += coeffs_[i] * t_i; } diff --git a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp index 23907b53cd5b..3fc3b1c46fe8 100644 --- a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp @@ -69,9 +69,9 @@ class CPolynomialViscosity final : public CViscosityModel { void SetViscosity(su2double t, su2double rho) override { /* Evaluate the new mu from the coefficients and temperature. */ mu_ = coeffs_[0]; + su2double t_i = 1.0; for (int i = 1; i < N; ++i) { - su2double t_i = t; - for (int j = 1; j < i; ++j) t_i *= t; + t_i *= t; mu_ += coeffs_[i] * t_i; } } diff --git a/TestCases/disc_adj_fea/configAD_fem.cfg b/TestCases/disc_adj_fea/configAD_fem.cfg index 50ba5d3c4f4c..6cc55cd7847d 100644 --- a/TestCases/disc_adj_fea/configAD_fem.cfg +++ b/TestCases/disc_adj_fea/configAD_fem.cfg @@ -42,7 +42,6 @@ DEAD_LOAD=NO FORMULATION_ELASTICITY_2D = PLANE_STRAIN NONLINEAR_FEM_SOLUTION_METHOD = NEWTON_RAPHSON -NONLINEAR_FEM_INT_ITER = 10 CONV_FILENAME= history VOLUME_FILENAME= beam From c1806556f1a935e386bcb2242b816995dff2527d Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 15 Jun 2020 22:38:29 +0200 Subject: [PATCH 065/326] Make python scripts work with singlzone cases again. --- SU2_PY/SU2/io/tools.py | 18 +++++++++++++----- SU2_PY/SU2/run/direct.py | 6 ++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index d747f3d31b26..102cd29b3ed9 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -155,7 +155,10 @@ def read_history( History_filename, nZones = 1): var = key for field in historyOutFields: - if key.split('[')[0] == historyOutFields[field]['HEADER']: + if key == historyOutFields[field]['HEADER'] and nZones == 1: + var = field + + if key.split('[')[0] == historyOutFields[field]['HEADER'] and nZones > 1: var = field + '[' + key.split('[')[1] history_data[var] = plot_data[key] @@ -326,11 +329,16 @@ def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_av # pull only these functions Func_Values = ordered_bunch() for this_objfun in historyOutFields: - for iZone in range(nZones): - # TODO check and change for one zone - if this_objfun + '[' + str(iZone) + ']' in history_data: + if nZones == 1: + if this_objfun in history_data: if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': - Func_Values[this_objfun + '[' + str(iZone) + ']'] = history_data[this_objfun + '[' + str(iZone) + ']'] + Func_Values[this_objfun] = history_data[this_objfun] + else: + for iZone in range(nZones): + # TODO check and change for one zone + if this_objfun + '[' + str(iZone) + ']' in history_data: + if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': + Func_Values[this_objfun + '[' + str(iZone) + ']'] = history_data[this_objfun + '[' + str(iZone) + ']'] if 'TIME_MARCHING' in special_cases: # for unsteady cases, average time-accurate objective function values diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index 4ac63e206a60..a03756635971 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -91,11 +91,13 @@ def direct ( config ): # adapt the history_filename, if a restart solution is chosen # check for 'RESTART_ITER' is to avoid forced restart situation in "compute_polar.py"... if konfig.get('RESTART_SOL','NO') == 'YES' and konfig.get('RESTART_ITER',1) != 1: - konfig['CONV_FILENAME'] = 'config_CFD' + if konfig.get('CONFIG_LIST',[]) != []: # Does this fix work for multizone cases? + konfig['CONV_FILENAME'] = 'config_CFD' # this is a hardcoded filename and therfore probably not really great restart_iter = '_'+str(konfig['RESTART_ITER']).zfill(5) history_filename = konfig['CONV_FILENAME'] + restart_iter + plot_extension else: - konfig['CONV_FILENAME'] = 'config_CFD' + if konfig.get('CONFIG_LIST',[]) != []: + konfig['CONV_FILENAME'] = 'config_CFD' history_filename = konfig['CONV_FILENAME'] + plot_extension From b8f90ab0b1eea16270840402d56b6cc85c509f8d Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 15 Jun 2020 23:13:05 +0200 Subject: [PATCH 066/326] Add intermediate regresion test script. --- .github/workflows/regression.yml | 4 +++- SU2_CFD/include/solvers/CHeatSolver.hpp | 2 +- TestCases/parallel_regression.py | 22 ---------------------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index e930c37eb3b6..17092837f682 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -56,7 +56,7 @@ jobs: strategy: fail-fast: false matrix: - testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py'] + testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py','streamwise_periodic_regression.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py'] include: - testscript: 'tutorials.py' tag: MPI @@ -64,6 +64,8 @@ jobs: tag: MPI - testscript: 'parallel_regression_AD.py' tag: MPI + - testscript: 'streamwise_periodic_regression.py' + tag: MPI - testscript: 'serial_regression.py' tag: NoMPI - testscript: 'serial_regression_AD.py' diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index f3f8cefcb69b..30f0dd175e05 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -182,7 +182,7 @@ class CHeatSolver final : public CSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override final; + unsigned short val_marker) final; /*! * \brief Impose the Navier-Stokes boundary condition (strong). diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c17f491a6e7f..da3709cbdd67 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -350,28 +350,6 @@ def main(): inc_buoyancy.tol = 0.00001 test_list.append(inc_buoyancy) - # Laminar cylinder in channel, streamwise periodic - streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') - streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" - streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" - streamwise_periodic_cylinder.test_iter = 30 - streamwise_periodic_cylinder.test_vals = [30, -7.852372, -6.781204, -7.011341] #last 4 lines - streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" - streamwise_periodic_cylinder.timeout = 1600 - streamwise_periodic_cylinder.tol = 0.00001 - test_list.append(streamwise_periodic_cylinder) - - # 3D laminar channnel with 1 cell in flow direction, streamwise periodic - streamwise_periodic_PipeSlice = TestCase('streamwise_periodic_PipeSlice') - streamwise_periodic_PipeSlice.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipe_slice_3D" - streamwise_periodic_PipeSlice.cfg_file = "pipe3Dslice.cfg" - streamwise_periodic_PipeSlice.test_iter = 10 - streamwise_periodic_PipeSlice.test_vals = [10, -10.352122, -10.185236, -10.185236] #last 4 lines - streamwise_periodic_PipeSlice.su2_exec = "parallel_computation.py -f" - streamwise_periodic_PipeSlice.timeout = 1600 - streamwise_periodic_PipeSlice.tol = 0.00001 - test_list.append(streamwise_periodic_PipeSlice) - # Laminar heated cylinder with polynomial fluid model inc_poly_cylinder = TestCase('inc_poly_cylinder') inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" From 22ff98cf987640999c296b5e5a79165ee576ce32 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 16 Jun 2020 14:17:04 +0200 Subject: [PATCH 067/326] Changing streamwise periodic testcase repo --- SU2_PY/SU2/io/tools.py | 1 - .../configFluid.cfg | 0 .../configMaster.cfg | 2 +- .../configSolid.cfg | 0 .../sp_pinArray_2d_dp_hf_tp.cfg | 0 .../sp_pinArray_2d_mf_hf.cfg | 0 .../pipeslice.geo | 0 .../plots.py | 0 .../sp_pipeSlice_3d_dp_hf_tp.cfg | 15 ------------ TestCases/streamwise_periodic_regression.py | 24 +++++++++---------- 10 files changed, 13 insertions(+), 29 deletions(-) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pinArray_cht_2d_mf_hf => chtPinArray_2d}/configFluid.cfg (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pinArray_cht_2d_mf_hf => chtPinArray_2d}/configMaster.cfg (98%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pinArray_cht_2d_mf_hf => chtPinArray_2d}/configSolid.cfg (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pinArray_2d_dp_hf_tp => pinArray_2d}/sp_pinArray_2d_dp_hf_tp.cfg (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pinArray_2d_mf_hf => pinArray_2d}/sp_pinArray_2d_mf_hf.cfg (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pipeSlice_3d_dp_hf_tp => pipeSlice_3d}/pipeslice.geo (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pipeSlice_3d_dp_hf_tp => pipeSlice_3d}/plots.py (100%) rename TestCases/incomp_navierstokes/streamwise_periodic/{sp_pipeSlice_3d_dp_hf_tp => pipeSlice_3d}/sp_pipeSlice_3d_dp_hf_tp.cfg (94%) diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index 102cd29b3ed9..e606b009e937 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -335,7 +335,6 @@ def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_av Func_Values[this_objfun] = history_data[this_objfun] else: for iZone in range(nZones): - # TODO check and change for one zone if this_objfun + '[' + str(iZone) + ']' in history_data: if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': Func_Values[this_objfun + '[' + str(iZone) + ']'] = history_data[this_objfun + '[' + str(iZone) + ']'] diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configFluid.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg similarity index 98% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 85f56cf0c09f..7ad2e1573b9a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -25,7 +25,7 @@ MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_i % TIME_DOMAIN = NO % -SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +SCREEN_OUTPUT= ( OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) % HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], HEAT[1], LINSOL[0], LINSOL[1], HEAT[0] ) % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/configSolid.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/sp_pinArray_2d_dp_hf_tp.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/sp_pinArray_2d_mf_hf.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/pipeslice.geo b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/pipeslice.geo rename to TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/plots.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py similarity index 100% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/plots.py rename to TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg similarity index 94% rename from TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg rename to TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index d7c602a8dd67..ff738cca1df3 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -33,21 +33,6 @@ READ_BINARY_RESTART= NO HISTORY_OUTPUT= (FLOW_COEFF, LINSOL) -% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% -% -% Reference origin for moment computation (m or in) -REF_ORIGIN_MOMENT_X = 0.25 -REF_ORIGIN_MOMENT_Y = 0.00 -REF_ORIGIN_MOMENT_Z = 0.00 -% -% Reference length for pitching, rolling, and yawing non-dimensional -% moment (m or in) -REF_LENGTH= 0.001 -% -% Reference area for force coefficients (0 implies automatic -% calculation) (m^2 or in^2) -REF_AREA= 1.0 -% % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % % Density model within the incompressible flow solver. diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index b96020dfe3b9..48d892fb1ac4 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -53,7 +53,7 @@ def main(): # 3D laminar channnel with 1 cell in flow direction, streamwise periodic sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') - sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp" + sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 sp_pipeSlice_3d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines @@ -64,25 +64,25 @@ def main(): # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity (without turbulence model for now) sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') - sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_pinArray_2d_dp_hf_tp" + sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 10 sp_pinArray_2d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines sp_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_dp_hf_tp.timeout = 1600 sp_pinArray_2d_dp_hf_tp.tol = 0.00001 - test_list.append(sp_pinArray_2d_dp_hf_tp) + #test_list.append(sp_pinArray_2d_dp_hf_tp) # create 2D pin case massflow periodic with heatflux BC and prescribed heat (without turbulence model for now) sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') - sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf" + sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 10 sp_pinArray_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_mf_hf.timeout = 1600 sp_pinArray_2d_mf_hf.tol = 0.00001 - test_list.append(sp_pinArray_2d_mf_hf) + #test_list.append(sp_pinArray_2d_mf_hf) # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) sp_pinArray_3d_mf_hf_tp = TestCase('sp_pinArray_3d_mf_hf_tp') @@ -93,15 +93,15 @@ def main(): sp_pinArray_3d_mf_hf_tp.su2_exec = "parallel_computation.py -f" sp_pinArray_3d_mf_hf_tp.timeout = 1600 sp_pinArray_3d_mf_hf_tp.tol = 0.00001 - test_list.append(sp_pinArray_3d_mf_hf_tp) + #test_list.append(sp_pinArray_3d_mf_hf_tp) # create 2D CHT case with HF BC and sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') - sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" + sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "sp_pinArray_cht_2d_mf_hf.cfg" - sp_pinArray_cht_2d_mf_hf.test_iter = 10 - sp_pinArray_cht_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines - sp_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" + sp_pinArray_cht_2d_mf_hf.test_iter = 100 + sp_pinArray_cht_2d_mf_hf.test_vals = [100, 0.347683, -0.586679, -1.251935, -0.598357, 208.023676, 3.6085e+02] #last 7 lines + sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 test_list.append(sp_pinArray_cht_2d_mf_hf) @@ -119,7 +119,7 @@ def main(): sp_da_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" sp_da_pinArray_2d_dp_hf_tp.timeout = 1600 sp_da_pinArray_2d_dp_hf_tp.tol = 0.00001 - test_list.append(sp_pinArray_2d_dp_hf_tp) + #test_list.append(sp_pinArray_2d_dp_hf_tp) # 2D DA case cht pressure drop, heat obj function sp_da_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') @@ -130,7 +130,7 @@ def main(): sp_da_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_da_pinArray_cht_2d_mf_hf.timeout = 1600 sp_da_pinArray_cht_2d_mf_hf.tol = 0.00001 - test_list.append(sp_pinArray_cht_2d_mf_hf) + #test_list.append(sp_pinArray_cht_2d_mf_hf) pass_list = [ test.run_test() for test in test_list ] From 4ee0b6efe4f8ba1b01827a0f0dc74076d1d51311 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 16 Jun 2020 14:42:47 +0200 Subject: [PATCH 068/326] Make pipeSlice reg test work --- .../pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index ff738cca1df3..6688c23893ed 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -26,11 +26,8 @@ MATH_PROBLEM= DIRECT RESTART_SOL= NO % % Write binary restart files (YES, NO) -WRT_BINARY_RESTART= NO +WRT_BINARY_RESTART= YES % -% Read binary restart files (YES, NO) -READ_BINARY_RESTART= NO - HISTORY_OUTPUT= (FLOW_COEFF, LINSOL) % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% From 2b20a0a604f7dee168237b0b773e37f43844ac7e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 19 Jun 2020 00:18:43 +0200 Subject: [PATCH 069/326] bug-fix in GG-gradient computation for periodic boundaries. --- Common/src/CConfig.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 43630a7bc9db..34be48d8463f 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2845,7 +2845,7 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { * If there is a statement after a cont. char * throw an error. ---*/ - if (text_line.front() != '%'){ + if (!text_line.empty() && text_line.front() != '%'){ while (text_line.back() == '\\' || (PrintingToolbox::split(text_line, '\\').size() > 1)){ string tmp; diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index f47866f3e911..b0453d475f26 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -772,7 +772,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Rotate the partial gradients in space for all variables. ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (iVar = 0; iVar < nPrimVarGrad; iVar++) { Rotate(zeros, jacBlock[iVar], rotBlock[iVar]); } From c90583804af08734176888d76c5a0671e8802841 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 26 Jun 2020 01:22:01 +0200 Subject: [PATCH 070/326] Resolves a segfault when heat solver is run alone. --- SU2_CFD/include/iteration/CHeatIteration.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SU2_CFD/include/iteration/CHeatIteration.hpp b/SU2_CFD/include/iteration/CHeatIteration.hpp index 26b7085e489b..c8aa4d8cfefc 100644 --- a/SU2_CFD/include/iteration/CHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CHeatIteration.hpp @@ -85,4 +85,19 @@ class CHeatIteration : public CFluidIteration { CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) override; + /*! + * \brief Postprocesses the heat system before heading to another physics system or the next iteration. Does nothing + * in the moment. + */ + void Postprocess(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 { }; }; From a4552856fd286ebaf07673ad55319794846fe807 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 27 Jun 2020 22:55:25 +0200 Subject: [PATCH 071/326] Added 2 reg test for streamwise periodcity --- SU2_CFD/src/output/COutput.cpp | 3 ++- SU2_CFD/src/solvers/CHeatSolver.cpp | 2 +- .../chtPinArray_2d/configFluid.cfg | 8 ++++---- .../pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg | 2 +- .../pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 2 +- TestCases/streamwise_periodic_regression.py | 20 +++++++++---------- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index b27ef3cf7c46..4597916fac85 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1149,7 +1149,8 @@ void COutput::SetScreen_Output(CConfig *config) { PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::SCIENTIFIC: - PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); + // Line commented as it makes MARKER_ANALYZE screen output appear twice on the screen. + //PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::PERCENT: PrintingToolbox::PrintScreenPercent(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 2e23252086f3..38aabd19e12c 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1280,7 +1280,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C HeatFlux_per_Marker[iMarker] += HeatFlux[iMarker][iVertex]*Area; - /*--- We do only aim to compute averaged temperatures on the (interesting) heat flux walls ---*/ + /*--- We do only aim to compute averaged temperatures on the (interesting) heat flux walls TK::That creates unexpected behavior ---*/ if ( Boundary == HEAT_FLUX ) { diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index 9bbb4207781f..1b386c9aa3be 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -265,13 +265,13 @@ HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) SCREEN_WRT_FREQ_INNER= 25 % -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow +%OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) +%VOLUME_FILENAME= flow +%SURFACE_FILENAME= surface_flow READ_BINARY_RESTART= YES % % Writing frequency for volume/surface output -OUTPUT_WRT_FREQ= 5000 +%OUTPUT_WRT_FREQ= 5000 % % Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg index a471c2a4be5a..1930e961bb27 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg @@ -255,7 +255,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.csv HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) % % History output groups (use 'SU2_CFD -d ' to view list of available fields) -SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) SCREEN_WRT_FREQ_INNER= 25 % OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg index 8c46dbf71b40..0672540326ef 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg @@ -259,7 +259,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.csv HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) % % History output groups (use 'SU2_CFD -d ' to view list of available fields) -SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) +SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP ) SCREEN_WRT_FREQ_INNER= 25 % OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 48d892fb1ac4..8ab9966ad78d 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -62,27 +62,27 @@ def main(): sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pipeSlice_3d_dp_hf_tp) - # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity (without turbulence model for now) + # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" - sp_pinArray_2d_dp_hf_tp.test_iter = 10 - sp_pinArray_2d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_2d_dp_hf_tp.test_iter = 25 + sp_pinArray_2d_dp_hf_tp.test_vals = [-4.669154, 1.393699, -0.709036, 208.023676] #last 4 lines sp_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_dp_hf_tp.timeout = 1600 sp_pinArray_2d_dp_hf_tp.tol = 0.00001 - #test_list.append(sp_pinArray_2d_dp_hf_tp) + test_list.append(sp_pinArray_2d_dp_hf_tp) - # create 2D pin case massflow periodic with heatflux BC and prescribed heat (without turbulence model for now) + # create 2D pin case massflow periodic with heatflux BC and prescribed heat sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" - sp_pinArray_2d_mf_hf.test_iter = 10 - sp_pinArray_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_2d_mf_hf.test_iter = 25 + sp_pinArray_2d_mf_hf.test_vals = [-4.669154, 1.393699, -0.709036, 208.023676] #last 4 lines sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_mf_hf.timeout = 1600 sp_pinArray_2d_mf_hf.tol = 0.00001 - #test_list.append(sp_pinArray_2d_mf_hf) + test_list.append(sp_pinArray_2d_mf_hf) # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) sp_pinArray_3d_mf_hf_tp = TestCase('sp_pinArray_3d_mf_hf_tp') @@ -98,9 +98,9 @@ def main(): # create 2D CHT case with HF BC and sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" - sp_pinArray_cht_2d_mf_hf.cfg_file = "sp_pinArray_cht_2d_mf_hf.cfg" + sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [100, 0.347683, -0.586679, -1.251935, -0.598357, 208.023676, 3.6085e+02] #last 7 lines + sp_pinArray_cht_2d_mf_hf.test_vals = [0.251797, -0.749091, -1.044246, -0.754061, 208.023676, 3.5440e+02] #last 7 lines sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 From 3ea56bec2828660899cfb67b9e6ab344025fab2a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 27 Jul 2020 13:19:08 +0200 Subject: [PATCH 072/326] Updated source term return type to current structure --- .../include/numerics/flow/flow_sources.hpp | 13 ++------- SU2_CFD/src/numerics/flow/flow_sources.cpp | 29 +++++++++---------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index d52715523018..46ffff6e3f3a 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -301,7 +301,7 @@ class CSourceWindGust final : public CSourceBase_Flow { * \author T. Kattmann * \version 6.1.0 "Falcon" */ -class CSourceIncStreamwise_Periodic : public CNumerics { +class CSourceIncStreamwise_Periodic : public CSourceBase_Flow { private: bool implicit, /*!< \brief Implicit calculation. */ @@ -331,20 +331,11 @@ class CSourceIncStreamwise_Periodic : public CNumerics { unsigned short val_nVar, CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CSourceIncStreamwise_Periodic(void); - /*! * \brief Source term integration for a body force. - * \param[out] val_residual - Pointer to the residual vector. - * \param[out] val_Jacobian_i - Jacobian of the numerical method at node i (implicit computation). * \param[in] config - Definition of the particular problem. */ - void ComputeResidual(su2double *val_residual, - su2double **Jacobian_i, - CConfig *config); + ResidualType<> ComputeResidual(const CConfig *config) override; }; diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 0fa89b02aaf4..2da10ebdaa1e 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -566,9 +566,8 @@ CNumerics::ResidualType<> CSourceWindGust::ComputeResidual(const CConfig* config CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, - CConfig *config) : CNumerics(val_nDim, - val_nVar, - config) { + CConfig *config) : + CSourceBase_Flow(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); @@ -586,11 +585,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ } -CSourceIncStreamwise_Periodic::~CSourceIncStreamwise_Periodic(void) { } - -void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, - su2double **Jacobian_i, - CConfig *config) { +CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { delta_p = config->GetStreamwise_Periodic_PressureDrop(); massflow = config->GetStreamwise_Periodic_MassFlow(); @@ -600,22 +595,22 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, if (implicit) { for (iVar=0; iVar < nVar; iVar++) for (jVar=0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; + jacobian[iVar][jVar] = 0.0; } // TK What in the case of variable density. Substract Freestream density i.e. hydrostatic pressure? /*--- No contribution in the continuity equation ---*/ - val_residual[0] = 0.0; + residual[0] = 0.0; /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ for (iDim = 0; iDim < nDim; iDim++) { scalar_factor = ( delta_p/config->GetPressure_Ref() ) / norm2_translation * Streamwise_Coord_Vector[iDim]; // TK check if pres_ref is the same as force ref, TK the (0) is hardcoded! streamwise periodic has to be the first marker - val_residual[iDim+1] = -Volume * scalar_factor; + residual[iDim+1] = -Volume * scalar_factor; } /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ - val_residual[nDim+1] = 0.0; + residual[nDim+1] = 0.0; if (energy && config->GetStreamwise_Periodic_Temperature()) { scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); @@ -625,9 +620,9 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, for (iDim = 0; iDim < nDim; iDim++) dot_product += Streamwise_Coord_Vector[iDim] * V_i[iDim+1]; - val_residual[nDim+1] = Volume * scalar_factor * dot_product; + residual[nDim+1] = Volume * scalar_factor * dot_product; - /*--- If a RANS turbulence model is used an additional source term, based on the eddy viscosity + /*--- If a RANS turbulence model ias used an additional source term, based on the eddy viscosity gradient is added. ---*/ if(turbulent) { @@ -639,16 +634,18 @@ void CSourceIncStreamwise_Periodic::ComputeResidual(su2double *val_residual, for (iDim = 0; iDim < nDim; iDim++) dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity - val_residual[nDim+1] -= Volume * scalar_factor * dot_product; + residual[nDim+1] -= Volume * scalar_factor * dot_product; }//if turbulent /*--- Jacobian contribution of energy equation periodic source term ---*/ if (implicit) { for (iDim = 0; iDim < nDim; iDim++) - Jacobian_i[nDim+1][iDim+1] = 0.0;//Volume * scalar_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why + jacobian[nDim+1][iDim+1] = 0.0;//Volume * scalar_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why }//if implicit }//if energy + return ResidualType<>(residual, jacobian, nullptr); + } CSourceRadiation::CSourceRadiation(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : From ec649db5f6b7ff663fcefb9b2a94960110b9f81e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 27 Jul 2020 13:33:58 +0200 Subject: [PATCH 073/326] Adapting to new source term template --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 8c91a5365f67..c89e46dfd329 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1502,13 +1502,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } /*--- Compute the streamwise periodic source residual ---*/ - numerics->ComputeResidual(Residual, Jacobian_i, config); + auto residual = numerics->ComputeResidual(config); /*--- Add the source residual to the total ---*/ - LinSysRes.AddBlock(iPoint, Residual); + LinSysRes.AddBlock(iPoint, residual); /*--- Add the implicit Jacobian contribution ---*/ - if (implicit) Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); }// for iPoint From 9dba8c41e54fc9170fea932a951a446b7081eb57 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 27 Jul 2020 14:48:26 +0200 Subject: [PATCH 074/326] Fixed a little bug for streamwise periodic reg tests. --- .../streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 2 +- TestCases/streamwise_periodic_regression.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg index 0672540326ef..e23264b76ec2 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg @@ -259,7 +259,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.csv HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) % % History output groups (use 'SU2_CFD -d ' to view list of available fields) -SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP ) +SCREEN_OUTPUT= ( INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP ) SCREEN_WRT_FREQ_INNER= 25 % OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 8ab9966ad78d..2f058ac0c0b5 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -78,7 +78,7 @@ def main(): sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 25 - sp_pinArray_2d_mf_hf.test_vals = [-4.669154, 1.393699, -0.709036, 208.023676] #last 4 lines + sp_pinArray_2d_mf_hf.test_vals = [-4.668313, 1.396042, -0.709802, 208.677970] #last 4 lines sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_mf_hf.timeout = 1600 sp_pinArray_2d_mf_hf.tol = 0.00001 @@ -104,6 +104,7 @@ def main(): sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 + sp_pinArray_cht_2d_mf_hf.multizone = True test_list.append(sp_pinArray_cht_2d_mf_hf) ################################## From 60e8fb480bde500e78579591d68e09a64f4a9b02 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 28 Jul 2020 17:55:15 +0200 Subject: [PATCH 075/326] Refactor streawmise outlet heatsink as a source class. --- Common/include/CConfig.hpp | 15 +- SU2_CFD/include/numerics/CNumerics.hpp | 14 ++ .../include/numerics/flow/flow_sources.hpp | 43 ++++- SU2_CFD/src/drivers/CDriver.cpp | 5 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 50 +++++ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 179 +++++++----------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- TestCases/streamwise_periodic_regression.py | 4 +- 8 files changed, 197 insertions(+), 115 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index a2c09e78819f..029ed386147e 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1030,7 +1030,8 @@ class CConfig { Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ + Streamwise_Periodic_OutletHeat, /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ + Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ @@ -5940,6 +5941,18 @@ class CConfig { */ su2double GetStreamwise_Periodic_OutletHeat(void) const { return Streamwise_Periodic_OutletHeat; } + /*! + * \brief Set the value of the area avg periodic inlet Temperature. + * \param[in] Temp - area avg periodic inlet Temperature. + */ + void SetStreamwise_Periodic_InletTemperature(su2double Temp) { Streamwise_Periodic_InletTemperature = Temp; } + + /*! + * \brief Get the value of the area avg periodic inlet Temperature. + * \return Temperature value. + */ + su2double GetStreamwise_Periodic_InletTemperature(void) const { return Streamwise_Periodic_InletTemperature; } + /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 696c202de82e..d1fe3c03834e 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -78,6 +78,9 @@ class CNumerics { Thermal_Diffusivity_i, /*!< \brief Thermal diffusivity at point i. */ Thermal_Diffusivity_j; /*!< \brief Thermal diffusivity at point j. */ su2double + SpecificHeat_i, /*!< \brief Specific heat at point j. */ + SpecificHeat_j; /*!< \brief Specific heat at point j. */ + su2double Cp_i, /*!< \brief Cp at point i. */ Cp_j; /*!< \brief Cp at point j. */ su2double @@ -526,6 +529,17 @@ class CNumerics { Thermal_Diffusivity_j = val_thermal_diffusivity_j; } + /*! + * \brief Set the specifc heat + * \param[in] val_specific_heat_i - Value of the specific heat at point i. + * \param[in] val_specific_heat_j - Value of the specific heat at point j. + */ + inline void SetSpecificHeat(su2double val_specific_heat_i, + su2double val_specific_heat_j) { + SpecificHeat_i = val_specific_heat_i; + SpecificHeat_j = val_specific_heat_j; + } + /*! * \brief Set the eddy viscosity. * \param[in] val_eddy_viscosity_i - Value of the eddy viscosity at point i. diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 46ffff6e3f3a..ede81c4afbaf 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -299,9 +299,8 @@ class CSourceWindGust final : public CSourceBase_Flow { * \brief Class for the source term integration of a streamwise periodic body force in the incompressible solver. * \ingroup SourceDiscr * \author T. Kattmann - * \version 6.1.0 "Falcon" */ -class CSourceIncStreamwise_Periodic : public CSourceBase_Flow { +class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { private: bool implicit, /*!< \brief Implicit calculation. */ @@ -323,6 +322,7 @@ class CSourceIncStreamwise_Periodic : public CSourceBase_Flow { public: /*! + * \brief Constructor of the class. * \param[in] val_nDim - Number of dimensions of the problem. * \param[in] val_nVar - Number of variables of the problem. * \param[in] config - Definition of the particular problem. @@ -339,6 +339,45 @@ class CSourceIncStreamwise_Periodic : public CSourceBase_Flow { }; +/*! + * \class CSourceIncStreamwisePeriodic_Outlet + * \brief Class for the outlet heat sink. Acts like a heatflux boundary on the outlet and not as a volume source. + * \ingroup SourceDiscr + * \author T. Kattmann + */ +class CSourceIncStreamwisePeriodic_Outlet : public CSourceBase_Flow { +private: + + su2double + AxiFactor, /*!< brief Factor for axisymmetric simulations */ + FaceArea, /*!< brief Boundary face area */ + local_Massflow, /*!< brief massflow through that one boundary cell */ + AreaAvgInletTemp; /*!< brief Area avg inlet Temp. Computed in GetStreamwise_Periodic_Properties */ + + unsigned short iDim, /*!< brief Counts over Dimensions. */ + iVar, jVar; /*!< brief Count over Variables. */ + +public: + + /*! + * \brief Constructor of the class. + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of variables of the problem. + * \param[in] config - Definition of the particular problem. + */ + CSourceIncStreamwisePeriodic_Outlet(unsigned short val_nDim, + unsigned short val_nVar, + CConfig *config); + + /*! + * \brief Source term integration for boundary heat sink. + * \param[in] config - Definition of the particular problem. + */ + ResidualType<> ComputeResidual(const CConfig *config) override; + +}; + + /*! * \class CSourceRadiation * \brief Class for a source term due to radiation. diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index bc5e8e925b14..de7cdb582cec 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1834,7 +1834,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceBodyForce(nDim, nVar_Flow, config); } else if (incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) { - numerics[iMGlevel][FLOW_SOL][SOURCE_FIRST_TERM] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); + numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); } else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) { numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceBoussinesq(nDim, nVar_Flow, config); @@ -1864,6 +1864,9 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol /*--- At the moment it is necessary to have the RHT equation in order to have a volumetric heat source. ---*/ if (config->AddRadiation()) numerics[iMGlevel][FLOW_SOL][source_second_term] = new CSourceRadiation(nDim, nVar_Flow, config); + else if ((incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) && + (config->GetEnergy_Equation() && !config->GetStreamwise_Periodic_Temperature())) + numerics[iMGlevel][FLOW_SOL][source_second_term] = new CSourceIncStreamwisePeriodic_Outlet(nDim, nVar_Flow, config); else numerics[iMGlevel][FLOW_SOL][source_second_term] = new CSourceNothing(nDim, nVar_Flow, config); } diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 2da10ebdaa1e..6f0fe669315e 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -648,6 +648,56 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C } +CSourceIncStreamwisePeriodic_Outlet::CSourceIncStreamwisePeriodic_Outlet(unsigned short val_nDim, + unsigned short val_nVar, + CConfig *config) : + CSourceBase_Flow(val_nDim, val_nVar, config) { } + +CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(const CConfig *config) { + + for (iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; + + // Compute the residual contribution + if (config->GetAxisymmetric()) { + if (Coord_i[1] != 0.0) + AxiFactor = 2.0*PI_NUMBER*Coord_i[1]; + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(Normal[iDim] * AxiFactor, 2); } + FaceArea = sqrt(FaceArea); + + //compute local massflow [kg/s] + local_Massflow = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + local_Massflow += Normal[iDim] * V_i[iDim+1] * DensityInc_i * AxiFactor; + } + + AreaAvgInletTemp = config->GetStreamwise_Periodic_InletTemperature(); + + // Massflow weighted heat sink, which takes out + // a) the integrated amount over the Heatflux marker + // b) a user provided quantity, especially the case for CHT cases + if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { + residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_IntegratedHeatFlow(); + } else { + residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); + } + + ///////////////////////////// + // hdf fluid adaption TODO add description here! + // Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution + residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * (AreaAvgInletTemp - config->GetInc_Temperature_Init()/config->GetTemperature_Ref() ); + + return ResidualType<>(residual, jacobian, nullptr); + +} + CSourceRadiation::CSourceRadiation(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : CSourceBase_Flow(val_nDim, val_nVar, config) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index c89e46dfd329..75a8deae688b 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1513,123 +1513,37 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont }// for iPoint if(!streamwise_periodic_temperature && energy) { - //loop markers and find the "outlet marker" - - //compute "outlet" area - su2double Area_Local = 0.0, - Area_Global = 0.0, - MassFlow_Local, - Temperature_Local = 0.0, - Temperature_Global = 0.0, - FaceArea, - AxiFactor; - - unsigned short Kind_Averaging=1, area=0, massflow=1; - - vector AreaNormal(nDim); - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - /*--- Only "inlet"/master periodic marker ---*/ - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 1) { - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint,1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint,1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } - - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } - Area_Local += sqrt(FaceArea); - FaceArea = sqrt(FaceArea); - Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); - - } // if domain - } // loop vertices - } // loop periodic boundaries - } // loop MarkerAll - - // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow - SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - Temperature_Global /= Area_Global; - if(rank==MASTER_NODE && false) cout << "Source Res outlet area: " << Area_Global << endl << "Outlet Area Avg Temperature: " << Temperature_Global* config->GetTemperature_Ref() << endl; + CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { /*--- Only "inlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 1) { + config->GetMarker_All_PerBound(iMarker) == 1) { // here it doesnt matter whether 1 or 2 for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } - - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } - FaceArea = sqrt(FaceArea); - - //compute local massflow - MassFlow_Local = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - MassFlow_Local += AreaNormal[iDim] * nodes->GetVelocity(iPoint, iDim) * nodes->GetDensity(iPoint) * AxiFactor; - } - - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - if(Kind_Averaging == area) { - if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { - Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_IntegratedHeatFlow(); - } else { - Residual[nDim+1] -= FaceArea/Area_Global * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); - } - } else if (Kind_Averaging == massflow) { - if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { - Residual[nDim+1] -= abs(MassFlow_Local/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_IntegratedHeatFlow(); - } else { - Residual[nDim+1] -= abs(MassFlow_Local/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); - } - } + /*--- Set the specific heat ---*/ + second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); + /*--- Set the Point coordinates ---*/ + second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint),NULL); + /*--- Set the area normal ---*/ + second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); + /*--- Load the primitive variables ---*/ + second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL); + /*--- Set incompressible density ---*/ + second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); + /*--- Compute the streamwise periodic source residual ---*/ + auto residual = second_numerics->ComputeResidual(config); /*--- Add the source residual to the total ---*/ - LinSysRes.AddBlock(iPoint, Residual); - - ///////////////////////////// - // hdf fluid adaption - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - - Residual[nDim+1] = 0.5 * abs(MassFlow_Local) * nodes->GetSpecificHeatCp(iPoint) * (Temperature_Global - config->GetInc_Temperature_Init()/config->GetTemperature_Ref() ); - - LinSysRes.AddBlock(iPoint, Residual); - - - } // if domain - } // loop vertices - } // loop periodic boundaries - } // loop MarkerAll + LinSysRes.AddBlock(iPoint, residual); + }// if domain + }// for iVertex + }// if periodic inlet boundary + }// for iMarker }// if !streamwise_periodic_temperature }// if streamwise_periodic @@ -3896,10 +3810,59 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry if (iMesh == MESH_0) config->SetStreamwise_Periodic_IntegratedHeatFlow(HeatFlow_Global); - //if (rank == MASTER_NODE) { cout << "HeatFlow_Global: " << HeatFlow_Global * config->GetHeat_Flux_Ref() << endl; } - } // if energy + // Compute area avg Temp of the inlet + su2double Area_Local = 0.0, + Area_Global = 0.0, + MassFlow_Local, + Temperature_Local = 0.0, + Temperature_Global = 0.0, + FaceArea, + AxiFactor; + + vector AreaNormal(nDim); - //if (rank == MASTER_NODE) { cout << "------------------------------- New Routine End --------------------------" << endl; } + //loop markers and find the "outlet marker" + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- Only "inlet"/master periodic marker, as I want to meet the specified inlet temperature ---*/ + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 1) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->nodes->GetDomain(iPoint)) { + geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); + + if (axisymmetric) { + if (geometry->nodes->GetCoord(iPoint,1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint,1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + FaceArea = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } + Area_Local += sqrt(FaceArea); + FaceArea = sqrt(FaceArea); + Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); + + } // if domain + } // loop vertices + } // loop periodic boundaries + } // loop MarkerAll + + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow + SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + Temperature_Global /= Area_Global; + // What do I do with the temperature now from here on? The only way really is to pipe it through the config... + config->SetStreamwise_Periodic_InletTemperature(Temperature_Global); + cout << "Properties::Temperature_Global: " << Temperature_Global << endl; + } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index ffbe517e3a0f..4eebd6beaf69 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -167,7 +167,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - if(rank==MASTER_NODE && false) cout << "NSPrepsocessing GetStreamwise_Periodic_Properties." << endl; + if(rank==MASTER_NODE && false) cout << "NSPreprocessing GetStreamwise_Periodic_Properties." << endl; GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Free allocated memory. ---*/ diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 2f058ac0c0b5..e423be7d4db5 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -120,7 +120,7 @@ def main(): sp_da_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" sp_da_pinArray_2d_dp_hf_tp.timeout = 1600 sp_da_pinArray_2d_dp_hf_tp.tol = 0.00001 - #test_list.append(sp_pinArray_2d_dp_hf_tp) + test_list.append(sp_pinArray_2d_dp_hf_tp) # 2D DA case cht pressure drop, heat obj function sp_da_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') @@ -131,7 +131,7 @@ def main(): sp_da_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_da_pinArray_cht_2d_mf_hf.timeout = 1600 sp_da_pinArray_cht_2d_mf_hf.tol = 0.00001 - #test_list.append(sp_pinArray_cht_2d_mf_hf) + test_list.append(sp_pinArray_cht_2d_mf_hf) pass_list = [ test.run_test() for test in test_list ] From 0789ee4222bc2fa7f1803f758423b963056348ac Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 29 Jul 2020 16:19:25 +0200 Subject: [PATCH 076/326] Cleanup unnessary regression files --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 25 ++-- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 - .../coupled_cht/incompressible/configFlow.cfg | 126 ------------------ .../sp_da_pinArray_2d_dp_hf_tp/README.md | 0 .../sp_da_pinArray_cht_2d_mf_hf/README.md | 0 .../sp_pinArray_2d_dp_hf_tp/README.md | 0 .../sp_pinArray_2d_mf_hf/README.md | 0 .../sp_pinArray_3d_mf_hf_tp/README.md | 0 .../sp_pinArray_cht_2d_mf_hf/README.md | 0 .../sp_pipeSlice_3d_dp_hf_tp/README.md | 0 config_template.cfg | 2 +- 11 files changed, 14 insertions(+), 143 deletions(-) delete mode 100644 TestCases/coupled_cht/incompressible/configFlow.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 75a8deae688b..2475deeb2905 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1494,17 +1494,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- If viscous, we need gradients for extra terms. ---*/ if (viscous) { - /*--- Gradient of the primitive variables ---*/ numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), NULL); - } - /*--- Compute the streamwise periodic source residual ---*/ + /*--- Compute the streamwise periodic source residual and add to the total ---*/ auto residual = numerics->ComputeResidual(config); - - /*--- Add the source residual to the total ---*/ LinSysRes.AddBlock(iPoint, residual); /*--- Add the implicit Jacobian contribution ---*/ @@ -1520,26 +1516,32 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Only "inlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { // here it doesnt matter whether 1 or 2 - + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { + + /*--- Load the primitive variables ---*/ + second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL); + /*--- Set the specific heat ---*/ second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); + /*--- Set the Point coordinates ---*/ second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint),NULL); + /*--- Set the area normal ---*/ second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); - /*--- Load the primitive variables ---*/ - second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL); + /*--- Set incompressible density ---*/ second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); - /*--- Compute the streamwise periodic source residual ---*/ - auto residual = second_numerics->ComputeResidual(config); - /*--- Add the source residual to the total ---*/ + /*--- Compute the streamwise periodic source residual and add to the total ---*/ + auto residual = second_numerics->ComputeResidual(config); LinSysRes.AddBlock(iPoint, residual); + }// if domain }// for iVertex }// if periodic inlet boundary @@ -3861,7 +3863,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry Temperature_Global /= Area_Global; // What do I do with the temperature now from here on? The only way really is to pipe it through the config... config->SetStreamwise_Periodic_InletTemperature(Temperature_Global); - cout << "Properties::Temperature_Global: " << Temperature_Global << endl; } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 4eebd6beaf69..15dd9daa121c 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -155,9 +155,6 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); - if (rank==MASTER_NODE && false) { - if (abs(Pressure_Recovered) > 1e-6) cout << "At iPoint: " << iPoint << " Pressure_Recovered " << Pressure_Recovered << endl; - } if (energy && InnerIter > 0) { //ExtIter > 0, hen egg problem Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); @@ -167,7 +164,6 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - if(rank==MASTER_NODE && false) cout << "NSPreprocessing GetStreamwise_Periodic_Properties." << endl; GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); /*--- Free allocated memory. ---*/ diff --git a/TestCases/coupled_cht/incompressible/configFlow.cfg b/TestCases/coupled_cht/incompressible/configFlow.cfg deleted file mode 100644 index e050394e3d32..000000000000 --- a/TestCases/coupled_cht/incompressible/configFlow.cfg +++ /dev/null @@ -1,126 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: 2D Cylinder test case for CHT coupling % -% Author: Ole Burghardt % -% Institution: Chair for Scientific Computing, TU Kaiserslautern % -% Date: March 12th, 2018 % -% File Version 6.0.1 "Falcon" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% - -SOLVER= INC_RANS -KIND_TURB_MODEL= SA -MATH_PROBLEM= DIRECT -RESTART_SOL= NO -SYSTEM_MEASUREMENTS= SI -WRT_BINARY_RESTART = YES - -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% - -INC_DENSITY_MODEL= CONSTANT -INC_ENERGY_EQUATION= YES -INC_DENSITY_INIT= 998.2 -INC_VELOCITY_INIT= ( 0.25, 0.0, 0.0 ) -INC_TEMPERATURE_INIT= 300.0 -INC_NONDIM= INITIAL_VALUES -FLUID_MODEL=CONSTANT_DENSITY -% -% List of inlet types for incompressible flows. List length must -% match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. -INC_INLET_TYPE= VELOCITY_INLET -% -% Damping coefficient for iterative updates at pressure inlets. (0.1 by default) -INC_INLET_DAMPING= 0.1 -% -% List of outlet types for incompressible flows. List length must -% match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET -INC_OUTLET_TYPE= PRESSURE_OUTLET -% -% Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) -INC_OUTLET_DAMPING= 0.1 - -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% - -SPECIFIC_HEAT_CP = 4182.0 - -% --------------------------- VISCOSITY MODEL ---------------------------------% - -VISCOSITY_MODEL=CONSTANT_VISCOSITY -MU_CONSTANT= 1.003E-3 - -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% - -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM = 6.99091 - -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% - -MARKER_INLET= ( IN, 300.0, 0.25, 1.0, 0.0, 0.0 ) -MARKER_OUTLET= ( OUT, 0 ) -MARKER_SYM= ( SYM ) -MARKER_ISOTHERMAL= ( NOZZLE, 300.0 ) - -MARKER_CHT_INTERFACE= (PIN) - -% ------------------------ SURFACES IDENTIFICATION ----------------------------% - -MARKER_PLOTTING = ( PINSD ) -MARKER_MONITORING = ( PINSD ) -EXTRA_HEAT_ZONE_OUTPUT = 2 - -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% - -NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 100 -CFL_ADAPT= YES -CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) - -BETA_FACTOR= 50 -MAX_DELTA_TIME= 1.0 - -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% - -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-8 -LINEAR_SOLVER_ITER= 10 - -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% - -CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -JST_SENSOR_COEFF= ( 0.5, 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 -CFL_REDUCTION_TURB= 1.0 - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% - -CONV_CRITERIA= RESIDUAL -CONV_RESIDUAL_MINVAL= -32 -CONV_STARTITER= 200 -CONV_CAUCHY_ELEMS= 100 -CONV_CAUCHY_EPS= 1E-10 - -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% - -MESH_FILENAME= coupled_cht_cylinder2d.su2 -MESH_FORMAT= SU2 -SOLUTION_FILENAME= solution_flow.dat -TABULAR_FORMAT= CSV -CONV_FILENAME= history -BREAKDOWN_FILENAME= 6rows_forces_breakdown.dat -RESTART_FILENAME= solution_flow.dat -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow -WRT_LIMITERS= NO -WRT_SHARPEDGES= NO -READ_BINARY_RESTART= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_2d_dp_hf_tp/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_da_pinArray_cht_2d_mf_hf/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_dp_hf_tp/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_2d_mf_hf/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/sp_pipeSlice_3d_dp_hf_tp/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/config_template.cfg b/config_template.cfg index 284c1d1f6518..da4cba545b01 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -244,7 +244,7 @@ INC_OUTLET_TYPE= PRESSURE_OUTLET INC_OUTLET_DAMPING= 0.1 % % Epsilon^2 multipier in Beta calculation for incompressible preconditioner. Default= 4.1 -BETA_FACTOR= 4.1); +BETA_FACTOR= 4.1 % ----------------------------- SOLID ZONE HEAT VARIABLES-----------------------% % % Thermal conductivity used for heat equation From 3a710799058cd703ca8f0c9ca6fd6d22a5608d6e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 30 Jul 2020 12:32:44 +0200 Subject: [PATCH 077/326] Cleaning streamwise periodic contribution --- .gitignore | 5 +--- Common/include/CConfig.hpp | 10 +++---- Common/src/CConfig.cpp | 2 +- SU2_CFD/include/iteration/CHeatIteration.hpp | 16 ++++++++-- SU2_CFD/include/output/CFlowIncOutput.hpp | 2 +- SU2_CFD/include/output/COutput.hpp | 6 ---- SU2_CFD/include/variables/CEulerVariable.hpp | 2 +- SU2_CFD/src/drivers/CDriver.cpp | 1 - .../src/integration/CMultiGridIntegration.cpp | 2 +- .../src/numerics/flow/convection/centered.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 27 +++++++++-------- SU2_CFD/src/output/CFlowOutput.cpp | 1 + SU2_CFD/src/output/CHeatOutput.cpp | 8 ++--- SU2_CFD/src/output/COutput.cpp | 22 +------------- SU2_CFD/src/solvers/CHeatSolver.cpp | 4 +-- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- SU2_DOT/src/SU2_DOT.cpp | 29 ++++++++++--------- config_template.cfg | 3 +- 19 files changed, 65 insertions(+), 81 deletions(-) diff --git a/.gitignore b/.gitignore index ad4e7f938d65..fa6030d1eda5 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,4 @@ Mercurial .hg* # Ignore build folder -build/ - -# ninja binary -ninja +./build/ diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 029ed386147e..214c555d21fb 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1025,14 +1025,14 @@ class CConfig { su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ - bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or outlet source term. */ - su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ - Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow which results in an delta p and therefore an artificial body force vector. */ + bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */ + su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ + Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [ks/s] which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ Streamwise_Periodic_OutletHeat, /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ - vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index ceb4d26b154d..10bbcd006720 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4956,7 +4956,7 @@ void CConfig::SetMarkers(unsigned short val_software) { /*--- Basic dimensionalization of the markers (worst scenario) ---*/ - nMarker_All = nMarker_Max; // TK:: one of these is unecessary + nMarker_All = nMarker_Max; /*--- Allocate the memory (markers in each domain) ---*/ diff --git a/SU2_CFD/include/iteration/CHeatIteration.hpp b/SU2_CFD/include/iteration/CHeatIteration.hpp index 9d51bd24e21a..53a9191e9121 100644 --- a/SU2_CFD/include/iteration/CHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CHeatIteration.hpp @@ -86,8 +86,20 @@ class CHeatIteration : public CFluidIteration { CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) override; /*! - * \brief Postprocesses the heat system before heading to another physics system or the next iteration. Does nothing - * in the moment. + * \brief Postprocesses the heat system before heading to another physics system or the next iteration. + * Does nothing in the moment because otherwise CFluidIteration::Postprocess is used. + * \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 - Zone number + * \param[in] val_iInst - Instance number + * */ void Postprocess(COutput* output, CIntegration**** integration, diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 2f6fc069b8bb..6ea482d22562 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -43,7 +43,7 @@ class CFlowIncOutput final: public CFlowOutput { bool heat; /*!< \brief Boolean indicating whether have a heat problem*/ bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ unsigned short streamwise_periodic; /*!< \brief Boolean indicating whether it si a streamwise periodic simulation */ - bool streamwise_periodic_temperature; /*!< \brief */ + bool streamwise_periodic_temperature; /*!< \brief Boolean indicating streamwise periodic temperature is used. */ public: diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 59a9810277a1..727e22f137fa 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -250,12 +250,6 @@ class COutput { */ COutput(CConfig *config, unsigned short nDim, bool femOutput); - /*! - * \brief Write information to meta data file - * \param[in] config - Definition of the particular problem per zone. - */ - virtual void WriteMetaData(CConfig *config){cout << "virtual void WriteMetaData" << endl;} - /*! * \brief Preprocess the volume output by setting the requested volume output fields. * \param[in] config - Definition of the particular problem. diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index 995b9012228e..ab51b53b3e8a 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -50,7 +50,7 @@ class CEulerVariable : public CVariable { MatrixType Limiter_Primitive; /*!< \brief Limiter of the primitive variables (T, vx, vy, vz, P, rho). */ /*--- Secondary variable definition ---*/ - MatrixType Secondary; /*!< \brief Primitive variables (T, vx, vy, vz, P, rho, h, c) in compressible flows. */ //TK:: wrong comment + MatrixType Secondary; /*!< \brief Secondary variables (???) in compressible flows. */ MatrixType Solution_New; /*!< \brief New solution container for Classical RK4. */ diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index de7cdb582cec..64eb4b999607 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1830,7 +1830,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol if (incompressible) numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceIncBodyForce(nDim, nVar_Flow, config); else - numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceBodyForce(nDim, nVar_Flow, config); } else if (incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) { diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 0c7e3b7df188..15a20b6b7ffa 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -202,7 +202,7 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, /*--- Send-Receive boundary conditions, and postprocessing ---*/ - solver_fine->Postprocessing(geometry_fine, solver_container_fine, config, iMesh); // TK CIncEulerSolver::Postprocessing called from here + solver_fine->Postprocessing(geometry_fine, solver_container_fine, config, iMesh); } diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index b39e2ae6830e..398c418d3ea2 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -615,7 +615,7 @@ CCentJSTInc_Flow::~CCentJSTInc_Flow(void) { } CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* config) { - //TK:: PReaccumulation missing! + implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); su2double U_i[5] = {0.0}, U_j[5] = {0.0}; diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index d51a5f4cc3dc..4eb99605ce37 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -493,11 +493,15 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); } - if(streamwise_periodic) + // Streamwise Periodicty + if(streamwise_periodic) { AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); - if (heat && streamwise_periodic && streamwise_periodic_temperature) - AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); - AddVolumeOutput("RANK", "rank", "SOLUTION", "rank of the MPI-partition"); + if (heat && streamwise_periodic_temperature) + AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); + } + + // MPI-Rank + AddVolumeOutput("RANK", "Rank", "MPI", "Rank of the MPI-partition"); } @@ -527,14 +531,13 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(iPoint, 2)); - if (nDim == 3){ + if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(iPoint, 3)); - if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, 4)); - } else { - if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, 3)); + if (heat) { + SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); + if (streamwise_periodic && streamwise_periodic_temperature) + SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } - if (heat && streamwise_periodic && streamwise_periodic_temperature) - SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); switch(config->GetKind_Turb_Model()){ @@ -683,7 +686,3 @@ bool CFlowIncOutput::SetUpdate_Averages(CConfig *config){ return (config->GetTime_Marching() != STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); } - -void WriteMetaData(CConfig *config) { - cout << "CFlowIncOutput::WriteMetaData" << endl; -} diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 4a15cb04d156..652324aea998 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -224,6 +224,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi if (AxiFactor == 0.0) Vn = 0.0; else Vn /= Area; Vn2 = Vn * Vn; Pressure = solver->GetNodes()->GetPressure(iPoint); + /*--- Use recovered pressure here as pressure difference between in and outlet is zero otherwise ---*/ if(streamwise_periodic) Pressure = solver->GetNodes()->GetStreamwise_Periodic_RecoveredPressure(iPoint); SoundSpeed = solver->GetNodes()->GetSoundSpeed(iPoint); diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 8579d345b1cf..c7e3f5dc09e9 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -111,9 +111,9 @@ void CHeatOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("AVG_TEMPERATURE", "AvgTemp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total average temperature on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT); AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); - /// DESCRIPTION: Linear solver iterations - AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); - AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); + // Linear solver iterations + AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); + AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); } @@ -136,7 +136,7 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); // MPI-Rank - AddVolumeOutput("RANK", "rank", "SOLUTION", "rank of the MPI-partition"); + AddVolumeOutput("RANK", "rank", "MPI", "Rank of the MPI-partition"); } diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 6f7af583c824..a9e433105d64 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -720,25 +720,6 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, unsigned short f su2double BandWidth = fileWriter->Get_Bandwidth(); - //if restart restartbinary Write metadata - if(rank==MASTER_NODE && false) { - if(format==RESTART_ASCII || format==CSV || format==RESTART_BINARY) { - cout << "Writing metadata into restart file: " << fileName << endl; - ofstream restart_file; - if(format==RESTART_ASCII || format==CSV) { - fileName += CSU2FileWriter::fileExt; - } else if (format==RESTART_BINARY) { - fileName += CSU2BinaryFileWriter::fileExt; - } - restart_file.open(fileName.c_str(), ios::out | ios::app); - //open file - //WriteMetaDataBase(...) - WriteMetaData(config); - restart_file << endl <<"TOBI= 27"; - restart_file.close(); - }//if format - }//if MASTER_NODE - /*--- Compute and store the bandwidth ---*/ if (format == RESTART_BINARY){ @@ -1149,8 +1130,7 @@ void COutput::SetScreen_Output(CConfig *config) { PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::SCIENTIFIC: - // Line commented as it makes MARKER_ANALYZE screen output appear twice on the screen. - //PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); + PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::PERCENT: PrintingToolbox::PrintScreenPercent(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 9758c28506db..669f0ed4eb3a 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1279,7 +1279,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C HeatFlux_per_Marker[iMarker] += HeatFlux[iMarker][iVertex]*Area; - /*--- We do only aim to compute averaged temperatures on the (interesting) heat flux walls TK::That creates unexpected behavior ---*/ + /*--- We do only aim to compute averaged temperatures on the (interesting) heat flux walls ---*/ if ( Boundary == HEAT_FLUX ) { @@ -1581,7 +1581,7 @@ void CHeatSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { unsigned short iVar; - unsigned long iPoint, total_index, IterLinSol = 0;; + unsigned long iPoint, total_index, IterLinSol; su2double Delta, Vol, *local_Res_TruncError; bool flow = ((config->GetKind_Solver() == INC_NAVIER_STOKES) || (config->GetKind_Solver() == INC_RANS) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 15dd9daa121c..4dee0060cec6 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -631,7 +631,7 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai condition (Dirichlet). Fix the velocity and remove any contribution to the residual at this node. ---*/ - nodes->SetVelocity_Old(iPoint,Vector); // TK Why _Old? Is there a solution copying directly afterwards? + nodes->SetVelocity_Old(iPoint,Vector); for (iDim = 0; iDim < nDim; iDim++) LinSysRes.SetBlock_Zero(iPoint, iDim+1); diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index ba802e6f1d28..5b5cf37269ae 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -40,7 +40,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci /*--- Allocate and initialize the primitive variables and gradients ---*/ - nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu + nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu, TODO check that this is actually the case /*--- Allocate residual structures ---*/ diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 499dcd5bb87d..49b0c1c5685e 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -292,11 +292,14 @@ int main(int argc, char *argv[]) { SetSensitivity_Files(geometry_container, config_container, nZone); } - su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; // move allocation outwards /*--- Initialize structure to store the gradient ---*/ + su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; + for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { - Gradient[iDV] = new su2double[config_container[ZONE_0]->GetnDV_Value(iDV)] (); + /*--- Initialze to zero ---*/ + Gradient[iDV] = new su2double[config_container[ZONE_0]->GetnDV_Value(iDV)](); } + ofstream Gradient_file; for (iZone = 0; iZone < nZone; iZone++){ @@ -306,7 +309,6 @@ int main(int argc, char *argv[]) { if (rank == MASTER_NODE) cout << "\n---------- Start gradient evaluation using sensitivity information ----------" << endl; - /*--- Definition of the Class for surface deformation ---*/ surface_movement[iZone] = new CSurfaceMovement(); @@ -323,23 +325,22 @@ int main(int argc, char *argv[]) { else SetProjection_FD(geometry_container[iZone][INST_0], config_container[iZone], surface_movement[iZone] , Gradient); - } - } + } // for iZone - /*--- Write the gradient in a external file ---*/ + /*--- Write the gradient in a external file ---*/ - if (rank == MASTER_NODE) - Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); + if (rank == MASTER_NODE) + Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); - /*--- Print gradients to screen and file ---*/ + /*--- Print gradients to screen and file ---*/ - OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); + OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); - for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++){ - delete [] Gradient[iDV]; - } - delete [] Gradient; + for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++){ + delete [] Gradient[iDV]; + } + delete [] Gradient; delete config; config = nullptr; diff --git a/config_template.cfg b/config_template.cfg index da4cba545b01..f1c3375b51c9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1451,7 +1451,8 @@ HISTORY_WRT_FREQ_TIME= 1 % % Writing convergence history frequency WRT_CON_FREQ= 1 -% Writing convergence history frequency for the dual time +% +% Writing convergence history frequency for the dual time stepping WRT_CON_FREQ_DUALTIME= 10 % % Writing frequency for volume/surface output From d9cbadef92db923ebd450e4b9536a27d7fdb382a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 3 Aug 2020 15:09:07 +0200 Subject: [PATCH 078/326] Cleanup of streamwise periodic branch. --- Common/include/CConfig.hpp | 7 +- Common/include/option_structure.hpp | 2 +- Common/src/CConfig.cpp | 25 +-- Common/src/geometry/CPhysicalGeometry.cpp | 12 +- SU2_CFD/include/numerics/CNumerics.hpp | 6 +- .../include/numerics/flow/flow_sources.hpp | 8 +- SU2_CFD/include/output/CFlowIncOutput.hpp | 4 +- .../include/variables/CIncEulerVariable.hpp | 34 ++-- SU2_CFD/include/variables/CVariable.hpp | 19 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 35 +--- SU2_CFD/src/output/CFlowIncOutput.cpp | 31 ++-- SU2_CFD/src/output/CFlowOutput.cpp | 4 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 3 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 3 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 42 ++--- SU2_CFD/src/variables/CIncEulerVariable.cpp | 5 +- SU2_DOT/src/SU2_DOT.cpp | 3 +- .../streamwise_periodic/pipeSlice_3d/plots.py | 162 ------------------ 18 files changed, 114 insertions(+), 291 deletions(-) delete mode 100755 TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 214c555d21fb..8091672f1bfb 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -6443,16 +6443,17 @@ class CConfig { const su2double *GetPeriodicRotAngles(string val_marker) const; /*! - * \brief Translation vector for a translational (TK:: rotational in Toms code) periodic boundary. + * \brief Translation vector for a translational periodic boundary. */ const su2double *GetPeriodicTranslation(string val_marker) const; /*! - * \brief Get the translation vector for a periodic transformation. + * \brief Get the translation vector for a periodic transformation. In streamwise periodic flow we currently only + * allow for one periodic boundary (pair) and there always acces val_index=0. * \param[in] val_index - Index corresponding to the periodic transformation. * \return The translation vector. */ - su2double* GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } + const su2double* GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } /*! * \brief Get the rotationally periodic donor marker for boundary val_marker. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 525063a1b333..8c908820c648 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2202,7 +2202,7 @@ static const MapType Verification_Solution_ * \brief types of streamwise periodicity. */ enum ENUM_STREAMWISE_PERIODIC { - NO_STREAMWISE_PERIODIC = 0, /*!< \brief No projection. */ + NO_STREAMWISE_PERIODIC = 0, /*!< \brief No streamwise periodic flow. */ PRESSURE_DROP = 1, /*!< \brief Prescribed pressure drop. */ STREAMWISE_MASSFLOW = 2, /*!< \brief Prescribed massflow. */ }; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 10bbcd006720..a4b1af8d7a04 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1125,9 +1125,9 @@ void CConfig::SetConfig_Options() { addBoolOption("STREAMWISE_PERIODIC_TEMPERATURE", Streamwise_Periodic_Temperature, false); /* DESCRIPTION: Heatflux boundary at streamwise periodic 'outlet', choose heat [W] such that net domain heatflux is zero. Only active if STREAMWISE_PERIODIC_TEMPERATURE is active. */ addDoubleOption("STREAMWISE_PERIODIC_OUTLET_HEAT", Streamwise_Periodic_OutletHeat, 0.0); - /* DESCRIPTION: Delta pressure on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ + /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); - /* DESCRIPTION: Target Massflow, Delta P will be adapted until m_dot is met. */ + /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ @@ -4614,19 +4614,24 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - /*--- Check for Streamwise Periodic Boundary conditions ---*/ + /*--- Check feassbility for Streamwise Periodic flow ---*/ if (Kind_Streamwise_Periodic != NONE) { - if (Kind_Solver == EULER) - SU2_MPI::Error("Streamwise_Periodic+Inc_Euler: Not tested yet.", CURRENT_FUNCTION); + if (Kind_Solver == INC_EULER) + SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); if (Kind_Regime != INCOMPRESSIBLE) - SU2_MPI::Error("Streamwise Periodic BC currently only implemented for incompressible flow.", CURRENT_FUNCTION); + SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for incompressible flow.", CURRENT_FUNCTION); if (nMarker_PerBound != 2) - SU2_MPI::Error("Streamwise Periodic BC currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible yet.", CURRENT_FUNCTION); - if (Energy_Equation && nMarker_Isothermal != 0) - SU2_MPI::Error("No isothermal marker allowed with streamwise periodicity, only heatflux.", CURRENT_FUNCTION); - + SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible in the moment.", CURRENT_FUNCTION); + if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) + SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); + if (DiscreteAdjoint && Kind_Streamwise_Periodic == MASSFLOW) + SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION); + /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ Streamwise_Periodic_RefNode.resize(val_nDim); + } else { + /*--- Safety measure ---*/ + Streamwise_Periodic_Temperature = false; } /*--- Handle default options for topology optimization ---*/ diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 5512c42706f7..78ca583a5317 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7783,12 +7783,10 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, min_norm = norm; for (iDim = 0; iDim < nDim; iDim++) Buffer_Send_RefNode[iDim] = nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim); - - } else if (norm == min_norm) { - // TK::write code later } + /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } - break; // Actually no more than one streamwise periodic marker pair is allowed, TK::what if combined with spanwise periodicity? + break; // Actually no more than one streamwise periodic marker pair is allowed } // receiver conditional } // periodic conditional } // marker loop @@ -7815,16 +7813,14 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, min_norm = norm; for (iDim = 0; iDim < nDim; iDim++) Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iPoint*nDim + iDim]; - - } else if (norm == min_norm) { - // TK::write code later } + /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } /*--- Store the final reference node. ---*/ config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode); - /*--- Print the reference node. ---*/ + /*--- Print the reference node to screen. ---*/ if (rank == MASTER_NODE) { cout << "Streamwise Periodic Reference Node: ["; for (iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index d1fe3c03834e..724d7ecc9f63 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -78,8 +78,8 @@ class CNumerics { Thermal_Diffusivity_i, /*!< \brief Thermal diffusivity at point i. */ Thermal_Diffusivity_j; /*!< \brief Thermal diffusivity at point j. */ su2double - SpecificHeat_i, /*!< \brief Specific heat at point j. */ - SpecificHeat_j; /*!< \brief Specific heat at point j. */ + SpecificHeat_i, /*!< \brief Specific heat c_p at point j. */ + SpecificHeat_j; /*!< \brief Specific heat c_p at point j. */ su2double Cp_i, /*!< \brief Cp at point i. */ Cp_j; /*!< \brief Cp at point j. */ @@ -530,7 +530,7 @@ class CNumerics { } /*! - * \brief Set the specifc heat + * \brief Set the specifc heat c_p. * \param[in] val_specific_heat_i - Value of the specific heat at point i. * \param[in] val_specific_heat_j - Value of the specific heat at point j. */ diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index ede81c4afbaf..d20a1dba0848 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -303,9 +303,9 @@ class CSourceWindGust final : public CSourceBase_Flow { class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { private: - bool implicit, /*!< \brief Implicit calculation. */ - turbulent, /*!< \brief Turbulence model used. */ - energy; /*!< \brief Energy equation on. */ + bool turbulent, /*!< \brief Turbulence model used. */ + energy, /*!< \brief Energy equation on. */ + streamwisePeriodic_temperature; /*!< \brief Periodicity in energy equation */ vector Streamwise_Coord_Vector; /*!< \brief Translation vector between streamwise periodic surfaces. */ @@ -314,7 +314,7 @@ class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { massflow, /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ delta_p, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ dot_product, /*!< \brief Container for various dot-products. */ - scalar_factor; /*!< brief Holds scalar factors to simplify final equations. */ + scalar_factor; /*!< \brief Holds scalar factors to simplify final equations. */ unsigned short iDim, /*!< brief Counts over Dimensions. */ iVar, jVar; /*!< brief Count over Variables. */ diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 6ea482d22562..2b07206c1132 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -42,8 +42,8 @@ class CFlowIncOutput final: public CFlowOutput { unsigned short turb_model; /*!< \brief The kind of turbulence model*/ bool heat; /*!< \brief Boolean indicating whether have a heat problem*/ bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ - unsigned short streamwise_periodic; /*!< \brief Boolean indicating whether it si a streamwise periodic simulation */ - bool streamwise_periodic_temperature; /*!< \brief Boolean indicating streamwise periodic temperature is used. */ + unsigned short streamwisePeriodic; /*!< \brief Boolean indicating whether it is a streamwise periodic simulation. */ + bool streamwisePeriodic_temperature; /*!< \brief Boolean indicating streamwise periodic temperature is used. */ public: diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index 1ef55c8210a8..94d2b5998451 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -45,8 +45,8 @@ class CIncEulerVariable : public CVariable { MatrixType Limiter_Primitive; /*!< \brief Limiter of the primitive variables (P, vx, vy, vz, T, rho, beta). */ VectorType Density_Old; /*!< \brief Old density for variable density turbulent flows (SST). */ - VectorType Streamwise_Periodic_RecoveredPressure, /*!< \brief Recovered/Physical pressure for streamwise periodic flow. */ - Streamwise_Periodic_RecoveredTemperature; /*!< \brief Recovered/Physical temperature for streamwise periodic flow. */ + VectorType Streamwise_Periodic_RecoveredPressure, /*!< \brief Recovered/Physical pressure [Pa] for streamwise periodic flow. */ + Streamwise_Periodic_RecoveredTemperature; /*!< \brief Recovered/Physical temperature [K] for streamwise periodic flow. */ public: /*! @@ -358,36 +358,38 @@ class CIncEulerVariable : public CVariable { /*! * \brief Set the recovered pressure for streamwise periodic flow. + * \param[in] iPoint - Point index. * \param[in] val_pressure - pressure value. */ - inline void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint, su2double val_pressure) override { - Streamwise_Periodic_RecoveredPressure(iPoint) = val_pressure; } + inline void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint, su2double val_pressure) final { + Streamwise_Periodic_RecoveredPressure(iPoint) = val_pressure; + } /*! * \brief Get the recovered pressure for streamwise periodic flow. + * \param[in] iPoint - Point index. * \return Recovered/Physical pressure for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const override { - return Streamwise_Periodic_RecoveredPressure(iPoint); } + inline su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const final { + return Streamwise_Periodic_RecoveredPressure(iPoint); + } /*! - * \brief Set the recovered pressure for streamwise periodic flow. + * \brief Set the recovered temperature for streamwise periodic flow. + * \param[in] iPoint - Point index. * \param[in] val_temperature - temperature value. */ - inline void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) override { - Streamwise_Periodic_RecoveredTemperature(iPoint) = val_temperature; } + inline void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) final { + Streamwise_Periodic_RecoveredTemperature(iPoint) = val_temperature; + } /*! * \brief Get the recovered temperature for streamwise periodic flow. + * \param[in] iPoint - Point index. * \return Recovered/Physical temperature for streamwise periodic flow. */ - inline su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const override { - return Streamwise_Periodic_RecoveredTemperature(iPoint); } - - //TK:: unclear during merge whether necessary - inline void SetVelocity(unsigned long iPoint, su2double *val_velocity) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Solution(iPoint, iDim+1) = val_velocity[iDim]; + inline su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const final { + return Streamwise_Periodic_RecoveredTemperature(iPoint); } }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 37159bdea245..8661ef9e87de 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2696,40 +2696,33 @@ class CVariable { inline virtual su2double GetSolution_Old_Accel(unsigned long iPoint, unsigned long iVar) const { return 0.0; } /*! - * \brief A virtual member. + * \brief A virtual member: Set the recovered pressure for streamwise periodic flow. * \param[in] iPoint - Point index. * \param[in] val_pressure - pressure value. */ - inline virtual void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint,su2double val_pressure) {} + inline virtual void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint,su2double val_pressure) { } /*! - * \brief A virtual member. + * \brief A virtual member: Get the recovered pressure for streamwise periodic flow. * \param[in] iPoint - Point index. * \return Recovered/Physical pressure for streamwise periodic flow. */ inline virtual su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const { return 0.0; } /*! - * \brief A virtual member. + * \brief A virtual member: Set the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. * \param[in] val_temperature - temperature value. */ - inline virtual void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) {} + inline virtual void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) { } /*! - * \brief A virtual member. + * \brief A virtual member: Get the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. * \return Recovered/Physical temperature for streamwise periodic flow. */ inline virtual su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const { return 0.0; } - /*! - * \brief A virtual member. - * \param[in] iPoint - Point index. - * \param[in] val_velocity - Pointer to the velocity. - */ - inline virtual void SetVelocity(unsigned long iPoint, su2double *val_velocity) {} - /*! * \brief Virtual member: Set the Radiative source term at the node * \return value of the radiative source term diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 6f0fe669315e..e64889bc68b4 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -569,9 +569,9 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CConfig *config) : CSourceBase_Flow(val_nDim, val_nVar, config) { - implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - turbulent = (config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS); + turbulent = (config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS); energy = config->GetEnergy_Equation(); + streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); Streamwise_Coord_Vector.resize(nDim); for (iDim = 0; iDim < nDim; iDim++) @@ -581,7 +581,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ dot_prod(t*t) = (|t|_2)^2 ---*/ norm2_translation = 0.0; for (iDim = 0; iDim < nDim; iDim++) - norm2_translation += Streamwise_Coord_Vector[iDim] * Streamwise_Coord_Vector[iDim]; + norm2_translation += pow(Streamwise_Coord_Vector[iDim],2); } @@ -590,28 +590,19 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C delta_p = config->GetStreamwise_Periodic_PressureDrop(); massflow = config->GetStreamwise_Periodic_MassFlow(); integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); - //cout << "Delta p: " << delta_p << endl; - /*--- Initialize the Jacobian contribution to zero ---*/ - if (implicit) { - for (iVar=0; iVar < nVar; iVar++) - for (jVar=0; jVar < nVar; jVar++) - jacobian[iVar][jVar] = 0.0; - } - - // TK What in the case of variable density. Substract Freestream density i.e. hydrostatic pressure? /*--- No contribution in the continuity equation ---*/ residual[0] = 0.0; /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ for (iDim = 0; iDim < nDim; iDim++) { - scalar_factor = ( delta_p/config->GetPressure_Ref() ) / norm2_translation * Streamwise_Coord_Vector[iDim]; // TK check if pres_ref is the same as force ref, TK the (0) is hardcoded! streamwise periodic has to be the first marker + scalar_factor = (delta_p/config->GetPressure_Ref()) / norm2_translation * Streamwise_Coord_Vector[iDim]; // TK check if pres_ref is the same as force ref residual[iDim+1] = -Volume * scalar_factor; } /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ residual[nDim+1] = 0.0; - if (energy && config->GetStreamwise_Periodic_Temperature()) { + if (energy && streamwisePeriodic_temperature) { scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); @@ -627,7 +618,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C if(turbulent) { /*--- Compute the scalar factor ---*/ - scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * config->GetPrandtl_Turb()); + scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ dot_product = 0.0; @@ -635,14 +626,8 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity residual[nDim+1] -= Volume * scalar_factor * dot_product; - }//if turbulent - - /*--- Jacobian contribution of energy equation periodic source term ---*/ - if (implicit) { - for (iDim = 0; iDim < nDim; iDim++) - jacobian[nDim+1][iDim+1] = 0.0;//Volume * scalar_factor * config->GetPeriodicTranslation(0)[iDim]; // TK Added Jacobian makes no difference at all... Why - }//if implicit - }//if energy + } // if turbulent + } // if energy return ResidualType<>(residual, jacobian, nullptr); @@ -689,9 +674,7 @@ CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(c residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); } - ///////////////////////////// - // hdf fluid adaption TODO add description here! - // Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution + /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution ---*/ residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * (AreaAvgInletTemp - config->GetInc_Temperature_Init()/config->GetTemperature_Ref() ); return ResidualType<>(residual, jacobian, nullptr); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 4eb99605ce37..176e419aecf3 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -39,8 +39,8 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); - streamwise_periodic = config->GetKind_Streamwise_Periodic(); - streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); + streamwisePeriodic = config->GetKind_Streamwise_Periodic(); + streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Set the default history fields if nothing is set in the config file ---*/ @@ -222,10 +222,10 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); } - if(streamwise_periodic) { - AddHistoryOutput("STREAMWISE_MASSFLOW", "SWMassflow", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); - AddHistoryOutput("STREAMWISE_DP", "SWDeltaP", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); - AddHistoryOutput("STREAMWISE_HEAT", "SWHeat", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Empty explanation"); + if(streamwisePeriodic) { + AddHistoryOutput("STREAMWISE_MASSFLOW", "SWMassflow", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Massflow in streamwise periodic flow"); + AddHistoryOutput("STREAMWISE_DP", "SWDeltaP", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Pressure drop in streamwise periodic flow"); + AddHistoryOutput("STREAMWISE_HEAT", "SWHeat", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Integrated heat for streamwise periodic flow"); } /*--- Add analyze surface history fields --- */ @@ -341,7 +341,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("MAX_CFL", flow_solver->GetMax_CFL_Local()); SetHistoryOutputValue("AVG_CFL", flow_solver->GetAvg_CFL_Local()); - if(streamwise_periodic) { + if(streamwisePeriodic) { SetHistoryOutputValue("STREAMWISE_MASSFLOW", config->GetStreamwise_Periodic_MassFlow()); SetHistoryOutputValue("STREAMWISE_DP", config->GetStreamwise_Periodic_PressureDrop()); SetHistoryOutputValue("STREAMWISE_HEAT", config->GetStreamwise_Periodic_IntegratedHeatFlow()); @@ -494,9 +494,9 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ } // Streamwise Periodicty - if(streamwise_periodic) { + if(streamwisePeriodic) { AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); - if (heat && streamwise_periodic_temperature) + if (heat && streamwisePeriodic_temperature) AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); } @@ -527,15 +527,14 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); - if(streamwise_periodic) - SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); + SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(iPoint, 2)); if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(iPoint, 3)); if (heat) { SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); - if (streamwise_periodic && streamwise_periodic_temperature) + if (streamwisePeriodic && streamwisePeriodic_temperature) SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); @@ -652,6 +651,14 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(&(Node_Flow->GetGradient_Primitive(iPoint)[1]))); } + // Streamwise Periodicty + if(streamwisePeriodic) { + SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); + if (heat && streamwisePeriodic_temperature) + SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); + } + + // MPI-Rank SetVolumeOutputValue("RANK", iPoint, rank); } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 652324aea998..246f1669cf88 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -125,7 +125,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi bool compressible = config->GetKind_Regime() == COMPRESSIBLE; bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; bool energy = config->GetEnergy_Equation(); - bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); + bool streamwisePeriodic = config->GetKind_Streamwise_Periodic(); bool axisymmetric = config->GetAxisymmetric(); @@ -225,7 +225,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi Vn2 = Vn * Vn; Pressure = solver->GetNodes()->GetPressure(iPoint); /*--- Use recovered pressure here as pressure difference between in and outlet is zero otherwise ---*/ - if(streamwise_periodic) Pressure = solver->GetNodes()->GetStreamwise_Periodic_RecoveredPressure(iPoint); + if(streamwisePeriodic) Pressure = solver->GetNodes()->GetStreamwise_Periodic_RecoveredPressure(iPoint); SoundSpeed = solver->GetNodes()->GetSoundSpeed(iPoint); for (iDim = 0; iDim < nDim; iDim++) { diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 669f0ed4eb3a..2b20852c72e2 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -774,7 +774,8 @@ void CHeatSolver::BC_Sym_Plane(CGeometry *geometry, CConfig *config, unsigned short val_marker) { - /* In case of a heat solver nothing has to be done for the symmetry BC. */ + /* In case of a heat solver (scalar transport equation) nothing has to be done (zero residual contribution) + for the symmetry BC. */ } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 2475deeb2905..f4be1ed156d2 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -103,7 +103,8 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned nDim = geometry->GetnDim(); - nVar = nDim+2; nPrimVar = nDim+9; nPrimVarGrad = nDim+4; + /*--- Make sure to align the sizes with the constructor of CIncEulerVariable. ---*/ + nVar = nDim+2; nPrimVar = nDim+9; nPrimVarGrad = nDim+6; /*--- Initialize nVarGrad for deallocation ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 4dee0060cec6..cfc11e6f3bde 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -57,12 +57,11 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { unsigned long iPoint, ErrorCounter = 0; - unsigned short iDim; su2double StrainMag = 0.0, Omega = 0.0, *Vorticity; - unsigned long InnerIter = config->GetInnerIter(); + unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); - bool disc_adjoint = config->GetDiscrete_Adjoint(); + bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); bool center_jst = center && config->GetKind_Centered_Flow() == JST; @@ -71,7 +70,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter())); bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; bool outlet = ((config->GetnMarker_Outlet() != 0)); - bool energy = config->GetEnergy_Equation(); + bool energy = config->GetEnergy_Equation(); /*--- Set the primitive variables ---*/ @@ -121,8 +120,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- Compute recovered pressure and temperature for streamwise periodic BC - Second conditional is there to avoid a zero (massflow) in the denominator for recovered temperature. ---*/ + /*--- Compute recovered pressure and temperature for streamwise periodic flow ---*/ if (config->GetKind_Streamwise_Periodic() != NONE) { /*--- Define and initialize helping variables ---*/ @@ -135,28 +133,27 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container HeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(), MassFlow = config->GetStreamwise_Periodic_MassFlow(); - su2double *Reference_node = new su2double[nDim]; + /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ + vector ReferenceNode = config->GetStreamwise_Periodic_RefNode(); - /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector - and compute square of the distance between the 2 periodic surfaces. ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - Reference_node[iDim] = config->GetStreamwise_Periodic_RefNode()[iDim]; + /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ + for (unsigned short iDim = 0; iDim < nDim; iDim++) norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); - } /*--- Compute recoverd pressure and temperature for all points ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - Reference_node[iDim]) * config->GetPeriodicTranslation(0)[iDim]); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodicTranslation(0)[iDim]); - /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ + /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK:: added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); - if (energy && InnerIter > 0) { //ExtIter > 0, hen egg problem + /*--- 'InnerIter > 0' as otherwise MassFlow in the denominator would be zero ---*/ + if (energy && InnerIter > 0) { Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); Temperature_Recovered += HeatFlow / (MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; nodes->SetStreamwise_Periodic_RecoveredTemperature(iPoint, Temperature_Recovered); @@ -165,10 +162,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); - - /*--- Free allocated memory. ---*/ - delete [] Reference_node; - } + } // if streamwise periodic /*--- Evaluate the vorticity and strain rate magnitude ---*/ @@ -644,24 +638,24 @@ void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai Res_Visc[nDim+1] = Wall_HeatFlux*Area; - /*--- With streamwise periodic BC and heatflux walls an additional + /*--- With streamwise periodic flow and heatflux walls an additional term is introduced in the boundary formulation ---*/ if (streamwise_periodic && streamwise_periodic_temperature) { Cp = nodes->GetSpecificHeatCp(iPoint); thermal_conductivity = nodes->GetThermalConductivity(iPoint); - /*--- Scalar part of the contribution ---*/ + /*--- Scalar factor of the residual contribution ---*/ scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); - /*--- Scalar product ---*/ + /*--- Dot product ---*/ dot_product = 0.0; for (iDim = 0; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } Res_Visc[nDim+1] -= scalar_factor*dot_product; - }//if streamwise_periodic + } // if streamwise_periodic /*--- Viscous contribution to the residual at the wall ---*/ diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 5b5cf37269ae..b5809b9d3b0c 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -38,9 +38,10 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci bool viscous = config->GetViscous(); bool axisymmetric = config->GetAxisymmetric(); - /*--- Allocate and initialize the primitive variables and gradients ---*/ + /*--- Allocate and initialize the primitive variables and gradients. + Make sure to align the sizes with the constructor of CIncEulerSolver ---*/ - nPrimVar = nDim+9; nPrimVarGrad = nDim+6; //TK:: for periodic turb EddyMu, TODO check that this is actually the case + nPrimVar = nDim+9; nPrimVarGrad = nDim+6; /*--- Allocate residual structures ---*/ diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 49b0c1c5685e..830193e3b541 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -302,6 +302,7 @@ int main(int argc, char *argv[]) { ofstream Gradient_file; + /*--- For multizone computations the gradient contributions are summed up and written into one file. ---*/ for (iZone = 0; iZone < nZone; iZone++){ if ((config_container[iZone]->GetDesign_Variable(0) != NONE) && (config_container[iZone]->GetDesign_Variable(0) != SURFACE_FILE)) { @@ -333,7 +334,7 @@ int main(int argc, char *argv[]) { if (rank == MASTER_NODE) Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); - /*--- Print gradients to screen and file ---*/ + /*--- Print gradients to screen and writes to file ---*/ OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py deleted file mode 100755 index b5a82d392f10..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/plots.py +++ /dev/null @@ -1,162 +0,0 @@ -#! /usr/bin/python3.5 -# --------------------------------------------------------------------------- # -# Kattmann, 16.07.2019 -# This python script provides some plots to test the match between analytical -# and simulated solution for a 3D circular laminar pipe flow, either from -# streamwise periodic simulation or the outlet of a suitable long pipe. -# -# requires: surface_flow.dat in current directory -# -# output: plots (opened in separate window, not saved) -# -# optional: which plots to show -showLineplot = True -show2Dsurfaceplots = False -show3Dplots = False -# --------------------------------------------------------------------------- # -import numpy as np -import pandas as pd -import matplotlib.pyplot as plt - -from mpl_toolkits.mplot3d import Axes3D -from scipy.spatial import Delaunay -from scipy.interpolate import LinearNDInterpolator - -# --------------------------------------------------------------------------- # -# Import data from surface_flow.dat into pandas dataframe -data = pd.read_csv("surface_flow.dat", nrows=4264, skiprows=3, sep='\t', header=None) -x = data[0][:] -y = data[1][:] -vel_z = data[6][:] - -# Create Delaunay surface triangulation from scatterd dataset -points2D = np.vstack([x,y]).T -tri = Delaunay(points2D) - -# --------------------------------------------------------------------------- # -# Create analytic solution vector on the same points as the imported data -dynanmic_vsicosity = 1.8e-5 -pressure_drop = 1e-3 -domain_length = 5e-4 -radius = 5e-3 - -analytic_sol = -1/(4*dynanmic_vsicosity) * (-pressure_drop/domain_length) * \ - (radius**2 - ((x**2 + y**2)**(0.5))**2 ) - -perc_devi_from_anal = abs(analytic_sol - vel_z) / max(analytic_sol) * 100 -maxvel = max(abs(perc_devi_from_anal)) # get absolute maximum of dataset - -# --------------------------------------------------------------------------- # -# Plot velocity on line from domain midpoint to wall -if showLineplot: - plt.close() - - # interpolator (ip) for simulated and analytical dataset - ip_sim = LinearNDInterpolator(tri, vel_z) - ip_ana = LinearNDInterpolator(tri, analytic_sol) - # line (which lies on the x-axis) where values will be interpolated - n_sample_points = 30 - x_line = np.linspace(0, radius-5e-6, n_sample_points) - y_line = np.zeros(n_sample_points) - ip_pos = np.vstack((x_line,y_line)).T - - ax = plt.axes() - plt.plot(ip_sim(ip_pos), x_line, color='b', marker='', linestyle='--', linewidth=3, label='simulated') - plt.plot(ip_ana(ip_pos), x_line, color='r', marker='', linestyle=':' , linewidth=3, label='analytical') - plt.legend() - plt.title('Velocity profile: analytic vs simulated (interpolated values)') - plt.xlabel('velocity [m/s]') - plt.ylabel('radius [m]') - ax.set_aspect(aspect=max(ip_sim(ip_pos)) / max(x_line)) # make plot square - plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0)) - plt.grid(True, linestyle='--') - plt.show() - -# --------------------------------------------------------------------------- # -# Plot various 2D surface plots of sim. and analy. data -if show2Dsurfaceplots: - plt.close() - - fig, ax = plt.subplots(2,2) - - # 1. analytical solution - ax_tmp = ax[0,0] - - tcf = ax_tmp.tricontourf(x, y, abs(analytic_sol)) - ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') - - ax_tmp.set_title("Analytical solution") - ax_tmp.set_aspect('equal') - fig.colorbar(tcf, ax=ax_tmp) - - # 2. simulated solution - ax_tmp = ax[1,0] - - tcf = ax_tmp.tricontourf(x, y, vel_z) - ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') - - ax_tmp.set_title("Simulated solution") - ax_tmp.set_aspect('equal') - fig.colorbar(tcf, ax=ax_tmp) - - # 3. absolute value deviation between analytic and simulated - ax_tmp = ax[0,1] - - tcf = ax_tmp.tricontourf(x, y, abs(analytic_sol-vel_z), cmap=plt.cm.Greys) - ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') - - ax_tmp.set_title("abs(analytic-simulated)") - ax_tmp.set_aspect('equal') - fig.colorbar(tcf, ax=ax_tmp) - - # 4. percentual deviation scaled by the maximal value - ax_tmp = ax[1,1] - - tcf = ax_tmp.tricontourf(x, y, perc_devi_from_anal, cmap=plt.cm.Greys, vmin=0.0, vmax=maxvel) - ax_tmp.scatter(x,y, s=0.1, color='black', marker='.') - - ax_tmp.set_title("abs(analytic-simulated) / max(analytic) * 100") - ax_tmp.set_aspect('equal') - fig.colorbar(tcf, ax=ax_tmp) - - plt.show() - -# --------------------------------------------------------------------------- # -if show3Dplots: - # Plot 3D surfaces of sim. and analy. data - plt.close() - - # Scatter plot deviation - fig = plt.figure() - ax = fig.gca(projection='3d') - - ax.scatter(x, y, perc_devi_from_anal) - ax.set_xlabel('x [m]') - ax.set_ylabel('y [m]') - ax.set_zlabel('z-Velocity deviation [%]') - - plt.show() - - # Surface plot deviation - fig = plt.figure() - ax = fig.gca(projection='3d') - - surf = ax.plot_trisurf(x, y, perc_devi_from_anal, triangles=tri.simplices, cmap='jet', linewidth=0) - ax.set_xlabel('x [m]') - ax.set_ylabel('y [m]') - ax.set_zlabel('z-Velocity deviation [%]') - fig.colorbar(surf) - - plt.show() - - # Surface plot of velocity - fig = plt.figure() - ax = fig.gca(projection='3d') - - surf = ax.plot_trisurf(x, y, vel_z, triangles=tri.simplices, cmap='jet', linewidth=0) - ax.set_xlabel('x [m]') - ax.set_ylabel('y [m]') - ax.set_zlabel('z-Velocity [m/s]') - fig.colorbar(surf) - - plt.show() From a403f143dd54738c1b72bc2599a97887b49f9fd8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 3 Aug 2020 18:36:57 +0200 Subject: [PATCH 079/326] Fixed reg test --- .gitignore | 5 ++++- SU2_CFD/include/limiters/computeLimiters_impl.hpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 1 - SU2_CFD/src/solvers/CIncNSSolver.cpp | 1 - SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index fa6030d1eda5..37be2eb1cf49 100644 --- a/.gitignore +++ b/.gitignore @@ -85,4 +85,7 @@ Mercurial .hg* # Ignore build folder -./build/ +/build/ + +# ninja binary +ninja diff --git a/SU2_CFD/include/limiters/computeLimiters_impl.hpp b/SU2_CFD/include/limiters/computeLimiters_impl.hpp index 0a6acd8a116c..71146cb423be 100644 --- a/SU2_CFD/include/limiters/computeLimiters_impl.hpp +++ b/SU2_CFD/include/limiters/computeLimiters_impl.hpp @@ -75,7 +75,7 @@ void computeLimiters_impl(CSolver* solver, FieldType& limiter) { constexpr size_t MAXNDIM = 3; - constexpr size_t MAXNVAR = 8; + constexpr size_t MAXNVAR = 9; if (varEnd > MAXNVAR) SU2_MPI::Error("Number of variables is too large, increase MAXNVAR.", CURRENT_FUNCTION); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 176e419aecf3..0342b2f66347 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -527,7 +527,6 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); - SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(iPoint, 2)); if (nDim == 3) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index cfc11e6f3bde..82c7fdf917dc 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -61,7 +61,6 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); - bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); bool center_jst = center && config->GetKind_Centered_Flow() == JST; diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index b5809b9d3b0c..f6a195b9c36b 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -94,7 +94,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Primitive.resize(nPoint,nPrimVar) = su2double(0.0); - /*--- Incompressible flow, gradients primitive variables nDim+4+2, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu), //TK:: for periodic turb EddyMu + /*--- Incompressible flow, gradients primitive variables nDim+6, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu). We need P, and rho for running the adjoint problem ---*/ Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); From f46014945bc7b0d7b01c3cfcfa0c6325ad7c189c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 4 Aug 2020 15:50:39 +0200 Subject: [PATCH 080/326] Adding DA+FD streamwise Testcase --- .../chtPinArray_2d/DA_configFluid.cfg | 199 +++++++++++++++++ .../chtPinArray_2d/DA_configMaster.cfg | 154 ++++++++++++++ .../chtPinArray_2d/DA_configSolid.cfg | 108 ++++++++++ .../chtPinArray_2d/FD_configFluid.cfg | 200 ++++++++++++++++++ .../chtPinArray_2d/FD_configMaster.cfg | 183 ++++++++++++++++ .../chtPinArray_2d/FD_configSolid.cfg | 109 ++++++++++ .../chtPinArray_2d/configFluid.cfg | 4 +- .../chtPinArray_2d/configMaster.cfg | 2 +- .../chtPinArray_2d/configSolid.cfg | 4 +- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 + .../chtPinArray_3d/configFluid.cfg | 190 +++++++++++++++++ .../chtPinArray_3d/configMaster.cfg | 87 ++++++++ .../chtPinArray_3d/configSolid.cfg | 100 +++++++++ TestCases/streamwise_periodic_regression.py | 51 +++-- 14 files changed, 1370 insertions(+), 23 deletions(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg new file mode 100644 index 000000000000..f2c3765b3a2c --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg @@ -0,0 +1,199 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SST +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) +% +%OBJECTIVE_FUNCTION= DRAG +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +% +OBJECTIVE_WEIGHT= 0.0 +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= CONSTANT +INC_ENERGY_EQUATION = YES +% +% Serves as material parameter +INC_DENSITY_INIT= 1045.0 +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 338.0 +% +%INC_NONDIM= INITIAL_VALUES +INC_NONDIM= DIMENSIONAL +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Redundant to INC_DENSITY_MODEL +FLUID_MODEL= CONSTANT_DENSITY +SPECIFIC_HEAT_CP= 3540.0 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 11.7 +% +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +%KIND_STREAMWISE_PERIODIC= MASSFLOW +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +% +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. Was set to 210 before +%STREAMWISE_PERIODIC_PRESSURE_DROP= 210 +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +% +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.85 +% +INC_OUTLET_DAMPING= 0.001 + +STREAMWISE_PERIODIC_TEMPERATURE= NO + +% inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi +% with 5e5 W/m that is Q = 1884.96 +STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 +%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% +MARKER_SYM= ( fluid_symmetry ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% Test vals to hinder outlet backflow +%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING= ( fluid_pin2_interface ) +%MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) +MARKER_MONITORING= ( NONE ) +% +% Massflow averaged total pressure difference between in- and outlet is the target +%MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +%MARKER_ANALYZE_AVERAGE = MASSFLUX +MARKER_ANALYZE = ( fluid_pin2_interface ) +MARKER_ANALYZE_AVERAGE = AREA +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1e3 +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 10 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE +% +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +% +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +% +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +% +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.75 +% +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.75 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= NONE +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 18 +CONV_RESIDUAL_MINVAL= -26 +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= fluid.su2 +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +%GRAD_OBJFUNC_FILENAME= of_grad_fluid.csv +% +SOLUTION_ADJ_FILENAME= solution_adj +RESTART_ADJ_FILENAME= solution_adj +VOLUME_ADJ_FILENAME= adjoint +SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg new file mode 100644 index 000000000000..1d90c19d9249 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -0,0 +1,154 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: 2D cylinder array with CHT couplings % +% Author: O. Burghardt, T. Economon % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: August 8, 2019 % +% File Version 6.0.1 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= MULTIPHYSICS +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DISCRETE_ADJOINT +% +CONFIG_LIST = (DA_configFluid.cfg, DA_configSolid.cfg) +% +MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +TIME_DOMAIN = NO +% +SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1], BGS_ADJ_TEMPERATURE[0]) +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1] ) +% +CONV_RESIDUAL_MINVAL= -26 +% Number of total iterations +OUTER_ITER= 3000 +OUTPUT_WRT_FREQ= 1000 +SCREEN_WRT_FREQ_OUTER= 25 +% +%CHT_ROBIN= NO +% +OUTPUT_FILES= (RESTART, RESTART_ASCII, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY, SURFACE_PARAVIEW_ASCII) +% +% Mesh input file +MESH_FILENAME= 2D-PinArray_FFD.su2 +%SPECIFIC_HEAT_CP = 871.0 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +GRAD_OBJFUNC_FILENAME= of_grad.csv +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) + +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +%DV_KIND= FFD_SETTING +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +%DV_PARAM= ( 1.0 ) +%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +DV_PARAM= ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +%DV_VALUE= 1.0 +%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 10 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES + + +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +%DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg new file mode 100644 index 000000000000..f3d0d64ebac9 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg @@ -0,0 +1,108 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (solid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= HEAT_EQUATION +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +%HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) +%OBJECTIVE_FUNCTION= DRAG +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +% +OBJECTIVE_WEIGHT= 1.0 +% +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% +% +INC_NONDIM= DIMENSIONAL +SOLID_TEMPERATURE_INIT= 345.0 +SOLID_DENSITY= 2719 +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +SPECIFIC_HEAT_CP = 871.0 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM = 6.99091 +% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later +% used for the viscous res +SOLID_THERMAL_CONDUCTIVITY= 200 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_SYM= ( solid_sym_sides) +% +%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) +% +MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING = ( solid_pin2_interface ) +MARKER_MONITORING = ( solid_pin2_inner ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +% +CFL_NUMBER= 1e4 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) +BETA_FACTOR= 50 +MAX_DELTA_TIME= 1.0 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 20 +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 10 +CONV_RESIDUAL_MINVAL= -20 +CONV_STARTITER= 10000000000 +% +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_HEAT = SPACE_CENTERED +MUSCL_HEAT= YES +JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) +TIME_DISCRE_HEAT= EULER_IMPLICIT +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= solid.su2 +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +VOLUME_FILENAME= heat +SURFACE_FILENAME= surface_heat +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +%GRAD_OBJFUNC_FILENAME= of_grad_solid.csv + +SOLUTION_ADJ_FILENAME= solution_adj +RESTART_ADJ_FILENAME= solution_adj +VOLUME_ADJ_FILENAME= adjoint +SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg new file mode 100644 index 000000000000..3b98e90b29b4 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg @@ -0,0 +1,200 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SST +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) +% +%OBJECTIVE_FUNCTION= DRAG +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OPT_OBJECTIVE= NONE +% +OBJECTIVE_WEIGHT= 0.0 +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= CONSTANT +INC_ENERGY_EQUATION = YES +% +% Serves as material parameter +INC_DENSITY_INIT= 1045.0 +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 338.0 +% +%INC_NONDIM= INITIAL_VALUES +INC_NONDIM= DIMENSIONAL +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Redundant to INC_DENSITY_MODEL +FLUID_MODEL= CONSTANT_DENSITY +SPECIFIC_HEAT_CP= 3540.0 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 11.7 +% +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +%KIND_STREAMWISE_PERIODIC= MASSFLOW +KIND_STREAMWISE_PERIODIC= PRESSURE_DROP +% +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. Was set to 210 before +%STREAMWISE_PERIODIC_PRESSURE_DROP= 210 +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +% +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.85 +% +INC_OUTLET_DAMPING= 0.001 + +STREAMWISE_PERIODIC_TEMPERATURE= NO + +% inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi +% with 5e5 W/m that is Q = 1884.96 +STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 +%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% +MARKER_SYM= ( fluid_symmetry ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% Test vals to hinder outlet backflow +%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING= ( fluid_pin1_interface, fluid_pin2_interface, fluid_pin3_interface ) +%MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) +MARKER_MONITORING= ( NONE ) +% +% Massflow averaged total pressure difference between in- and outlet is the target +%MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +%MARKER_ANALYZE_AVERAGE = MASSFLUX +MARKER_ANALYZE = ( fluid_pin2_interface ) +MARKER_ANALYZE_AVERAGE = AREA +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1e3 +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 10 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE +% +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +% +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +% +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +% +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.75 +% +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.75 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= NONE +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 18 +CONV_RESIDUAL_MINVAL= -26 +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= fluid.su2 +MESH_FORMAT= SU2 +% +%SOLUTION_FILENAME= solution_flow +%RESTART_FILENAME= solution_flow +% +VOLUME_FILENAME= flow +%SURFACE_FILENAME= surface_flow +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +GRAD_OBJFUNC_FILENAME= of_grad_fluid.csv +% +SOLUTION_ADJ_FILENAME= solution_adj +RESTART_ADJ_FILENAME= solution_adj +VOLUME_ADJ_FILENAME= adjoint +SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg new file mode 100644 index 000000000000..c3492c3cd8c7 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -0,0 +1,183 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: 2D cylinder array with CHT couplings % +% Author: O. Burghardt, T. Economon % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: August 8, 2019 % +% File Version 6.0.1 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= MULTIPHYSICS +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +RESTART_SOL= NO +CONV_FILENAME= history + +% +CONFIG_LIST = (FD_configFluid.cfg, FD_configSolid.cfg) +% +MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) +% +TIME_DOMAIN = NO +% +SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], AERO_COEFF[0], HEAT[1] ) +% +CONV_RESIDUAL_MINVAL= -26 + +% Number of total iterations +%OUTER_ITER= 3000 +% +% FOR FAST RUNING REGRESSION TEST ONLY! +% FOR GADIENT VALIDATION USE OUTER_ITER ABOVE! +OUTER_ITER= 100 +% +OUTPUT_WRT_FREQ= 10000 +SCREEN_WRT_FREQ_OUTER= 100 + +RESTART_FILENAME= solution_master +% +%CHT_ROBIN= NO +% +OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) +% +% Mesh input file +MESH_FILENAME= 2D-PinArray_FFD.su2 +%SPECIFIC_HEAT_CP = 871.0 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +%GRAD_OBJFUNC_FILENAME= of_grad.csv + +MARKER_MONITORING= ( NONE ) +SOLUTION_FILENAME= solution_flow +SOLUTION_ADJ_FILENAME= solution_adj_flow +TABULAR_FORMAT=CSV + +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) + +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (8, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= NO_DERIVATIVE +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, +% FFD_SETTING, FFD_NACELLE, +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) +DV_KIND= FFD_SETTING +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +DV_PARAM= ( 1.0 ) +%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +% +% Value of the shape deformation +DV_VALUE= 1.0 +%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 1E6 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 +% +% Visualize the surface deformation (NO, YES) +VISUALIZE_SURFACE_DEF= YES +% +% Visualize the volume deformation (NO, YES) +VISUALIZE_VOLUME_DEF= YES + + +% Available design variables +% 2D Design variables +% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) +% +% FFD_CONTROL_POINT (X) +%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) + +% FFD_CONTROL_POINT (Y) +% For gradient validation uncomment the other DV's! +DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ +% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) + +%DEFORM_MESH= YES + +OPT_OBJECTIVE= AVG_TOTALTEMP +FIN_DIFF_STEP= 0.000001 +NZONES=2 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg new file mode 100644 index 000000000000..760d6e72b16b --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg @@ -0,0 +1,109 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (solid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= HEAT_EQUATION +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +%HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) +%OBJECTIVE_FUNCTION= DRAG +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OPT_OBJECTIVE= AVG_TOTALTEMP +% +OBJECTIVE_WEIGHT= 1.0 +% +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% +% +INC_NONDIM= DIMENSIONAL +SOLID_TEMPERATURE_INIT= 345.0 +SOLID_DENSITY= 2719 +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +SPECIFIC_HEAT_CP = 871.0 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM = 6.99091 +% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later +% used for the viscous res +SOLID_THERMAL_CONDUCTIVITY= 200 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_SYM= ( solid_sym_sides) +% +%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) +% +MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING = ( solid_pin1_interface, solid_pin2_interface, solid_pin3_interface ) +MARKER_MONITORING = ( solid_pin2_inner ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +% +CFL_NUMBER= 1e4 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) +BETA_FACTOR= 50 +MAX_DELTA_TIME= 1.0 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 20 +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 10 +CONV_RESIDUAL_MINVAL= -20 +CONV_STARTITER= 10000000000 +% +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_HEAT = SPACE_CENTERED +MUSCL_HEAT= YES +JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) +TIME_DISCRE_HEAT= EULER_IMPLICIT +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= solid.su2 +MESH_FORMAT= SU2 +% +%SOLUTION_FILENAME= solution_heat +%RESTART_FILENAME= solution_heat +% +VOLUME_FILENAME= heat +SURFACE_FILENAME= surface_heat +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +GRAD_OBJFUNC_FILENAME= of_grad_solid.csv + +SOLUTION_ADJ_FILENAME= solution_adj +RESTART_ADJ_FILENAME= solution_adj +VOLUME_ADJ_FILENAME= adjoint +SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index 1b386c9aa3be..e2e290634671 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -245,8 +245,8 @@ CONV_STARTITER= 100000000 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow +SOLUTION_FILENAME= solution +RESTART_FILENAME= solution % % Output tabular file format (TECPLOT, CSV) TABULAR_FORMAT= CSV diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 7ad2e1573b9a..638c8b4e420d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -43,7 +43,7 @@ SCREEN_WRT_FREQ_OUTER= 25 OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) % % Mesh input file -MESH_FILENAME= 2D-PinArray.su2 +MESH_FILENAME= 2D-PinArray_FFD.su2 % %SPECIFIC_HEAT_CP = 871.0 % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 22cffa0c6b0c..81f025cd5e25 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -125,8 +125,8 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT % MESH_FORMAT= SU2 % -SOLUTION_FILENAME= solution_heat -RESTART_FILENAME= solution_heat +SOLUTION_FILENAME= solution +RESTART_FILENAME= solution % VOLUME_FILENAME= heat SURFACE_FILENAME= surface_heat diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref new file mode 100644 index 000000000000..ec22f0db06dc --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -0,0 +1,2 @@ +"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" +0 , 0.0 , 3388000.0000353903, 0.0 , 0.0 , 3388000.0000353903, 1423.2000000049538, 957.2000000162006, 1423.2000000049538, 957.2000000162006, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 962.8000000247994 , 0.0 , -478.7999999962267, 1e-06 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg new file mode 100644 index 000000000000..9c7c5d70e4fc --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -0,0 +1,190 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (fluid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SST +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF ) +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= CONSTANT +INC_ENERGY_EQUATION = YES +% +% Serves as material parameter +INC_DENSITY_INIT= 1045.0 +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 338.0 +% +%INC_NONDIM= INITIAL_VALUES +INC_NONDIM= DIMENSIONAL +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Redundant to INC_DENSITY_MODEL +FLUID_MODEL= CONSTANT_DENSITY +SPECIFIC_HEAT_CP= 3540.0 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 11.7 +% +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90 +% +% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% +% +% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) +KIND_STREAMWISE_PERIODIC= MASSFLOW +% +% Delta P value that drives the flow as a source term in the momentum equations. +% Defaults to 1.0. Was set to 380 before +STREAMWISE_PERIODIC_PRESSURE_DROP= 210 +% +% Target massflow. Necessary pressure drop is determined iteratively. +% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. +% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. +STREAMWISE_PERIODIC_MASSFLOW= 0.009675 +% +INC_OUTLET_DAMPING= 0.001 + +STREAMWISE_PERIODIC_TEMPERATURE= NO +STREAMWISE_PERIODIC_OUTLET_HEAT= -17.958584 +%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +%MARKER_HEATFLUX= ( fluid_top, 0.0 ) +MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_bottom_interface, 0.0, fluid_pin1, 0.0, fluid_pin3, 0.0 ) +% +MARKER_SYM= ( fluid_sym_sides ) +% +% Periodic boundary marker(s) (NONE = no marker) +% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, +% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, +% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) +MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) +% +% Alternative to periodic simulation +%INC_INLET_TYPE= VELOCITY_INLET +%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% Test vals to hinder outlet backflow +%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) +% +%INC_OUTLET_TYPE= PRESSURE_OUTLET +%MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING= ( fluid_bottom_interface, fluid_pin1, fluid_pin2, fluid_pin3 ) +MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) +% +% Massflow averaged total pressure difference between in- and outlet is the target +MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 10 +CFL_ADAPT= NO +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 15 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE +% +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +% +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +% +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +% +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.75 +% +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.75 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +%CONV_NUM_METHOD_FLOW= JST +%JST_SENSOR_COEFF= ( 0.5, 0.05 ) +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= NONE +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 18 +CONV_RESIDUAL_MINVAL= -26 +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= /home/kat7rng/scratch/2__Streamwise-Periodic/5__UnitCell4Print/1__Mesh/1__Res1/UnitCellPins.su2 +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow +% +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +GRAD_OBJFUNC_FILENAME= of_grad +% +SOLUTION_ADJ_FILENAME= solution_adj +RESTART_ADJ_FILENAME= restart_adj +VOLUME_ADJ_FILENAME= adjoint +SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg new file mode 100644 index 000000000000..42fefe230a9d --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -0,0 +1,87 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: 2D cylinder array with CHT couplings % +% Author: O. Burghardt, T. Economon % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: August 8, 2019 % +% File Version 6.0.1 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= MULTIPHYSICS +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +CONFIG_LIST = (configFluid.cfg, configSolid.cfg) +% +MARKER_ZONE_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin1, solid_pin1, fluid_pin2, solid_pin2, fluid_pin3, solid_pin3 ) +%MARKER_ZONE_INTERFACE= (fluid_pin2, solid_pin2 ) +% +MARKER_CHT_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin1, solid_pin1, fluid_pin2, solid_pin2, fluid_pin3, solid_pin3 ) +%MARKER_CHT_INTERFACE= (fluid_pin2, solid_pin2 ) +% +TIME_DOMAIN = NO +% +SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], PRESSURE_DROP[0], AVG_TEMPERATURE[1] ) +SCREEN_WRT_FREQ_OUTER= 100 +% +CONV_RESIDUAL_MINVAL= -26 +% Number of total iterations +OUTER_ITER = 300000 +OUTPUT_WRT_FREQ= 2500 +% +%CHT_ROBIN= NO +% +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) +% +% Mesh input file +MESH_FILENAME= 3D_chtPinArray_coarse.su2 +%SPECIFIC_HEAT_CP = 871.0 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 + +% These are just default parameters so that we can run SU2_DOT_AD, they have no physical meaning for this test case. + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, +% FFD_SETTING, FFD_NACELLE +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, +% HICKS_HENNE, SURFACE_BUMP) +DV_KIND= HICKS_HENNE +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= (fluid_pin2, solid_pin2) +% +% Parameters of the shape deformation +% - NO_DEFORMATION ( 1.0 ) +% - TRANSLATION ( x_Disp, y_Disp, z_Disp ), as a unit vector +% - ROTATION ( x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) +% - SCALE ( 1.0 ) +% - ANGLE_OF_ATTACK ( 1.0 ) +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_NACELLE ( FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Disp, phi_Disp ) +% - FFD_GULL ( FFD_BoxTag, j_Ind ) +% - FFD_ANGLE_OF_ATTACK ( FFD_BoxTag, 1.0 ) +% - FFD_CAMBER ( FFD_BoxTag, i_Ind, j_Ind ) +% - FFD_THICKNESS ( FFD_BoxTag, i_Ind, j_Ind ) +% - FFD_TWIST ( FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) +% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) +% - FFD_CAMBER_2D ( FFD_BoxTag, i_Ind ) +% - FFD_THICKNESS_2D ( FFD_BoxTag, i_Ind ) +% - FFD_TWIST_2D ( FFD_BoxTag, x_Orig, y_Orig ) +% - HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc ) +% - SURFACE_BUMP ( x_Start, x_End, x_Loc ) +DV_PARAM= (0.0, 0.5) +% +% Value of the shape deformation +DV_VALUE= 0.1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg new file mode 100644 index 000000000000..c6fc641ab4e2 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -0,0 +1,100 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unit Cell flow around pin array (solid) +% Author: T. Kattmann +% Institution: Robert Bosch GmbH +% Date: 07.06.2019 +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= HEAT_EQUATION +RESTART_SOL= NO +READ_BINARY_RESTART= YES +% +HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) +% +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% +% +INC_NONDIM= DIMENSIONAL +SOLID_TEMPERATURE_INIT= 345.0 +SOLID_DENSITY= 2719 +% +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +SPECIFIC_HEAT_CP = 871.0 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM = 6.99091 +% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later +% used for the viscous res +SOLID_THERMAL_CONDUCTIVITY= 200 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_SYM= ( solid_sym_sides) +% +%MARKER_ISOTHERMAL= ( solid_bottom_heater, 300 ) +% +%MARKER_HEATFLUX= ( solid_bottom_heater, 5e5, solid_block_inlet, 0.0, solid_block_outlet, 0.0, solid_pin1_inlet, 0.0, solid_pin3_outlet, 0.0, solid_pins_top, 0.0 ) +MARKER_HEATFLUX= ( solid_bottom_heater, 5e5, solid_block_inlet, 0.0, solid_block_outlet, 0.0, solid_pin1_inlet, 0.0, solid_pin3_outlet, 0.0, solid_pins_top, 0.0, solid_bottom_interface, 0.0, solid_pin1, 0.0, solid_pin3, 0.0 ) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING = (solid_bottom_interface, solid_pin1, solid_pin2, solid_pin3, solid_pins_top) +MARKER_MONITORING = ( solid_bottom_heater ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +% +CFL_NUMBER= 1000 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) +BETA_FACTOR= 50 +MAX_DELTA_TIME= 1.0 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-18 +LINEAR_SOLVER_ITER= 15 +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +%RESIDUAL_REDUCTION= 10 +CONV_RESIDUAL_MINVAL= -20 +CONV_STARTITER= 10000000000 +% +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_HEAT = SPACE_CENTERED +MUSCL_HEAT= YES +JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) +TIME_DISCRE_HEAT= EULER_IMPLICIT +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +%MESH_FILENAME= /home/kat7rng/scratch/2__Streamwise-Periodic/5__UnitCell4Print/1__Mesh/1__Res1/UnitCellPins.su2 +MESH_FORMAT= SU2 +% +SOLUTION_FILENAME= solution_heat +RESTART_FILENAME= solution_heat +% +VOLUME_FILENAME= heat +SURFACE_FILENAME= surface_heat +WRT_CON_FREQ= 1 +WRT_RESIDUALS= YES +WRT_LIMITERS= YES +% +CONV_FILENAME= history +BREAKDOWN_FILENAME= forces_breakdown +VALUE_OBJFUNC_FILENAME= of_eval +GRAD_OBJFUNC_FILENAME= of_grad diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index e423be7d4db5..65b8bdcd239c 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -111,27 +111,42 @@ def main(): ## Streamwise Periodic adjoint ### ################################## + unsteady_naca0012 = TestCase('unsteady_NACA0012_restart_adjoint') + unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" + unsteady_naca0012.cfg_file = "naca0012.cfg" + unsteady_naca0012.test_iter = 14 + unsteady_naca0012.su2_exec = "discrete_adjoint.py -f" + unsteady_naca0012.timeout = 1600 + unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" + unsteady_naca0012.test_file = "of_grad_cd.csv" + unsteady_naca0012.unsteady = True + pass_list.append(unsteady_naca0012.run_filediff()) + test_list.append(unsteady_naca0012) + # 2D DA case single zone pressure drop - sp_da_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') - sp_da_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_pinArray_2d_dp_hf_tp" - sp_da_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" - sp_da_pinArray_2d_dp_hf_tp.test_iter = 10 - sp_da_pinArray_2d_dp_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines - sp_da_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" - sp_da_pinArray_2d_dp_hf_tp.timeout = 1600 - sp_da_pinArray_2d_dp_hf_tp.tol = 0.00001 - test_list.append(sp_pinArray_2d_dp_hf_tp) + da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') + da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" + da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.742760, -4.002109, -3.800011, -4.002109] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" + da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 + da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 + da_sp_pinArray_cht_2d_dp_hf.multizone = True + test_list.append(da_sp_pinArray_cht_2d_dp_hf) # 2D DA case cht pressure drop, heat obj function - sp_da_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') - sp_da_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" - sp_da_pinArray_cht_2d_mf_hf.cfg_file = "sp_pinArray_cht_2d_mf_hf.cfg" - sp_da_pinArray_cht_2d_mf_hf.test_iter = 10 - sp_da_pinArray_cht_2d_mf_hf.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines - sp_da_pinArray_cht_2d_mf_hf.su2_exec = "parallel_computation.py -f" - sp_da_pinArray_cht_2d_mf_hf.timeout = 1600 - sp_da_pinArray_cht_2d_mf_hf.tol = 0.00001 - test_list.append(sp_pinArray_cht_2d_mf_hf) + fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') + fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" + fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" + fd_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + fd_sp_pinArray_cht_2d_dp_hf.su2_exec = "finite_differences.py -z 2 -n 2 -f" + fd_sp_pinArray_cht_2d_dp_hf.timeout = 1600 + fd_sp_pinArray_cht_2d_dp_hf.reference_file = "of_grad_findiff.csv.ref" + fd_sp_pinArray_cht_2d_dp_hf.test_file = "FINDIFF/of_grad_findiff.csv" + fd_sp_pinArray_cht_2d_dp_hf.multizone = True + pass_list.append(fd_sp_pinArray_cht_2d_dp_hf.run_filediff()) + test_list.append(fd_sp_pinArray_cht_2d_dp_hf) pass_list = [ test.run_test() for test in test_list ] From b9c866598c29e60a62d2458bbd491b8f91a46fb9 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 4 Aug 2020 16:12:14 +0200 Subject: [PATCH 081/326] Little fix for regression file. --- TestCases/streamwise_periodic_regression.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 65b8bdcd239c..b1450a4a5123 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -111,18 +111,6 @@ def main(): ## Streamwise Periodic adjoint ### ################################## - unsteady_naca0012 = TestCase('unsteady_NACA0012_restart_adjoint') - unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" - unsteady_naca0012.cfg_file = "naca0012.cfg" - unsteady_naca0012.test_iter = 14 - unsteady_naca0012.su2_exec = "discrete_adjoint.py -f" - unsteady_naca0012.timeout = 1600 - unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" - unsteady_naca0012.test_file = "of_grad_cd.csv" - unsteady_naca0012.unsteady = True - pass_list.append(unsteady_naca0012.run_filediff()) - test_list.append(unsteady_naca0012) - # 2D DA case single zone pressure drop da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" @@ -134,6 +122,12 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 da_sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(da_sp_pinArray_cht_2d_dp_hf) + + ###################################### + ### RUN TESTS ### + ###################################### + + pass_list = [ test.run_test() for test in test_list ] # 2D DA case cht pressure drop, heat obj function fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') @@ -148,8 +142,6 @@ def main(): pass_list.append(fd_sp_pinArray_cht_2d_dp_hf.run_filediff()) test_list.append(fd_sp_pinArray_cht_2d_dp_hf) - pass_list = [ test.run_test() for test in test_list ] - # Tests summary print('==================================================================') print('Summary of the serial tests') From 64868f993554793232517d6fea42d3ca8ea1c7bf Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 4 Aug 2020 18:03:48 +0200 Subject: [PATCH 082/326] Fix little mistake in streamwise regression test. --- TestCases/streamwise_periodic_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index b1450a4a5123..2477e0c9ee9d 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -131,7 +131,7 @@ def main(): # 2D DA case cht pressure drop, heat obj function fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') - fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_cht_2d_mf_hf" + fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" fd_sp_pinArray_cht_2d_dp_hf.test_iter = 100 fd_sp_pinArray_cht_2d_dp_hf.su2_exec = "finite_differences.py -z 2 -n 2 -f" From bdfa4639b92cdb135a252118e175ae43e2699f86 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 4 Aug 2020 19:39:56 +0200 Subject: [PATCH 083/326] Little changes for streamwise regression tests. --- .../chtPinArray_3d/configMaster.cfg | 2 +- TestCases/streamwise_periodic_regression.py | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index 42fefe230a9d..01ee550c6bca 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -38,7 +38,7 @@ OUTPUT_WRT_FREQ= 2500 % %CHT_ROBIN= NO % -OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) +OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) % % Mesh input file MESH_FILENAME= 3D_chtPinArray_coarse.su2 diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 2477e0c9ee9d..6ecca675bf6f 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -6,8 +6,8 @@ # \version 7.0.4 "Blackbird" # # SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation +# +# The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) @@ -16,7 +16,7 @@ # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. -# +# # SU2 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -30,12 +30,12 @@ from TestCase import TestCase 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 + '''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 to make sure nothing is broken. ''' test_list = [] - + ################################# ## Streamwise Periodic primal ### ################################# @@ -62,7 +62,7 @@ def main(): sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pipeSlice_3d_dp_hf_tp) - # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity + # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" @@ -84,18 +84,7 @@ def main(): sp_pinArray_2d_mf_hf.tol = 0.00001 test_list.append(sp_pinArray_2d_mf_hf) - # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) - sp_pinArray_3d_mf_hf_tp = TestCase('sp_pinArray_3d_mf_hf_tp') - sp_pinArray_3d_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/sp_pinArray_3d_mf_hf_tp" - sp_pinArray_3d_mf_hf_tp.cfg_file = "sp_pinArray_3d_mf_hf_tp.cfg" - sp_pinArray_3d_mf_hf_tp.test_iter = 10 - sp_pinArray_3d_mf_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines - sp_pinArray_3d_mf_hf_tp.su2_exec = "parallel_computation.py -f" - sp_pinArray_3d_mf_hf_tp.timeout = 1600 - sp_pinArray_3d_mf_hf_tp.tol = 0.00001 - #test_list.append(sp_pinArray_3d_mf_hf_tp) - - # create 2D CHT case with HF BC and + # create 2D CHT case with HF BC and sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" @@ -107,6 +96,17 @@ def main(): sp_pinArray_cht_2d_mf_hf.multizone = True test_list.append(sp_pinArray_cht_2d_mf_hf) + # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) + sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') + sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" + sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" + sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 + sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 + test_list.append(sp_pinArray_3d_cht_mf_hf_tp) + ################################## ## Streamwise Periodic adjoint ### ################################## @@ -128,7 +128,7 @@ def main(): ###################################### pass_list = [ test.run_test() for test in test_list ] - + # 2D DA case cht pressure drop, heat obj function fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" @@ -151,7 +151,7 @@ def main(): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) - + if all(pass_list): sys.exit(0) else: From 89240c493338bdb4560f8daac040887b9c9d450c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 5 Aug 2020 10:08:05 +0200 Subject: [PATCH 084/326] Changed ref file for streamwise reg tests. --- .../chtPinArray_2d/of_grad_findiff.csv.ref | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index ec22f0db06dc..0e94ba2f5097 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ -"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3388000.0000353903, 0.0 , 0.0 , 3388000.0000353903, 1423.2000000049538, 957.2000000162006, 1423.2000000049538, 957.2000000162006, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 962.8000000247994 , 0.0 , -478.7999999962267, 1e-06 +"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX[1]" , "HEATFLUX_MAX[1]", "FINDIFF_STEP" +0 , 0.0 , 3393999.99985 , 0.0 , 0.0 , 3393999.99985 , 1181.0 , 958.59999999 , 1181.0 , 958.59999999 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 960.799999973 , -549.999999976 , 0.0 , 1e-06 From 52737d20b93ee3791b71ab680829a8d695021623 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 5 Aug 2020 13:08:19 +0200 Subject: [PATCH 085/326] Update to streamwise reg tests. --- .../streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg | 2 +- .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index c3492c3cd8c7..478e40c202f0 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -39,7 +39,7 @@ CONV_RESIDUAL_MINVAL= -26 % % FOR FAST RUNING REGRESSION TEST ONLY! % FOR GADIENT VALIDATION USE OUTER_ITER ABOVE! -OUTER_ITER= 100 +OUTER_ITER= 101 % OUTPUT_WRT_FREQ= 10000 SCREEN_WRT_FREQ_OUTER= 100 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index ec22f0db06dc..39ae9f531d01 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3388000.0000353903, 0.0 , 0.0 , 3388000.0000353903, 1423.2000000049538, 957.2000000162006, 1423.2000000049538, 957.2000000162006, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 962.8000000247994 , 0.0 , -478.7999999962267, 1e-06 +0 , 0.0 , 3393999.9998547137, 0.0 , 0.0 , 3393999.9998547137, 1181.0000000025411, 958.5999999899286, 1181.0000000025411, 958.5999999899286, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 960.7999999730055 , 0.0 , -549.9999999756255, 1e-06 From d9803ffa87b7afe08ecb4504e600804b7e51c9de Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 5 Aug 2020 15:25:09 +0200 Subject: [PATCH 086/326] 3D streamwise pin case: reg test values set. --- .../streamwise_periodic/chtPinArray_3d/configMaster.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index 01ee550c6bca..854c4fa76c53 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -28,12 +28,12 @@ MARKER_CHT_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin % TIME_DOMAIN = NO % -SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], PRESSURE_DROP[0], AVG_TEMPERATURE[1] ) +SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], PRESSURE_DROP[0], AVG_TEMPERATURE[1] ) SCREEN_WRT_FREQ_OUTER= 100 % CONV_RESIDUAL_MINVAL= -26 % Number of total iterations -OUTER_ITER = 300000 +OUTER_ITER = 15000 OUTPUT_WRT_FREQ= 2500 % %CHT_ROBIN= NO From ea101ae32eabbe589e3c4ed062ea3eb44989217b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 5 Aug 2020 15:44:49 +0200 Subject: [PATCH 087/326] Update streamwise reg test. --- TestCases/streamwise_periodic_regression.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 6ecca675bf6f..20e97168b161 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -62,7 +62,7 @@ def main(): sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pipeSlice_3d_dp_hf_tp) - # create 2D pin case pressure drop periodic with heatflux BC and temperature periodicity + # 2D pin case pressure drop periodic with heatflux BC and temperature periodicity sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" @@ -73,7 +73,7 @@ def main(): sp_pinArray_2d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pinArray_2d_dp_hf_tp) - # create 2D pin case massflow periodic with heatflux BC and prescribed heat + # 2D pin case massflow periodic with heatflux BC and prescribed heat sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" @@ -84,7 +84,7 @@ def main(): sp_pinArray_2d_mf_hf.tol = 0.00001 test_list.append(sp_pinArray_2d_mf_hf) - # create 2D CHT case with HF BC and + # 2D CHT case with HF BC and sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" @@ -96,15 +96,16 @@ def main(): sp_pinArray_cht_2d_mf_hf.multizone = True test_list.append(sp_pinArray_cht_2d_mf_hf) - # create simple small 3D pin case massflow periodic with heatflux BC and temperature periodicity (without turbulence model for now) + # simple small 3D pin case massflow periodic with heatflux BC sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [10, -10.352122, -10.185237, -10.185237] #last 4 lines + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462680, -0.008477, 214.707868, 4.2935e+02, 3.6831e+02] #last 7 lines sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "parallel_computation.py -f" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 + sp_pinArray_3d_cht_mf_hf_tp.multizone = True test_list.append(sp_pinArray_3d_cht_mf_hf_tp) ################################## From c7541824ff8aa63a66c79a542a14413e35c73db4 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 5 Aug 2020 15:58:00 +0200 Subject: [PATCH 088/326] Yet another change in streamwise reg tests. --- TestCases/streamwise_periodic_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 20e97168b161..14198341672d 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -102,7 +102,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462680, -0.008477, 214.707868, 4.2935e+02, 3.6831e+02] #last 7 lines - sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 sp_pinArray_3d_cht_mf_hf_tp.multizone = True From 2912ae3f78911d6cb2bdf53d689f40b2c2cf4b51 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 6 Aug 2020 16:47:27 +0200 Subject: [PATCH 089/326] Changed reg test for streamwise periodicity. --- TestCases/streamwise_periodic_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 20e97168b161..14198341672d 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -102,7 +102,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462680, -0.008477, 214.707868, 4.2935e+02, 3.6831e+02] #last 7 lines - sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 sp_pinArray_3d_cht_mf_hf_tp.multizone = True From 839913170a8421cbd599a32d5afc6f8b6cc1fe8c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 11 Aug 2020 23:00:49 +0200 Subject: [PATCH 090/326] Adapted reg test values after PR1059 --- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- TestCases/streamwise_periodic_regression.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 39ae9f531d01..1dc6bc1ef95e 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3393999.9998547137, 0.0 , 0.0 , 3393999.9998547137, 1181.0000000025411, 958.5999999899286, 1181.0000000025411, 958.5999999899286, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 960.7999999730055 , 0.0 , -549.9999999756255, 1e-06 +0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 \ No newline at end of file diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 14198341672d..97da55d0f279 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -45,7 +45,7 @@ def main(): streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" streamwise_periodic_cylinder.test_iter = 30 - streamwise_periodic_cylinder.test_vals = [30, -7.841567, -6.794739, -6.997455] #last 4 lines + streamwise_periodic_cylinder.test_vals = [30, -7.818388, -6.797497, -6.968131] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 @@ -67,7 +67,7 @@ def main(): sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 25 - sp_pinArray_2d_dp_hf_tp.test_vals = [-4.669154, 1.393699, -0.709036, 208.023676] #last 4 lines + sp_pinArray_2d_dp_hf_tp.test_vals = [-4.667133, 1.395801, -0.709306, 208.023676] #last 4 lines sp_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_dp_hf_tp.timeout = 1600 sp_pinArray_2d_dp_hf_tp.tol = 0.00001 @@ -78,7 +78,7 @@ def main(): sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 25 - sp_pinArray_2d_mf_hf.test_vals = [-4.668313, 1.396042, -0.709802, 208.677970] #last 4 lines + sp_pinArray_2d_mf_hf.test_vals = [-4.666406, 1.398210, -0.710070, 208.677550] #last 4 lines sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" sp_pinArray_2d_mf_hf.timeout = 1600 sp_pinArray_2d_mf_hf.tol = 0.00001 @@ -89,7 +89,7 @@ def main(): sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [0.251797, -0.749091, -1.044246, -0.754061, 208.023676, 3.5440e+02] #last 7 lines + sp_pinArray_cht_2d_mf_hf.test_vals = [0.249545, -0.751311, -1.039004, -0.753314, 208.023676, 354.460000] #last 7 lines sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 @@ -101,7 +101,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462680, -0.008477, 214.707868, 4.2935e+02, 3.6831e+02] #last 7 lines + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462699, -0.008477, 214.707868, 429.350000, 368.310000] #last 7 lines sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.742760, -4.002109, -3.800011, -4.002109] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.743093, -4.001999, -3.800034, -4.001999] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From 1964098b43762591c862a7b8dbd00a18e659733f Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Wed, 12 Aug 2020 09:44:17 +0200 Subject: [PATCH 091/326] Update of_grad_findiff.csv.ref --- .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 1dc6bc1ef95e..5acc196f7d9e 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 \ No newline at end of file +0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 From 52a2d18d6ae9b4dda2cbf881ea15fc7ac0f43d77 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 12 Aug 2020 15:01:37 +0200 Subject: [PATCH 092/326] Change reg test ref file after PR1059 --- .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 5acc196f7d9e..35651ae65052 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 +0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 From ecab07e360f1d660208d66449c4604c6d51801f0 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 5 Oct 2020 13:09:44 +0200 Subject: [PATCH 093/326] Some cleanup wrt to nondimensionalization --- SU2_CFD/include/numerics/flow/flow_sources.hpp | 4 +++- SU2_CFD/src/numerics/flow/flow_sources.cpp | 13 +++++++------ SU2_CFD/src/output/CFlowIncOutput.cpp | 6 ++---- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 +--- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index d20a1dba0848..fe0a007def6c 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -198,6 +198,8 @@ class CSourceBoussinesq final : public CSourceBase_Flow { * \author F. Palacios */ class CSourceGravity final : public CSourceBase_Flow { + su2double Force_Ref; + public: /*! * \param[in] val_nDim - Number of dimensions of the problem. @@ -310,7 +312,7 @@ class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { vector Streamwise_Coord_Vector; /*!< \brief Translation vector between streamwise periodic surfaces. */ su2double norm2_translation, /*!< \brief Square of distance between the 2 periodic surfaces. */ - integrated_heatflow, /*!< \brief Total heat added intto the domain via heatflux marker. */ + integrated_heatflow, /*!< \brief Total heat added into the domain via heatflux marker. */ massflow, /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ delta_p, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ dot_product, /*!< \brief Container for various dot-products. */ diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index e64889bc68b4..da2c71a4193a 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -313,7 +313,6 @@ CNumerics::ResidualType<> CSourceIncBodyForce::ComputeResidual(const CConfig* co /*--- Momentum contribution. Note that this form assumes we have subtracted the operating density * gravity, i.e., removed the hydrostatic pressure component (important for pressure BCs). ---*/ - for (iDim = 0; iDim < nDim; iDim++) residual[iDim+1] = -Volume * (DensityInc_i - DensityInc_0) * Body_Force_Vector[iDim] / Force_Ref; @@ -364,7 +363,9 @@ CNumerics::ResidualType<> CSourceBoussinesq::ComputeResidual(const CConfig* conf } CSourceGravity::CSourceGravity(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : - CSourceBase_Flow(val_nDim, val_nVar, config) { } + CSourceBase_Flow(val_nDim, val_nVar, config) { + Force_Ref = config->GetForce_Ref(); + } CNumerics::ResidualType<> CSourceGravity::ComputeResidual(const CConfig* config) { @@ -374,7 +375,7 @@ CNumerics::ResidualType<> CSourceGravity::ComputeResidual(const CConfig* config) residual[iVar] = 0.0; /*--- Evaluate the source term ---*/ - residual[nDim] = Volume * U_i[0] * STANDARD_GRAVITY; + residual[nDim] = Volume * U_i[0] * STANDARD_GRAVITY / Force_Ref; return ResidualType<>(residual, jacobian, nullptr); } @@ -587,7 +588,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { - delta_p = config->GetStreamwise_Periodic_PressureDrop(); + delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); massflow = config->GetStreamwise_Periodic_MassFlow(); integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); @@ -596,7 +597,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ for (iDim = 0; iDim < nDim; iDim++) { - scalar_factor = (delta_p/config->GetPressure_Ref()) / norm2_translation * Streamwise_Coord_Vector[iDim]; // TK check if pres_ref is the same as force ref + scalar_factor = delta_p / norm2_translation * Streamwise_Coord_Vector[iDim]; residual[iDim+1] = -Volume * scalar_factor; } @@ -636,7 +637,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C CSourceIncStreamwisePeriodic_Outlet::CSourceIncStreamwisePeriodic_Outlet(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : - CSourceBase_Flow(val_nDim, val_nVar, config) { } + CSourceBase_Flow(val_nDim, val_nVar, config) { } CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(const CConfig *config) { diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 0342b2f66347..9ddb0585fc4f 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -531,11 +531,9 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(iPoint, 2)); if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(iPoint, 3)); - if (heat) { + + if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); - if (streamwisePeriodic && streamwisePeriodic_temperature) - SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); - } if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); switch(config->GetKind_Turb_Model()){ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index f4be1ed156d2..c523857c8e29 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1480,9 +1480,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Loop over all points ---*/ for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - /*--- Load the conservative variables ---*/ - numerics->SetConservative(nodes->GetSolution(iPoint), - NULL); + /*--- Load the primitve variables ---*/ numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL); From 20c065c56dbcf03114119215c4e01e715fa95640 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Oct 2020 13:58:13 +0200 Subject: [PATCH 094/326] Update streamwise periodic reg test values. PR#1022 SIMD introduced some minor difference in my(!) cht reg tests. 8184779..4b9f2a8x contains #1022 & #1080 (only 5 lines). The change is in solid only and only affects the 2D case. Not the 3D. I dont know what specifically introduced the changes, but as they are small I for now assume that it is just a little numeric change. --- .../chtPinArray_2d/of_grad_findiff.csv.ref | 4 ++-- TestCases/streamwise_periodic_regression.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 35651ae65052..d16787cdac86 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ -"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3750000.0 , 0.0 , 0.0 , 3750000.0 , 1189.100000004828, 1059.199999986049, 1189.100000004828, 1059.199999986049, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1061.3000000034845, 0.0 , -508.4000000579181, 1e-06 +"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX[1]" , "HEATFLUX_MAX[1]", "FINDIFF_STEP" +0 , 0.0 , 3941000.00011 , 0.0 , 0.0 , 3941000.00011 , 1183.20000001 , 1113.39999995 , 1183.20000001 , 1113.39999995 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1117.4 , -438.899999949 , 0.0 , 1e-06 diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 97da55d0f279..de782f79756b 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -89,7 +89,7 @@ def main(): sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [0.249545, -0.751311, -1.039004, -0.753314, 208.023676, 354.460000] #last 7 lines + sp_pinArray_cht_2d_mf_hf.test_vals = [0.250241, -0.743036, -1.049060, -0.753332, 208.023676, 355.360000] #last 7 lines sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.743093, -4.001999, -3.800034, -4.001999] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.709021, -3.993726, -3.804347, -3.993726] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From a2b43f7bca45601b0d6c8a66ee49b55ee987cb07 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Oct 2020 16:41:09 +0200 Subject: [PATCH 095/326] Adapting reg test values for streamwise periodic flow. --- .../streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg | 4 ++-- .../streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg | 4 ++-- .../streamwise_periodic/chtPinArray_2d/configFluid.cfg | 2 +- .../streamwise_periodic/chtPinArray_2d/configSolid.cfg | 2 +- .../chtPinArray_2d/of_grad_findiff.csv.ref | 4 ++-- TestCases/streamwise_periodic_regression.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg index 3b98e90b29b4..5515fc372cd8 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg @@ -180,8 +180,8 @@ CONV_STARTITER= 100000000 %MESH_FILENAME= fluid.su2 MESH_FORMAT= SU2 % -%SOLUTION_FILENAME= solution_flow -%RESTART_FILENAME= solution_flow +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow % VOLUME_FILENAME= flow %SURFACE_FILENAME= surface_flow diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg index 760d6e72b16b..ddcb7c68e2d1 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg @@ -89,8 +89,8 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT %MESH_FILENAME= solid.su2 MESH_FORMAT= SU2 % -%SOLUTION_FILENAME= solution_heat -%RESTART_FILENAME= solution_heat +SOLUTION_FILENAME= solution_flow +RESTART_FILENAME= solution_flow % VOLUME_FILENAME= heat SURFACE_FILENAME= surface_heat diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index e2e290634671..1742ec7afca1 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -245,7 +245,7 @@ CONV_STARTITER= 100000000 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % -SOLUTION_FILENAME= solution +SOLUTION_FILENAME= solution_flow RESTART_FILENAME= solution % % Output tabular file format (TECPLOT, CSV) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 81f025cd5e25..dedc2fa51458 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -125,7 +125,7 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT % MESH_FORMAT= SU2 % -SOLUTION_FILENAME= solution +SOLUTION_FILENAME= solution_flow RESTART_FILENAME= solution % VOLUME_FILENAME= heat diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index d16787cdac86..3f6222e6eb26 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ -"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX[1]" , "HEATFLUX_MAX[1]", "FINDIFF_STEP" -0 , 0.0 , 3941000.00011 , 0.0 , 0.0 , 3941000.00011 , 1183.20000001 , 1113.39999995 , 1183.20000001 , 1113.39999995 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1117.4 , -438.899999949 , 0.0 , 1e-06 +"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" +0 , 0.0 , 3941000.0001080334, 0.0 , 0.0 , 3941000.0001080334, 1183.2000000140397, 1113.3999999515254, 1183.2000000140397, 1113.3999999515254, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1117.3999999982698, 0.0 , -438.8999999491716, 1e-06 diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index de782f79756b..701967ad3a90 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.709021, -3.993726, -3.804347, -3.993726] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.743233, -4.002085, -3.812253, -4.002085] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From 9e2ed8e30661f939e5825c7020b1d407a5658e39 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Oct 2020 17:56:08 +0200 Subject: [PATCH 096/326] Update to one regression test that was still nondimensional --- Common/src/CConfig.cpp | 2 ++ .../streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg | 2 +- TestCases/streamwise_periodic_regression.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 2beb0ac82145..8b1731affb1c 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4671,6 +4671,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); if (DiscreteAdjoint && Kind_Streamwise_Periodic == MASSFLOW) SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION); + if (Ref_Inc_NonDim != DIMENSIONAL && false) + SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\"", CURRENT_FUNCTION); /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ Streamwise_Periodic_RefNode.resize(val_nDim); diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index ffef116313af..8f54777aaa02 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -77,7 +77,7 @@ INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) % Non-dimensionalization scheme for incompressible flows. Options are % INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. % INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. -INC_NONDIM= INITIAL_VALUES +INC_NONDIM= DIMENSIONAL % % ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 701967ad3a90..685b0abfdc47 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -45,7 +45,7 @@ def main(): streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" streamwise_periodic_cylinder.test_iter = 30 - streamwise_periodic_cylinder.test_vals = [30, -7.818388, -6.797497, -6.968131] #last 4 lines + streamwise_periodic_cylinder.test_vals = [30.000000, -7.819176, -6.796437, -6.969024] #last 4 lines streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 From 7c87180bcb31f66f18a0e3452f8f0dd629d75af6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 3 Nov 2020 13:34:23 +0100 Subject: [PATCH 097/326] Removed CPhyGeo::SetMeshFile -> unused plus little bit of cleanup. --- Common/include/geometry/CGeometry.hpp | 14 -- .../include/geometry/CMultiGridGeometry.hpp | 1 - Common/include/geometry/CPhysicalGeometry.hpp | 8 -- Common/src/geometry/CPhysicalGeometry.cpp | 134 +++--------------- 4 files changed, 20 insertions(+), 137 deletions(-) diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index a15cab64a4ce..e8c15bca729a 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -856,20 +856,6 @@ class CGeometry { */ inline virtual void SetBoundControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) {} - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] val_mesh_out_filename - Name of the output file. - */ - inline virtual void SetMeshFile(CConfig *config, string val_mesh_out_filename) {} - - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] val_mesh_out_filename - Name of the output file. - */ - inline virtual void SetMeshFile(CGeometry *geometry, CConfig *config, string val_mesh_out_filename) {} - /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. diff --git a/Common/include/geometry/CMultiGridGeometry.hpp b/Common/include/geometry/CMultiGridGeometry.hpp index cb680ab19e40..36aac98b3df2 100644 --- a/Common/include/geometry/CMultiGridGeometry.hpp +++ b/Common/include/geometry/CMultiGridGeometry.hpp @@ -40,7 +40,6 @@ class CMultiGridGeometry final : public CGeometry { public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ using CGeometry::SetVertex; - using CGeometry::SetMeshFile; using CGeometry::SetControlVolume; using CGeometry::SetBoundControlVolume; using CGeometry::SetPoint_Connectivity; diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index a47f2e7a103f..d0ffa9ae9491 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -112,7 +112,6 @@ class CPhysicalGeometry final : public CGeometry { public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ using CGeometry::SetVertex; - using CGeometry::SetMeshFile; using CGeometry::SetControlVolume; using CGeometry::SetBoundControlVolume; using CGeometry::SetPoint_Connectivity; @@ -595,13 +594,6 @@ class CPhysicalGeometry final : public CGeometry { */ void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig *config) override; - /*! - * \brief Write the .su2 file. - * \param[in] config - Definition of the particular problem. - * \param[in] val_mesh_out_filename - Name of the output file. - */ - void SetMeshFile(CConfig *config, string val_mesh_out_filename) 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/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index d21b81899597..bc8d6e150cb0 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7637,7 +7637,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, if (config->GetKind_Streamwise_Periodic() != NONE) { /*-------------------------------------------------------------------------------------------*/ - /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ + /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ /*--- of recovered pressure/temperature, such that this found node is independent of the ---*/ /*--- number of ranks. This does not affect the 'correctness' of the solution as the ---*/ /*--- absolute value is arbitrary anyway, but it assures that the solution does not change---*/ @@ -7667,16 +7667,16 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ - iPeriodic = config->GetMarker_All_PerBound(iMarker); - if (iPeriodic == 1) { - + iPeriodic = config->GetMarker_All_PerBound(iMarker); + if (iPeriodic == 1) { + for (iPoint = 0; iPoint < GetnVertex(iMarker); iPoint++) { /*--- Get the squared norm of the current point. ---*/ norm = 0.0; for (iDim = 0; iDim < nDim; iDim++) norm += pow(nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim),2); - + /*--- Check if new unique reference node is found. ---*/ if (norm < min_norm || iPoint == 0) { min_norm = norm; @@ -7691,7 +7691,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, } // marker loop /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ - SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, + SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); /*-------------------------------------------------------------------------------------------*/ @@ -7706,7 +7706,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, norm = 0.0; for (iDim = 0; iDim < nDim; iDim++) norm += pow(Buffer_Recv_RefNode[iPoint*nDim + iDim],2); - + /*--- Check if new unique reference node is found. ---*/ if (norm < min_norm || iPoint == 0) { min_norm = norm; @@ -7992,95 +7992,6 @@ void CPhysicalGeometry::VisualizeControlVolume(CConfig *config, unsigned short a } -void CPhysicalGeometry::SetMeshFile (CConfig *config, string val_mesh_out_filename) { - unsigned long iElem, iPoint, iElem_Bound; - unsigned short iMarker, iNodes, iDim; - ofstream output_file; - string Grid_Marker; - char *cstr; - - cstr = new char [val_mesh_out_filename.size()+1]; - strcpy (cstr, val_mesh_out_filename.c_str()); - - /*--- Open .su2 grid file ---*/ - - output_file.precision(15); - output_file.open(cstr, ios::out); - - /*--- Write dimension, number of elements and number of points ---*/ - - output_file << "NDIME= " << nDim << endl; - output_file << "NELEM= " << nElem << endl; - for (iElem = 0; iElem < nElem; iElem++) { - output_file << elem[iElem]->GetVTK_Type(); - for (iNodes = 0; iNodes < elem[iElem]->GetnNodes(); iNodes++) - output_file << "\t" << elem[iElem]->GetNode(iNodes); - output_file << "\t"<GetCoord(iPoint, iDim) ; -#ifndef HAVE_MPI - output_file << "\t" << iPoint << endl; -#else - output_file << "\t" << iPoint << "\t" << nodes->GetGlobalIndex(iPoint) << endl; -#endif - - } - - /*--- Loop through and write the boundary info ---*/ - - output_file << "NMARK= " << nMarker << endl; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - - /*--- Ignore SEND_RECEIVE for the moment ---*/ - if (bound[iMarker][0]->GetVTK_Type() != VERTEX) { - - Grid_Marker = config->GetMarker_All_TagBound(iMarker); - output_file << "MARKER_TAG= " << Grid_Marker << endl; - output_file << "MARKER_ELEMS= " << nElem_Bound[iMarker]<< endl; - - if (nDim == 2) { - for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - output_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t" ; - for (iNodes = 0; iNodes < bound[iMarker][iElem_Bound]->GetnNodes(); iNodes++) - output_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t" ; - output_file << iElem_Bound << endl; - } - } - - if (nDim == 3) { - for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - output_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t" ; - for (iNodes = 0; iNodes < bound[iMarker][iElem_Bound]->GetnNodes(); iNodes++) - output_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t" ; - output_file << iElem_Bound << endl; - } - } - - } else if (bound[iMarker][0]->GetVTK_Type() == VERTEX) { - output_file << "MARKER_TAG= SEND_RECEIVE" << endl; - output_file << "MARKER_ELEMS= " << nElem_Bound[iMarker]<< endl; - if (config->GetMarker_All_SendRecv(iMarker) > 0) output_file << "SEND_TO= " << config->GetMarker_All_SendRecv(iMarker) << endl; - if (config->GetMarker_All_SendRecv(iMarker) < 0) output_file << "SEND_TO= " << config->GetMarker_All_SendRecv(iMarker) << endl; - - for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - output_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t" << - bound[iMarker][iElem_Bound]->GetNode(0) << "\t" << - bound[iMarker][iElem_Bound]->GetRotation_Type() << endl; - } - - } - } - - output_file.close(); -} - 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; @@ -9020,8 +8931,6 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { iPoint_Global = 0; - filename = config->GetSolution_AdjFileName(); - filename = config->GetObjFunc_Extension(filename); @@ -9029,9 +8938,8 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { filename = config->GetFilename(filename, ".dat", nTimeIter-1); - char str_buf[CGNS_STRING_SIZE], fname[100]; + char str_buf[CGNS_STRING_SIZE]; unsigned short iVar; - strcpy(fname, filename.c_str()); int nRestart_Vars = 5, nFields; int *Restart_Vars = new int[5]; passivedouble *Restart_Data = nullptr; @@ -9044,13 +8952,13 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Serial binary input. ---*/ FILE *fhw; - fhw = fopen(fname,"rb"); + fhw = fopen(filename.c_str(),"rb"); size_t ret; /*--- Error check for opening the file. ---*/ if (!fhw) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + fname, CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); } /*--- First, read the number of variables and points. ---*/ @@ -9064,7 +8972,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (Restart_Vars[0] != 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + + SU2_MPI::Error(string("File ") + filename + string(" is not a binary SU2 restart file.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9137,12 +9045,12 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(MPI_COMM_WORLD, filename.c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); } /*--- First, read the number of variables and points (i.e., cols and rows), @@ -9161,7 +9069,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (Restart_Vars[0] != 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + + SU2_MPI::Error(string("File ") + filename + string(" is not a binary SU2 restart file.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9352,8 +9260,6 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- First, check that this is not a binary restart file. ---*/ - char fname[100]; - strcpy(fname, filename.c_str()); int magic_number; #ifndef HAVE_MPI @@ -9361,13 +9267,13 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Serial binary input. ---*/ FILE *fhw; - fhw = fopen(fname,"rb"); + fhw = fopen(filename.c_str(),"rb"); size_t ret; /*--- Error check for opening the file. ---*/ if (!fhw) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); } /*--- Attempt to read the first int, which should be our magic number. ---*/ @@ -9381,7 +9287,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + + SU2_MPI::Error(string("File ") + filename + string(" is a binary SU2 restart file, expected ASCII.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9398,12 +9304,12 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(MPI_COMM_WORLD, filename.c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); } /*--- Have the master attempt to read the magic number. ---*/ @@ -9420,7 +9326,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + + SU2_MPI::Error(string("File ") + filename + string(" is a binary SU2 restart file, expected ASCII.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); From e032df5d6300e993597d8dd2a47ee7fb13f9aef5 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 20 Nov 2020 11:41:16 +0100 Subject: [PATCH 098/326] Add a little comment to the config_template. --- config_template.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config_template.cfg b/config_template.cfg index 1380265d3a59..3d70ad92dab8 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -684,6 +684,9 @@ BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % +% Generally for streamwise periodicty one has to set MARKER_PERIODIC= (, , ...) +% appropriatley as a boundary condition. +% % Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= NONE % From c3776502dcae3debc04d80ea3c7777b770250b97 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Dec 2020 15:28:38 +0100 Subject: [PATCH 099/326] Adapting streamwise cht reg test values. Change due to PR1107, jacobian of cht interface change. --- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- TestCases/streamwise_periodic_regression.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 3f6222e6eb26..721b1768c74a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3941000.0001080334, 0.0 , 0.0 , 3941000.0001080334, 1183.2000000140397, 1113.3999999515254, 1183.2000000140397, 1113.3999999515254, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 1117.3999999982698, 0.0 , -438.8999999491716, 1e-06 +0 , 0.0 , 3374000.000068918, 0.0 , 0.0 , 3374000.000068918, 1199.2000000020653, 953.1999999694563, 1199.2000000020653, 953.1999999694563, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 953.3000000487846 , 0.0 , -347.60000005462643, 1e-06 diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 685b0abfdc47..cc67d338a200 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -89,7 +89,7 @@ def main(): sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [0.250241, -0.743036, -1.049060, -0.753332, 208.023676, 355.360000] #last 7 lines + sp_pinArray_cht_2d_mf_hf.test_vals = [0.247022, -0.812199, -0.974877, -0.753315, 208.023676, 349.950000] #last 7 lines sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_cht_2d_mf_hf.timeout = 1600 sp_pinArray_cht_2d_mf_hf.tol = 0.00001 @@ -101,7 +101,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.462699, -0.008477, 214.707868, 429.350000, 368.310000] #last 7 lines + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.451732, -0.008477, 214.707868, 429.350000, 365.670000] #last 7 lines sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.743233, -4.002085, -3.812253, -4.002085] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.054813, -4.137121, -4.054813] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From 108e726521948189a077f620215973c794c98973 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Dec 2020 14:22:37 +0100 Subject: [PATCH 100/326] Revert AD changes tried for massflow sens which were unsuccesful. --- .travis.yml | 4 ++-- Common/include/CConfig.hpp | 5 +---- SU2_CFD/include/solvers/CDiscAdjSolver.hpp | 2 +- SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp | 4 +--- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 10 ---------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 3 +-- TestCases/streamwise_periodic_regression.py | 2 +- 7 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index edb0428da06e..284818490731 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ compiler: notifications: email: recipients: - - tobias.kattmann@de.bosch.com + - su2code-dev@lists.stanford.edu branches: only: @@ -76,7 +76,7 @@ install: before_script: # Get the test cases - - git clone --depth=1 -b feature_periodic_streamwise https://github.com/su2code/TestCases.git ./TestData + - git clone --depth=1 -b develop https://github.com/su2code/TestCases.git ./TestData - cp -R ./TestData/* ./TestCases/ # Get the tutorial cases diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c607214c2ca4..5b95709a80b7 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -61,7 +61,6 @@ using namespace std; class CConfig { private: - bool DirectRunActive = false; /*!< \brief Indicates whether currently the primal is taped during discrete adjoint run.*/ SU2_MPI::Comm SU2_Communicator; /*!< \brief MPI communicator of SU2.*/ int rank, size; /*!< \brief MPI rank and size.*/ bool base_config; @@ -1042,7 +1041,7 @@ class CConfig { bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */ su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [ks/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ Streamwise_Periodic_OutletHeat, /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ @@ -9491,6 +9490,4 @@ class CConfig { */ short FindInterfaceMarker(unsigned short iInterface) const; - void SetDirectRunActive() { DirectRunActive = true; } - bool GetDirectRunActive() const { return DirectRunActive; } }; diff --git a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp index cb17fa741648..52244aafd6cd 100644 --- a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp @@ -50,7 +50,7 @@ class CDiscAdjSolver final : public CSolver { su2double Total_Sens_Density; /*!< \brief Total sensitivity to initial density (incompressible). */ su2double Total_Sens_ModVel; /*!< \brief Total sensitivity to inlet velocity (incompressible). */ su2double ObjFunc_Value; /*!< \brief Value of the objective function. */ - su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel, SWPressureDrop, Local_Sens_SWPressureDrop, Output_SWPressureDrop; + su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel; su2double TemperatureRad, Total_Sens_Temp_Rad; su2double *Solution_Geometry; /*!< \brief Auxiliary vector for the geometry solution (dimension nDim instead of nVar). */ diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index d03051cade05..495876b2c6af 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -443,8 +443,6 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ void CDiscAdjSinglezoneDriver::DirectRun(unsigned short kind_recording){ - config->SetDirectRunActive(); - /*--- Mesh movement ---*/ direct_iteration->SetMesh_Deformation(geometry_container[ZONE_0][INST_0], solver, numerics, config, kind_recording); @@ -471,7 +469,7 @@ void CDiscAdjSinglezoneDriver::Print_DirectResidual(unsigned short kind_recordin /*--- Print the residuals of the direct iteration that we just recorded ---*/ /*--- This routine should be moved to the output, once the new structure is in place ---*/ - if ((rank == MASTER_NODE)){ //&& (kind_recording == MainVariables)){ + if ((rank == MASTER_NODE) && (kind_recording == MainVariables)){ switch (config->GetKind_Solver()) { diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index cc921288d056..ce5a7c92ebfd 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -339,7 +339,6 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo ModVel = config->GetIncInlet_BC(); BPressure = config->GetIncPressureOut_BC(); Temperature = config->GetIncTemperature_BC(); - SWPressureDrop = config->GetStreamwise_Periodic_PressureDrop(); /*--- Register the variables for AD. ---*/ @@ -347,7 +346,6 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo AD::RegisterInput(ModVel); AD::RegisterInput(BPressure); AD::RegisterInput(Temperature); - AD::RegisterInput(SWPressureDrop); } /*--- Set the BC values in the config class. ---*/ @@ -355,7 +353,6 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo config->SetIncInlet_BC(ModVel); config->SetIncPressureOut_BC(BPressure); config->SetIncTemperature_BC(Temperature); - config->SetStreamwise_Periodic_PressureDrop(SWPressureDrop); } @@ -394,8 +391,6 @@ void CDiscAdjSolver::RegisterOutput(CGeometry *geometry, CConfig *config) { /*--- Register variables as output of the solver iteration ---*/ direct_solver->GetNodes()->RegisterSolution(input, push_index); - - Output_SWPressureDrop = config->GetStreamwise_Periodic_PressureDrop(); } void CDiscAdjSolver::RegisterObj_Func(CConfig *config) { @@ -594,9 +589,6 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_BPress = SU2_TYPE::GetDerivative(BPressure); Local_Sens_Temp = SU2_TYPE::GetDerivative(Temperature); - Local_Sens_SWPressureDrop = SU2_TYPE::GetDerivative(SWPressureDrop); - //cout << "Local_Sens_SWPressureDrop: " << Local_Sens_SWPressureDrop << endl; - SU2_MPI::Allreduce(&Local_Sens_ModVel, &Total_Sens_ModVel, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); @@ -720,8 +712,6 @@ void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { direct_solver->GetNodes()->SetAdjointSolution(iPoint,Solution); } } - - SU2_TYPE::SetDerivative(Output_SWPressureDrop, SU2_TYPE::GetValue(Local_Sens_SWPressureDrop)); } void CDiscAdjSolver::SetAdjoint_OutputMesh(CGeometry *geometry, CConfig *config){ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 138e08d6d118..51ecdc7a2925 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -3710,8 +3710,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at best ---*/ if((nZone==1 && InnerIter > 0) || - (nZone>1 && OuterIter > 0) || - (config->GetDirectRunActive())) // Otherwise this is not done during the adjoint run. + (nZone>1 && OuterIter > 0)) config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); /*--- Output the new value of Delta P and ddp ---*/ diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index cc67d338a200..18391ed738df 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.054813, -4.137121, -4.054813] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.768252, -4.048246, -4.130988, -4.048246] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From eddcfe8fdaebcadec73d659fde97a612e1d9e9e6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Dec 2020 14:45:47 +0100 Subject: [PATCH 101/326] Revert changes wrt to strcpy stuff in order to please CodeFactor. --- Common/src/geometry/CPhysicalGeometry.cpp | 31 +++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 8a79f543e62d..803b9b9bc797 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8931,6 +8931,8 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { iPoint_Global = 0; + filename = config->GetSolution_AdjFileName(); + filename = config->GetObjFunc_Extension(filename); @@ -8938,8 +8940,9 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { filename = config->GetFilename(filename, ".dat", nTimeIter-1); - char str_buf[CGNS_STRING_SIZE]; + char str_buf[CGNS_STRING_SIZE], fname[100]; unsigned short iVar; + strcpy(fname, filename.c_str()); int nRestart_Vars = 5, nFields; int *Restart_Vars = new int[5]; passivedouble *Restart_Data = nullptr; @@ -8952,13 +8955,13 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Serial binary input. ---*/ FILE *fhw; - fhw = fopen(filename.c_str(),"rb"); + fhw = fopen(fname,"rb"); size_t ret; /*--- Error check for opening the file. ---*/ if (!fhw) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); } /*--- First, read the number of variables and points. ---*/ @@ -8972,7 +8975,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (Restart_Vars[0] != 535532) { - SU2_MPI::Error(string("File ") + filename + string(" is not a binary SU2 restart file.\n") + + SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9045,12 +9048,12 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, filename.c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); } /*--- First, read the number of variables and points (i.e., cols and rows), @@ -9069,7 +9072,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (Restart_Vars[0] != 535532) { - SU2_MPI::Error(string("File ") + filename + string(" is not a binary SU2 restart file.\n") + + SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9260,6 +9263,8 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- First, check that this is not a binary restart file. ---*/ + char fname[100]; + strcpy(fname, filename.c_str()); int magic_number; #ifndef HAVE_MPI @@ -9267,13 +9272,13 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Serial binary input. ---*/ FILE *fhw; - fhw = fopen(filename.c_str(),"rb"); + fhw = fopen(fname,"rb"); size_t ret; /*--- Error check for opening the file. ---*/ if (!fhw) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); } /*--- Attempt to read the first int, which should be our magic number. ---*/ @@ -9287,7 +9292,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + filename + string(" is a binary SU2 restart file, expected ASCII.\n") + + SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); @@ -9304,12 +9309,12 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, filename.c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); } /*--- Have the master attempt to read the magic number. ---*/ @@ -9326,7 +9331,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + filename + string(" is a binary SU2 restart file, expected ASCII.\n") + + SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + string("SU2 reads/writes binary restart files by default.\n") + string("Note that backward compatibility for ASCII restart files is\n") + string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); From 3ac05074a3d446d85978c3dd43d69ef525badb96 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Dec 2020 14:53:59 +0100 Subject: [PATCH 102/326] Revert changes to VolGridMov for periodic and sym walls. No reg tests affected --- Common/src/grid_movement/CVolumetricMovement.cpp | 9 ++++----- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index 1bfa0cc57f1f..986485708bdc 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -1513,11 +1513,10 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig plane, internal and periodic bc the receive boundaries and periodic boundaries. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((//(config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && + if (((config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) && - (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) //&& - //(config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) - )) { + (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { @@ -1554,7 +1553,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig /*--- Set to zero displacements of the normal component for the symmetry plane condition ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) && false ) { + if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) ) { su2double *Coord_0 = nullptr; diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 721b1768c74a..2d4afaf5a74f 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 3374000.000068918, 0.0 , 0.0 , 3374000.000068918, 1199.2000000020653, 953.1999999694563, 1199.2000000020653, 953.1999999694563, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 953.3000000487846 , 0.0 , -347.60000005462643, 1e-06 +0 , 0.0 , 11355999.999912456, 0.0 , 0.0 , 11355999.999912456, 800.4999999968732, 3207.899999949859, 800.4999999968732, 3207.899999949859, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 3210.000000024138 , 0.0 , 307.8999999388543, 1e-06 From 26b533bcbe5f201d4abdda9960a8431604c6899e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Dec 2020 18:07:32 +0100 Subject: [PATCH 103/326] Make FindUnique_RefNode its own function. --- Common/include/geometry/CGeometry.hpp | 6 + Common/include/geometry/CPhysicalGeometry.hpp | 6 + Common/src/geometry/CPhysicalGeometry.cpp | 157 +++++++++--------- SU2_CFD/src/drivers/CDriver.cpp | 4 + 4 files changed, 94 insertions(+), 79 deletions(-) diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 15dc71f8075d..1d8a4d38ade8 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -726,6 +726,12 @@ class CGeometry { */ inline virtual void MatchPeriodic(CConfig *config, unsigned short val_periodic) {} + /*! + * \brief For streamwise periodicity, find a unique reference node on the designated inlet. + * \param[in] config - Definition of the particular problem. + */ + inline virtual void FindUniqueNode_PeriodicBound(CConfig *config) {} + /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 84e1acdd89c8..5a89eac0660b 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -482,6 +482,12 @@ class CPhysicalGeometry final : public CGeometry { */ void MatchPeriodic(CConfig *config, unsigned short val_periodic) override; + /*! + * \brief For streamwise periodicity, find a unique reference node on the designated inlet. + * \param[in] config - Definition of the particular problem. + */ + void FindUniqueNode_PeriodicBound(CConfig *config) override; + /*! * \brief Set boundary vertex structure of the control volume. * \param[in] config - Definition of the particular problem. diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 803b9b9bc797..7e415268e654 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7632,102 +7632,101 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, delete [] Buffer_Recv_GlobalIndex; delete [] Buffer_Recv_Vertex; delete [] Buffer_Recv_Marker; +} - /*--- Compute reference Node for streamwise periodicity. ---*/ - if (config->GetKind_Streamwise_Periodic() != NONE) { - - /*-------------------------------------------------------------------------------------------*/ - /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ - /*--- of recovered pressure/temperature, such that this found node is independent of the ---*/ - /*--- number of ranks. This does not affect the 'correctness' of the solution as the ---*/ - /*--- absolute value is arbitrary anyway, but it assures that the solution does not change---*/ - /*--- with a higher number of ranks. If the periodic markers are a line\plane and the ---*/ - /*--- streamwise coordiante vector is perpendicular to that |--->|, the choice of the ---*/ - /*--- reference node is not relevant at all. This is probably true for most streamwise ---*/ - /*--- periodic cases. Other cases where it is relevant could look like this (--->( or ---*/ - /*--- \--->\ . The chosen metric is the minimal distance to the origin. ---*/ - /*-------------------------------------------------------------------------------------------*/ - - /*--- Initialize/Allocate variables. ---*/ - unsigned short iMarker, iPeriodic, iDim; - unsigned long iPoint; - su2double norm, min_norm = 0.0; - - vector Buffer_Send_RefNode(nDim, 1e300), - Buffer_Recv_RefNode(size*nDim); - - /*-------------------------------------------------------------------------------------------*/ - /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ - /*--- each process has the local ref-nodes from every process. Most processes ---*/ - /*--- won't have a boundary with the streamwise periodic 'inlet' marker, ---*/ - /*--- therefore the default value of the send value is set super high. ---*/ - /*-------------------------------------------------------------------------------------------*/ +void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { + + /*-------------------------------------------------------------------------------------------*/ + /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ + /*--- of recovered pressure/temperature, such that this found node is independent of the ---*/ + /*--- number of ranks. This does not affect the 'correctness' of the solution as the ---*/ + /*--- absolute value is arbitrary anyway, but it assures that the solution does not change---*/ + /*--- with a higher number of ranks. If the periodic markers are a line\plane and the ---*/ + /*--- streamwise coordiante vector is perpendicular to that |--->|, the choice of the ---*/ + /*--- reference node is not relevant at all. This is probably true for most streamwise ---*/ + /*--- periodic cases. Other cases where it is relevant could look like this (--->( or ---*/ + /*--- \--->\ . The chosen metric is the minimal distance to the origin. ---*/ + /*-------------------------------------------------------------------------------------------*/ + + /*--- Initialize/Allocate variables. ---*/ + unsigned short iMarker, iPeriodic, iDim; + unsigned long iPoint; + su2double norm, min_norm = 0.0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { + vector Buffer_Send_RefNode(nDim, 1e300), + Buffer_Recv_RefNode(size*nDim); - /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ - iPeriodic = config->GetMarker_All_PerBound(iMarker); - if (iPeriodic == 1) { + /*-------------------------------------------------------------------------------------------*/ + /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ + /*--- each process has the local ref-nodes from every process. Most processes ---*/ + /*--- won't have a boundary with the streamwise periodic 'inlet' marker, ---*/ + /*--- therefore the default value of the send value is set super high. ---*/ + /*-------------------------------------------------------------------------------------------*/ - for (iPoint = 0; iPoint < GetnVertex(iMarker); iPoint++) { + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - /*--- Get the squared norm of the current point. ---*/ - norm = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm += pow(nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim),2); + /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ + iPeriodic = config->GetMarker_All_PerBound(iMarker); + if (iPeriodic == 1) { - /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iPoint == 0) { - min_norm = norm; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim); - } - /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ - } - break; // Actually no more than one streamwise periodic marker pair is allowed - } // receiver conditional - } // periodic conditional - } // marker loop + for (iPoint = 0; iPoint < GetnVertex(iMarker); iPoint++) { - /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ - SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, - Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); + /*--- Get the squared norm of the current point. ---*/ + norm = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + norm += pow(nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim),2); - /*-------------------------------------------------------------------------------------------*/ - /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ - /*--- globally closest to the origin. Store the found node coordinates in the ---*/ - /*--- config container. ---*/ - /*-------------------------------------------------------------------------------------------*/ + /*--- Check if new unique reference node is found. ---*/ + if (norm < min_norm || iPoint == 0) { + min_norm = norm; + for (iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim); + } + /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ + } + break; // Actually no more than one streamwise periodic marker pair is allowed + } // receiver conditional + } // periodic conditional + } // marker loop - for (iPoint = 0; iPoint < static_cast(size); iPoint++) { // loop over all vertices on that marker and fi + /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ + SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, + Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); - /*--- Get the norm of the current Point. ---*/ - norm = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm += pow(Buffer_Recv_RefNode[iPoint*nDim + iDim],2); + /*-------------------------------------------------------------------------------------------*/ + /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ + /*--- globally closest to the origin. Store the found node coordinates in the ---*/ + /*--- config container. ---*/ + /*-------------------------------------------------------------------------------------------*/ - /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iPoint == 0) { - min_norm = norm; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iPoint*nDim + iDim]; - } - /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ - } + for (iPoint = 0; iPoint < static_cast(size); iPoint++) { // loop over all vertices on that marker and fi - /*--- Store the final reference node. ---*/ - config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode); + /*--- Get the norm of the current Point. ---*/ + norm = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + norm += pow(Buffer_Recv_RefNode[iPoint*nDim + iDim],2); - /*--- Print the reference node to screen. ---*/ - if (rank == MASTER_NODE) { - cout << "Streamwise Periodic Reference Node: ["; + /*--- Check if new unique reference node is found. ---*/ + if (norm < min_norm || iPoint == 0) { + min_norm = norm; for (iDim = 0; iDim < nDim; iDim++) - cout << " " << Buffer_Send_RefNode[iDim]; - cout << " ]" << endl; + Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iPoint*nDim + iDim]; } + /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ + } + + /*--- Store the final reference node. ---*/ + config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode); + /*--- Print the reference node to screen. ---*/ + if (rank == MASTER_NODE) { + cout << "Streamwise Periodic Reference Node: ["; + for (iDim = 0; iDim < nDim; iDim++) + cout << " " << Buffer_Send_RefNode[iDim]; + cout << " ]" << endl; } + } void CPhysicalGeometry::SetControlVolume(CConfig *config, unsigned short action) { diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 954bb1ac3e72..b3aa56f3caf6 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -702,6 +702,10 @@ void CDriver::Geometrical_Preprocessing(CConfig* config, CGeometry **&geometry, geometry[iMesh]->MatchPeriodic(config, iPeriodic); } + /*--- For Streamwise Periodic flow, find a unique reference node on the dedicated inlet marker. ---*/ + if (config->GetKind_Streamwise_Periodic() != NONE) + geometry[iMesh]->FindUniqueNode_PeriodicBound(config); + /*--- Initialize the communication framework for the periodic BCs. ---*/ geometry[iMesh]->PreprocessPeriodicComms(geometry[iMesh], config); From 7311a6ea8023d70d0773ea70109a7a88302c9d93 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 10 Dec 2020 20:20:14 +0100 Subject: [PATCH 104/326] Remove discontinued cfg options from streamwie testcases. --- .../streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg | 7 ------- .../streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg | 7 ------- .../streamwise_periodic/chtPinArray_2d/configFluid.cfg | 6 ------ .../streamwise_periodic/chtPinArray_2d/configMaster.cfg | 7 ------- .../half_cylinder_2D/half_cylinder_2D.cfg | 3 --- .../pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg | 6 ------ .../pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 6 ------ .../pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg | 5 ----- 8 files changed, 47 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index 1d90c19d9249..c81d0401be8b 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -136,13 +136,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES - - % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 478e40c202f0..92390c471554 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -150,13 +150,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES - - % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index 1742ec7afca1..c70f12056d46 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -363,12 +363,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES -% % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 638c8b4e420d..262b4a979092 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -138,13 +138,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES - - % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 8f54777aaa02..1b2d9f71364f 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -25,9 +25,6 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % -% Write binary restart files (YES, NO) -WRT_BINARY_RESTART= NO -% % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg index 1930e961bb27..89615b6391c7 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg @@ -356,12 +356,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES -% % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg index e23264b76ec2..46982aae0a1d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg @@ -360,12 +360,6 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 % -% Visualize the surface deformation (NO, YES) -VISUALIZE_SURFACE_DEF= YES -% -% Visualize the volume deformation (NO, YES) -VISUALIZE_VOLUME_DEF= YES -% % Available design variables % 2D Design variables % FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index 6688c23893ed..27fe9cac670a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -25,9 +25,6 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % -% Write binary restart files (YES, NO) -WRT_BINARY_RESTART= YES -% HISTORY_OUTPUT= (FLOW_COEFF, LINSOL) % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -228,5 +225,3 @@ WRT_SOL_FREQ= 200 % % Writing convergence history frequency WRT_CON_FREQ= 1 -% -WRT_RESIDUALS= YES From 57f87ea4adce5647a51ab4d5e1eeb27b4b2a47e6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 16 Dec 2020 00:23:31 +0100 Subject: [PATCH 105/326] Update/clean streamwise periodic regression tests. --- Common/src/CConfig.cpp | 2 +- .../src/grid_movement/CVolumetricMovement.cpp | 2 +- .../chtPinArray_2d/DA_configFluid.cfg | 199 ------------ .../chtPinArray_2d/DA_configMaster.cfg | 123 +++---- .../chtPinArray_2d/DA_configSolid.cfg | 108 ------- .../chtPinArray_2d/FD_configFluid.cfg | 200 ------------ .../chtPinArray_2d/FD_configMaster.cfg | 154 +++------ .../chtPinArray_2d/FD_configSolid.cfg | 109 ------- .../chtPinArray_2d/configFluid.cfg | 299 ++---------------- .../chtPinArray_2d/configMaster.cfg | 119 +++---- .../chtPinArray_2d/configSolid.cfg | 103 +----- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- .../chtPinArray_3d/configFluid.cfg | 102 +----- .../chtPinArray_3d/configMaster.cfg | 67 +--- .../chtPinArray_3d/configSolid.cfg | 52 +-- .../half_cylinder_2D/half_cylinder_2D.cfg | 218 ++----------- .../pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg | 264 +++------------- .../pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 269 +++------------- .../pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg | 181 ++--------- TestCases/streamwise_periodic_regression.py | 14 +- 20 files changed, 352 insertions(+), 2235 deletions(-) delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 3a23e6123e1c..491f62fc811b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2296,7 +2296,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("REFERENCE_GEOMETRY_PENALTY", RefGeom_Penalty, 1E6); /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart structure input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n Default: solution_flow.dat \ingroup Config */ addStringOption("REFERENCE_GEOMETRY_FILENAME", RefGeom_FEMFileName, string("reference_geometry.dat")); - /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Format of the reference geometry file \n OPTIONS: see \link Input_Ref_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ addEnumOption("REFERENCE_GEOMETRY_FORMAT", RefGeom_FileFormat, Input_Ref_Map, SU2_REF); /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index c4cefce292b7..932b393c0a44 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -1513,7 +1513,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig plane, internal and periodic bc the receive boundaries and periodic boundaries. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (((config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && + if ((//(config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) && (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg deleted file mode 100644 index f2c3765b3a2c..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configFluid.cfg +++ /dev/null @@ -1,199 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) -% -%OBJECTIVE_FUNCTION= DRAG -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -% -OBJECTIVE_WEIGHT= 0.0 -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_ENERGY_EQUATION = YES -% -% Serves as material parameter -INC_DENSITY_INIT= 1045.0 -INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) -INC_TEMPERATURE_INIT= 338.0 -% -%INC_NONDIM= INITIAL_VALUES -INC_NONDIM= DIMENSIONAL -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Redundant to INC_DENSITY_MODEL -FLUID_MODEL= CONSTANT_DENSITY -SPECIFIC_HEAT_CP= 3540.0 -% -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 0.001385 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] -% = 1.385e-3 * 3540 / 0.42 -% = 11.7 -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM= 11.7 -% -TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -PRANDTL_TURB= 0.90 -% -% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% -% -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) -%KIND_STREAMWISE_PERIODIC= MASSFLOW -KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -% -% Delta P value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. Was set to 210 before -%STREAMWISE_PERIODIC_PRESSURE_DROP= 210 -STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -% -% Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.85 -% -INC_OUTLET_DAMPING= 0.001 - -STREAMWISE_PERIODIC_TEMPERATURE= NO - -% inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi -% with 5e5 W/m that is Q = 1884.96 -STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 -%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) -% -MARKER_SYM= ( fluid_symmetry ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) -MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) -% -% Alternative to periodic simulation -%INC_INLET_TYPE= VELOCITY_INLET -%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -% Test vals to hinder outlet backflow -%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) -% -%INC_OUTLET_TYPE= PRESSURE_OUTLET -%MARKER_OUTLET= ( fluid_outlet, 0.0 ) -% -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_PLOTTING= ( fluid_pin2_interface ) -%MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) -MARKER_MONITORING= ( NONE ) -% -% Massflow averaged total pressure difference between in- and outlet is the target -%MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -%MARKER_ANALYZE_AVERAGE = MASSFLUX -MARKER_ANALYZE = ( fluid_pin2_interface ) -MARKER_ANALYZE_AVERAGE = AREA -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 1e3 -CFL_ADAPT= NO -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-15 -LINEAR_SOLVER_ITER= 10 -% -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= V_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) -% -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) -% -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= NONE -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 18 -CONV_RESIDUAL_MINVAL= -26 -CONV_STARTITER= 100000000 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -%MESH_FILENAME= fluid.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -%GRAD_OBJFUNC_FILENAME= of_grad_fluid.csv -% -SOLUTION_ADJ_FILENAME= solution_adj -RESTART_ADJ_FILENAME= solution_adj -VOLUME_ADJ_FILENAME= adjoint -SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index c81d0401be8b..512851472b35 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -2,67 +2,51 @@ % % % SU2 configuration file % % Case description: 2D cylinder array with CHT couplings % -% Author: O. Burghardt, T. Economon % -% Institution: Chair for Scientific Computing, TU Kaiserslautern % -% Date: August 8, 2019 % -% File Version 6.0.1 "Falcon" % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= MULTIPHYSICS % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DISCRETE_ADJOINT -% -CONFIG_LIST = (DA_configFluid.cfg, DA_configSolid.cfg) +CONFIG_LIST= (configFluid.cfg, configSolid.cfg) % MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) % MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) % -TIME_DOMAIN = NO -% -SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1], BGS_ADJ_TEMPERATURE[0]) -HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1] ) -% CONV_RESIDUAL_MINVAL= -26 +% % Number of total iterations OUTER_ITER= 3000 -OUTPUT_WRT_FREQ= 1000 -SCREEN_WRT_FREQ_OUTER= 25 % %CHT_ROBIN= NO % -OUTPUT_FILES= (RESTART, RESTART_ASCII, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY, SURFACE_PARAVIEW_ASCII) +SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1], BGS_ADJ_TEMPERATURE[0]) +SCREEN_WRT_FREQ_OUTER= 100 % -% Mesh input file -MESH_FILENAME= 2D-PinArray_FFD.su2 -%SPECIFIC_HEAT_CP = 871.0 +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1] ) % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) +OUTPUT_WRT_FREQ= 1000 +% +MESH_FILENAME= 2D-PinArray_FFD.su2 MESH_FORMAT= SU2 -GRAD_OBJFUNC_FILENAME= of_grad.csv +% +SOLUTION_ADJ_FILENAME= restart_adj +% % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % -% Tolerance of the Free-Form Deformation point inversion FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 % -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, % 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) - % -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) +% FFD box degree: 2D case (x_degree, y_degree, 0) FFD_DEGREE= (8, 1, 0) % % Surface grid continuity at the intersection with the faces of the FFD boxes. @@ -70,78 +54,59 @@ FFD_DEGREE= (8, 1, 0) % number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) FFD_CONTINUITY= NO_DERIVATIVE % -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) %DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) % % Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) % - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) %DV_PARAM= ( 1.0 ) -%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) -DV_PARAM= ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +DV_PARAM= \ +( BOX, 0, 1, 0.0, 1.0);\ +( BOX, 1, 1, 0.0, 1.0);\ +( BOX, 2, 1, 0.0, 1.0);\ +( BOX, 3, 1, 0.0, 1.0);\ +( BOX, 4, 1, 0.0, 1.0);\ +( BOX, 5, 1, 0.0, 1.0);\ +( BOX, 6, 1, 0.0, 1.0);\ +( BOX, 7, 1, 0.0, 1.0);\ +( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation %DV_VALUE= 1.0 -%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % -% Number of smoothing iterations for mesh deformation +DEFORM_NONLINEAR_ITER= 1 DEFORM_LINEAR_SOLVER_ITER= 1000 % -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 10 -% -% Minimum residual criteria for the linear solver convergence of grid deformation -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -% -% Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % % Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger % value is also possible) +% !!! What is this doing !!! DEFORM_COEFF = 1E6 % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +DEFINITION_DV= \ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) + %DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg deleted file mode 100644 index f3d0d64ebac9..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configSolid.cfg +++ /dev/null @@ -1,108 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (solid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= HEAT_EQUATION -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -%HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) -%OBJECTIVE_FUNCTION= DRAG -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -% -OBJECTIVE_WEIGHT= 1.0 -% -% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% -% -INC_NONDIM= DIMENSIONAL -SOLID_TEMPERATURE_INIT= 345.0 -SOLID_DENSITY= 2719 -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -SPECIFIC_HEAT_CP = 871.0 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM = 6.99091 -% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later -% used for the viscous res -SOLID_THERMAL_CONDUCTIVITY= 200 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -%MARKER_SYM= ( solid_sym_sides) -% -%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) -% -MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_PLOTTING = ( solid_pin2_interface ) -MARKER_MONITORING = ( solid_pin2_inner ) -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= GREEN_GAUSS -% -CFL_NUMBER= 1e4 -CFL_ADAPT= NO -CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) -BETA_FACTOR= 50 -MAX_DELTA_TIME= 1.0 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-15 -LINEAR_SOLVER_ITER= 20 -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 10 -CONV_RESIDUAL_MINVAL= -20 -CONV_STARTITER= 10000000000 -% -% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_HEAT = SPACE_CENTERED -MUSCL_HEAT= YES -JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) -TIME_DISCRE_HEAT= EULER_IMPLICIT -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -%MESH_FILENAME= solid.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -VOLUME_FILENAME= heat -SURFACE_FILENAME= surface_heat -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -%GRAD_OBJFUNC_FILENAME= of_grad_solid.csv - -SOLUTION_ADJ_FILENAME= solution_adj -RESTART_ADJ_FILENAME= solution_adj -VOLUME_ADJ_FILENAME= adjoint -SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg deleted file mode 100644 index 5515fc372cd8..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configFluid.cfg +++ /dev/null @@ -1,200 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) -% -%OBJECTIVE_FUNCTION= DRAG -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -OPT_OBJECTIVE= NONE -% -OBJECTIVE_WEIGHT= 0.0 -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_ENERGY_EQUATION = YES -% -% Serves as material parameter -INC_DENSITY_INIT= 1045.0 -INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) -INC_TEMPERATURE_INIT= 338.0 -% -%INC_NONDIM= INITIAL_VALUES -INC_NONDIM= DIMENSIONAL -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Redundant to INC_DENSITY_MODEL -FLUID_MODEL= CONSTANT_DENSITY -SPECIFIC_HEAT_CP= 3540.0 -% -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 0.001385 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] -% = 1.385e-3 * 3540 / 0.42 -% = 11.7 -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM= 11.7 -% -TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -PRANDTL_TURB= 0.90 -% -% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% -% -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) -%KIND_STREAMWISE_PERIODIC= MASSFLOW -KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -% -% Delta P value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. Was set to 210 before -%STREAMWISE_PERIODIC_PRESSURE_DROP= 210 -STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -% -% Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.85 -% -INC_OUTLET_DAMPING= 0.001 - -STREAMWISE_PERIODIC_TEMPERATURE= NO - -% inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi -% with 5e5 W/m that is Q = 1884.96 -STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 -%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) -% -MARKER_SYM= ( fluid_symmetry ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) -MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) -% -% Alternative to periodic simulation -%INC_INLET_TYPE= VELOCITY_INLET -%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -% Test vals to hinder outlet backflow -%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) -% -%INC_OUTLET_TYPE= PRESSURE_OUTLET -%MARKER_OUTLET= ( fluid_outlet, 0.0 ) -% -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_PLOTTING= ( fluid_pin1_interface, fluid_pin2_interface, fluid_pin3_interface ) -%MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) -MARKER_MONITORING= ( NONE ) -% -% Massflow averaged total pressure difference between in- and outlet is the target -%MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -%MARKER_ANALYZE_AVERAGE = MASSFLUX -MARKER_ANALYZE = ( fluid_pin2_interface ) -MARKER_ANALYZE_AVERAGE = AREA -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 1e3 -CFL_ADAPT= NO -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-15 -LINEAR_SOLVER_ITER= 10 -% -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= V_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) -% -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) -% -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= NONE -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 18 -CONV_RESIDUAL_MINVAL= -26 -CONV_STARTITER= 100000000 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -%MESH_FILENAME= fluid.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -VOLUME_FILENAME= flow -%SURFACE_FILENAME= surface_flow -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -GRAD_OBJFUNC_FILENAME= of_grad_fluid.csv -% -SOLUTION_ADJ_FILENAME= solution_adj -RESTART_ADJ_FILENAME= solution_adj -VOLUME_ADJ_FILENAME= adjoint -SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 92390c471554..54df50e97b77 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -2,84 +2,60 @@ % % % SU2 configuration file % % Case description: 2D cylinder array with CHT couplings % -% Author: O. Burghardt, T. Economon % -% Institution: Chair for Scientific Computing, TU Kaiserslautern % -% Date: August 8, 2019 % -% File Version 6.0.1 "Falcon" % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= MULTIPHYSICS % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -RESTART_SOL= NO -CONV_FILENAME= history - -% -CONFIG_LIST = (FD_configFluid.cfg, FD_configSolid.cfg) +CONFIG_LIST= (configFluid.cfg, configSolid.cfg) % MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) % MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) % -TIME_DOMAIN = NO -% -SCREEN_OUTPUT= (WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) -HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], AERO_COEFF[0], HEAT[1] ) -% CONV_RESIDUAL_MINVAL= -26 - -% Number of total iterations -%OUTER_ITER= 3000 % % FOR FAST RUNING REGRESSION TEST ONLY! -% FOR GADIENT VALIDATION USE OUTER_ITER ABOVE! +% FOR GADIENT VALIDATION USE OUTER_ITER= 3000! OUTER_ITER= 101 -% -OUTPUT_WRT_FREQ= 10000 -SCREEN_WRT_FREQ_OUTER= 100 -RESTART_FILENAME= solution_master % %CHT_ROBIN= NO % -OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) +SCREEN_OUTPUT= ( WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +SCREEN_WRT_FREQ_OUTER= 100 % -% Mesh input file -MESH_FILENAME= 2D-PinArray_FFD.su2 -%SPECIFIC_HEAT_CP = 871.0 +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], AERO_COEFF[0], HEAT[1] ) +% +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) +OUTPUT_WRT_FREQ= 10000 % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FILENAME= 2D-PinArray_FFD.su2 MESH_FORMAT= SU2 -%GRAD_OBJFUNC_FILENAME= of_grad.csv - +% +% Options that have to be kept for finite_differences.py +RESTART_SOL= NO MARKER_MONITORING= ( NONE ) -SOLUTION_FILENAME= solution_flow -SOLUTION_ADJ_FILENAME= solution_adj_flow -TABULAR_FORMAT=CSV - +SOLUTION_FILENAME= restart +SOLUTION_ADJ_FILENAME= restart_adj +RESTART_FILENAME= restart +CONV_FILENAME= history +TABULAR_FORMAT= CSV +% % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % -% Tolerance of the Free-Form Deformation point inversion FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 % -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, % 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) - % -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) +% FFD box degree: 2D case (x_degree, y_degree, 0) FFD_DEGREE= (8, 1, 0) % % Surface grid continuity at the intersection with the faces of the FFD boxes. @@ -87,90 +63,64 @@ FFD_DEGREE= (8, 1, 0) % number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) FFD_CONTINUITY= NO_DERIVATIVE % -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) % % Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) % - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) DV_PARAM= ( 1.0 ) -%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +%DV_PARAM= \ +%( BOX, 0, 1, 0.0, 1.0);\ +%( BOX, 1, 1, 0.0, 1.0);\ +%( BOX, 2, 1, 0.0, 1.0);\ +%( BOX, 3, 1, 0.0, 1.0);\ +%( BOX, 4, 1, 0.0, 1.0);\ +%( BOX, 5, 1, 0.0, 1.0);\ +%( BOX, 6, 1, 0.0, 1.0);\ +%( BOX, 7, 1, 0.0, 1.0);\ +%( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation DV_VALUE= 1.0 -%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % -% Number of smoothing iterations for mesh deformation -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -% Number of nonlinear deformation iterations (surface deformation increments) DEFORM_NONLINEAR_ITER= 1 +DEFORM_LINEAR_SOLVER_ITER= 1000 % -% Minimum residual criteria for the linear solver convergence of grid deformation -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -% -% Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % % Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger % value is also possible) +% !!! What is this doing !!! DEFORM_COEFF = 1E6 % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) % For gradient validation uncomment the other DV's! -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ -% ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +DEFINITION_DV= \ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES OPT_OBJECTIVE= AVG_TOTALTEMP -FIN_DIFF_STEP= 0.000001 +FIN_DIFF_STEP= 1e-8 NZONES=2 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg deleted file mode 100644 index ddcb7c68e2d1..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configSolid.cfg +++ /dev/null @@ -1,109 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (solid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= HEAT_EQUATION -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -%HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) -%OBJECTIVE_FUNCTION= DRAG -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -OPT_OBJECTIVE= AVG_TOTALTEMP -% -OBJECTIVE_WEIGHT= 1.0 -% -% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% -% -INC_NONDIM= DIMENSIONAL -SOLID_TEMPERATURE_INIT= 345.0 -SOLID_DENSITY= 2719 -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -SPECIFIC_HEAT_CP = 871.0 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM = 6.99091 -% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later -% used for the viscous res -SOLID_THERMAL_CONDUCTIVITY= 200 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -%MARKER_SYM= ( solid_sym_sides) -% -%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) -% -MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_PLOTTING = ( solid_pin1_interface, solid_pin2_interface, solid_pin3_interface ) -MARKER_MONITORING = ( solid_pin2_inner ) -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= GREEN_GAUSS -% -CFL_NUMBER= 1e4 -CFL_ADAPT= NO -CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) -BETA_FACTOR= 50 -MAX_DELTA_TIME= 1.0 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-15 -LINEAR_SOLVER_ITER= 20 -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 10 -CONV_RESIDUAL_MINVAL= -20 -CONV_STARTITER= 10000000000 -% -% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_HEAT = SPACE_CENTERED -MUSCL_HEAT= YES -JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) -TIME_DISCRE_HEAT= EULER_IMPLICIT -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -%MESH_FILENAME= solid.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -VOLUME_FILENAME= heat -SURFACE_FILENAME= surface_heat -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -GRAD_OBJFUNC_FILENAME= of_grad_solid.csv - -SOLUTION_ADJ_FILENAME= solution_adj -RESTART_ADJ_FILENAME= solution_adj -VOLUME_ADJ_FILENAME= adjoint -SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index c70f12056d46..142fa4389f40 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -1,66 +1,41 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 20.05.2020 -% File Version 7.0.4 "Blackbird" % +% Case description: Unit Cell flow around pin array (fluid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% SOLVER= INC_RANS % -% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) KIND_TURB_MODEL= SST % -RESTART_SOL= NO +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OBJECTIVE_WEIGHT= 0.0 % +OPT_OBJECTIVE= NONE % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT -% -% Solve the energy equation in the incompressible flow solver -INC_ENERGY_EQUATION = YES -% -% Initial density for incompressible flows INC_DENSITY_INIT= 1045.0 -% -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) % -% Reference temperature for incompressible flows that include the -% energy equation (1.0 K by default) +INC_ENERGY_EQUATION = YES INC_TEMPERATURE_INIT= 338.0 -% -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. INC_NONDIM= DIMENSIONAL -% -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). SPECIFIC_HEAT_CP= 3540.0 % -% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, -% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) -% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! -FLUID_MODEL= CONSTANT_DENSITY +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 % % --------------------------- VISCOSITY MODEL ---------------------------------% % -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 0.001385 % % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% @@ -68,316 +43,86 @@ MU_CONSTANT= 0.001385 % Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] % = 1.385e-3 * 3540 / 0.42 % = 11.7 -% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, -% POLYNOMIAL_CONDUCTIVITY). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 11.7 % -% Definition of the turbulent thermal conductivity model for RANS -% (CONSTANT_PRANDTL_TURB by default, NONE). TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -% -% Turbulent Prandtl number (0.9 (air) by default) PRANDTL_TURB= 0.90 % % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -% -% Delta P [Pa] value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +%STREAMWISE_PERIODIC_MASSFLOW= 0.85 +%INC_OUTLET_DAMPING= 0.001 % -% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.85 -INC_OUTLET_DAMPING= 0.001 -% -% Use streamwise periodic temperature (default=NO, YES) -% If YES, the heatflux is taken out at the outlet -% This option is only necessary if INC_ENERGY_EQUATION=YES STREAMWISE_PERIODIC_TEMPERATURE= NO % -% Prescibe integrated heat [W] extracted at the periodic "outlet". -% Only active if STREAMWISE_PERIODIC_TEMPERATURE= NO. -% If set to zero, the heat is integrated by the program over the MARKER_HEATFLUX. % inner pin length 0.00376991 m = (0.00322-0.00262)*2*pi % with 5e5 W/m that is Q = 1884.96 STREAMWISE_PERIODIC_OUTLET_HEAT= -1884.96 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) -% -% Symmetry boundary marker(s) (NONE = no marker) -% Implementation identical to MARKER_EULER. MARKER_SYM= ( fluid_symmetry ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) % % Alternative to periodic simulation with velocity inlet and pressure outlet +%MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, \ +% fluid_pin2_interface, 5e5, \ +% fluid_pin3_interface, 5e5 ) +% +% Alternative options for non-periodic flow %INC_INLET_TYPE= VELOCITY_INLET %MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) +% Test vals to hinder outlet backflow +%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) % %INC_OUTLET_TYPE= PRESSURE_OUTLET %MARKER_OUTLET= ( fluid_outlet, 0.0 ) % -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING= ( fluid_pin2_interface ) +MARKER_MONITORING= ( NONE ) % -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. -MARKER_MONITORING= ( fluid_pin2_interface ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). MARKER_ANALYZE_AVERAGE = MASSFLUX % -% Objective function in gradient evaluation -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -% -% List of weighting values when using more than one OBJECTIVE_FUNCTION. -OBJECTIVE_WEIGHT= 0.0 -% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Number of iterations for single-zone problems %ITER= 3500 -% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= GREEN_GAUSS -% -% CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 1e3 % -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1e-15 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 10 % -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, -% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) CONV_NUM_METHOD_FLOW= FDS -% -% 2nd and 4th order artificial dissipation coefficients for -% the JST method ( 0.5, 0.02 by default ) -%JST_SENSOR_COEFF= ( 0.5, 0.05 ) -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_FLOW= NONE -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % -% Convective numerical method (SCALAR_UPWIND) CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_TURB= NONE -% -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Convergence criteria (default=RESIDUAL, CAUCHY) CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -26 -% -% Start convergence criteria at iteration number CONV_STARTITER= 100000000 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -% Mesh input file -%MESH_FILENAME= fluid_FFD.su2 -% -% Mesh input file format (SU2, CGNS) -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution -% -% Output tabular file format (TECPLOT, CSV) -TABULAR_FORMAT= CSV -GRAD_OBJFUNC_FILENAME= of_grad.csv -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history +%MESH_FILENAME= fluid.su2 % -% Writing convergence history frequency -WRT_CON_FREQ= 1 -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) -SCREEN_OUTPUT= (WALL_TIME, INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP, PRESSURE_DROP ) -SCREEN_WRT_FREQ_INNER= 25 -% -%OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) -%VOLUME_FILENAME= flow -%SURFACE_FILENAME= surface_flow -READ_BINARY_RESTART= YES -% -% Writing frequency for volume/surface output -%OUTPUT_WRT_FREQ= 5000 -% -% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) -VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) -% -% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% -% -% Tolerance of the Free-Form Deformation point inversion -FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion -FFD_ITERATIONS= 500 -% -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, -% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) -FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) -% -% -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) -FFD_DEGREE= (8, 1, 0) -% -% Surface grid continuity at the intersection with the faces of the FFD boxes. -% To keep a particular level of surface continuity, SU2 automatically freezes the right -% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) -FFD_CONTINUITY= NO_DERIVATIVE -% -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) -% -% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% -% -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) -DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D -% -% Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface ) -% -% Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) -% - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) -% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) -DV_PARAM= ( 1.0 ) -%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) -% -% Value of the shape deformation -DV_VALUE= 1.0 -%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 -% -% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% -% -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) -DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) -DEFORM_LINEAR_SOLVER_PREC= ILU -% -% Number of smoothing iterations for mesh deformation -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 1 -% -% Minimum residual criteria for the linear solver convergence of grid deformation -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -% -% Print the residuals during mesh deformation to the console (YES, NO) -DEFORM_CONSOLE_OUTPUT= YES -% -% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger -% value is also possible) -DEFORM_COEFF = 1E6 -% -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) -%DEFORM_MESH= YES -% -% Optimization objective function with scaling factor, separated by semicolons. -% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. -% ex= Objective * Scale -OPT_OBJECTIVE= DRAG -% -% Finite difference step size for python scripts (0.001 default, recommended -% 0.001 x REF_LENGTH) -FIN_DIFF_STEP= 0.00001 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 262b4a979092..0d49826f0210 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -2,19 +2,13 @@ % % % SU2 configuration file % % Case description: 2D cylinder array with CHT couplings % -% Author: O. Burghardt, T. Economon % -% Institution: Chair for Scientific Computing, TU Kaiserslautern % -% Date: August 8, 2019 % -% File Version 6.0.1 "Falcon" % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% -% When do I have to use this again!? There was a rather nasty bug I recall if the option is nnot set -%KIND_INTERPOLATION= RADIAL_BASIS_FUNCTION -% SOLVER= MULTIPHYSICS % CONFIG_LIST= (configFluid.cfg, configSolid.cfg) @@ -23,51 +17,34 @@ MARKER_ZONE_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_ % MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_interface, solid_pin2_interface, fluid_pin3_interface, solid_pin3_interface ) % -TIME_DOMAIN = NO -% -SCREEN_OUTPUT= ( OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) -% -HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], HEAT[1], LINSOL[0], LINSOL[1], HEAT[0] ) -% CONV_RESIDUAL_MINVAL= -26 % % Number of total iterations OUTER_ITER= 4000 % -OUTPUT_WRT_FREQ= 1000 -% -SCREEN_WRT_FREQ_OUTER= 25 -% %CHT_ROBIN= NO % -OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) +SCREEN_OUTPUT= ( OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +SCREEN_WRT_FREQ_OUTER= 100 % -% Mesh input file -MESH_FILENAME= 2D-PinArray_FFD.su2 +HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], HEAT[1], LINSOL[0], LINSOL[1], HEAT[0] ) % -%SPECIFIC_HEAT_CP = 871.0 +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) +OUTPUT_WRT_FREQ= 1000 % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FILENAME= 2D-PinArray_FFD.su2 MESH_FORMAT= SU2 % -GRAD_OBJFUNC_FILENAME= of_grad.csv -% % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % -% Tolerance of the Free-Form Deformation point inversion FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 % -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, % 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) % -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) +% FFD box degree: 2D case (x_degree, y_degree, 0) FFD_DEGREE= (8, 1, 0) % % Surface grid continuity at the intersection with the faces of the FFD boxes. @@ -75,75 +52,59 @@ FFD_DEGREE= (8, 1, 0) % number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) FFD_CONTINUITY= NO_DERIVATIVE % -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you don't want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) %DV_KIND= FFD_SETTING -DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) % % Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) % - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) %DV_PARAM= ( 1.0 ) -DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +DV_PARAM= \ +( BOX, 0, 1, 0.0, 1.0);\ +( BOX, 1, 1, 0.0, 1.0);\ +( BOX, 2, 1, 0.0, 1.0);\ +( BOX, 3, 1, 0.0, 1.0);\ +( BOX, 4, 1, 0.0, 1.0);\ +( BOX, 5, 1, 0.0, 1.0);\ +( BOX, 6, 1, 0.0, 1.0);\ +( BOX, 7, 1, 0.0, 1.0);\ +( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation %DV_VALUE= 1.0 -%DV_VALUE= 0.0015,0.015,0.15,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 +% % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % -% Number of smoothing iterations for mesh deformation +DEFORM_NONLINEAR_ITER= 1 DEFORM_LINEAR_SOLVER_ITER= 1000 % -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 10 -% -% Minimum residual criteria for the linear solver convergence of grid deformation -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -% -% Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % % Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger % value is also possible) +% !!! What is this doing !!! DEFORM_COEFF = 1E6 % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +DEFINITION_DV= \ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) + %DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index dedc2fa51458..912b85f2a0a6 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -1,139 +1,70 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (solid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 20.05.2020 -% File Version 7.0.4 "Blackbird" % +% Case description: Unit Cell flow around pin array (solid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% SOLVER= HEAT_EQUATION % -RESTART_SOL= NO +OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OBJECTIVE_WEIGHT= 1.0 +% +OPT_OBJECTIVE= AVG_TOTALTEMP % % ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% % -% !!!!! is this doing s.th. here INC_NONDIM= DIMENSIONAL -% -% Solids temperature at freestream conditions SOLID_TEMPERATURE_INIT= 345.0 -% -% Density used in solids SOLID_DENSITY= 2719 -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). SPECIFIC_HEAT_CP = 871.0 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -% !!!!!! do we need that shit here ??? -% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) -PRANDTL_LAM = 6.99091 -% -% Thermal conductivity used for heat equation -% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later -% used for the viscous res SOLID_THERMAL_CONDUCTIVITY= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) +MARKER_HEATFLUX= (solid_pin1_inner, 5e5, \ + solid_pin2_inner, 5e5, \ + solid_pin3_inner, 5e5, \ + solid_pin1_walls, 0.0, \ + solid_pin2_walls, 0.0, \ + solid_pin3_walls, 0.0) % -MARKER_HEATFLUX= (solid_pin1_inner, 5e5, solid_pin2_inner, 5e5, solid_pin3_inner, 5e5, solid_pin1_walls, 0.0, solid_pin2_walls, 0.0, solid_pin3_walls, 0.0) +%MARKER_ISOTHERMAL= (solid_pin1_inner, 300, solid_pin2_inner, 300, solid_pin3_inner, 300, solid_pin1_walls, 300, solid_pin2_walls, 300, solid_pin3_walls, 300) % % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING = ( solid_pin2_interface ) -% -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. MARKER_MONITORING = ( solid_pin2_inner ) % -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE -% -OBJECTIVE_WEIGHT= 1.0 -% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= GREEN_GAUSS -% -% CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 1e4 % -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% -% !!!! still used! !!! what does it do? -BETA_FACTOR= 50 -% -% !!!! still used! !!! what does it do? -% Maximum Delta Time in local time stepping simulations -MAX_DELTA_TIME= 1.0 -% % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1E-15 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 20 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % +CONV_CRITERIA= RESIDUAL CONV_RESIDUAL_MINVAL= -20 -% CONV_STARTITER= 10000000000 % % -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% % -%!!! this is not used here -CONV_NUM_METHOD_HEAT= SPACE_CENTERED -% -%!!! this is not used here -MUSCL_HEAT= YES -% -% !!! this is not used here -JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) -% -%!!! this is not used here TIME_DISCRE_HEAT= EULER_IMPLICIT % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % %MESH_FILENAME= solid.su2 % -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution -% -VOLUME_FILENAME= heat -SURFACE_FILENAME= surface_heat -READ_BINARY_RESTART= YES -% HISTORY_OUTPUT= (ITER, RMS_RES, HEAT, LINSOL) -% -CONV_FILENAME= history -% -WRT_CON_FREQ= 1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 2d4afaf5a74f..5e98f24df347 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 11355999.999912456, 0.0 , 0.0 , 11355999.999912456, 800.4999999968732, 3207.899999949859, 800.4999999968732, 3207.899999949859, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 0.0 , nan , 0.0 , 0.0 , 0.0 , 3210.000000024138 , 0.0 , 307.8999999388543, 1e-06 +0 , 0.0 , 399999.9724328518, -1.310000000143141, 5.5510000002640306e-08, 399999.9724328518, 2150.0000002561137, 120.00000424450263, -8545.000000026448, 120.00000424450263, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 3.139999998902354 , 0.0 , 0.0 , 0.0 , 0.0 , -5.41000000076064 , -4.639999999500599 , 0.0 , -13.30000001242837, 959.9999998499698 , 0.0 , -350.00000480067683, 1e-08 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg index 9c7c5d70e4fc..0a1384fd02cd 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -13,35 +13,25 @@ % SOLVER= INC_RANS KIND_TURB_MODEL= SST -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF ) % % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % INC_DENSITY_MODEL= CONSTANT -INC_ENERGY_EQUATION = YES -% -% Serves as material parameter INC_DENSITY_INIT= 1045.0 INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) -INC_TEMPERATURE_INIT= 338.0 % -%INC_NONDIM= INITIAL_VALUES -INC_NONDIM= DIMENSIONAL -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Redundant to INC_DENSITY_MODEL -FLUID_MODEL= CONSTANT_DENSITY +INC_ENERGY_EQUATION = YES +INC_TEMPERATURE_INIT= 338.0 SPECIFIC_HEAT_CP= 3540.0 % -% --------------------------- VISCOSITY MODEL ---------------------------------% +INC_NONDIM= DIMENSIONAL % VISCOSITY_MODEL= CONSTANT_VISCOSITY MU_CONSTANT= 0.001385 % +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% % % Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] @@ -55,54 +45,34 @@ PRANDTL_TURB= 0.90 % % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= MASSFLOW -% -% Delta P value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. Was set to 380 before STREAMWISE_PERIODIC_PRESSURE_DROP= 210 -% -% Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. STREAMWISE_PERIODIC_MASSFLOW= 0.009675 -% INC_OUTLET_DAMPING= 0.001 - +% STREAMWISE_PERIODIC_TEMPERATURE= NO STREAMWISE_PERIODIC_OUTLET_HEAT= -17.958584 -%STREAMWISE_PERIODIC_OUTLET_HEAT= -0.000001 -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -%MARKER_HEATFLUX= ( fluid_top, 0.0 ) -MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_bottom_interface, 0.0, fluid_pin1, 0.0, fluid_pin3, 0.0 ) +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % +MARKER_HEATFLUX= ( fluid_top, 0.0, \ + fluid_bottom_interface, 0.0, \ + fluid_pin1, 0.0, \ + fluid_pin3, 0.0 ) MARKER_SYM= ( fluid_sym_sides ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) % % Alternative to periodic simulation %INC_INLET_TYPE= VELOCITY_INLET %MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -% Test vals to hinder outlet backflow -%MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) % %INC_OUTLET_TYPE= PRESSURE_OUTLET %MARKER_OUTLET= ( fluid_outlet, 0.0 ) % -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -MARKER_PLOTTING= ( fluid_bottom_interface, fluid_pin1, fluid_pin2, fluid_pin3 ) MARKER_MONITORING= ( fluid_inlet, fluid_outlet ) % -% Massflow averaged total pressure difference between in- and outlet is the target MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) MARKER_ANALYZE_AVERAGE = MASSFLUX % @@ -119,33 +89,8 @@ LINEAR_SOLVER_PREC= ILU LINEAR_SOLVER_ERROR= 1E-15 LINEAR_SOLVER_ITER= 15 % -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= V_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) -% -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) -% -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 -% % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -%CONV_NUM_METHOD_FLOW= JST -%JST_SENSOR_COEFF= ( 0.5, 0.05 ) CONV_NUM_METHOD_FLOW= FDS MUSCL_FLOW= YES SLOPE_LIMITER_FLOW= NONE @@ -161,30 +106,9 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 18 CONV_RESIDUAL_MINVAL= -26 CONV_STARTITER= 100000000 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -%MESH_FILENAME= /home/kat7rng/scratch/2__Streamwise-Periodic/5__UnitCell4Print/1__Mesh/1__Res1/UnitCellPins.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -GRAD_OBJFUNC_FILENAME= of_grad -% -SOLUTION_ADJ_FILENAME= solution_adj -RESTART_ADJ_FILENAME= restart_adj -VOLUME_ADJ_FILENAME= adjoint -SURFACE_ADJ_FILENAME= surface_adjoint +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index 854c4fa76c53..cc067241cc47 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -1,87 +1,42 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: 2D cylinder array with CHT couplings % -% Author: O. Burghardt, T. Economon % -% Institution: Chair for Scientific Computing, TU Kaiserslautern % -% Date: August 8, 2019 % -% File Version 6.0.1 "Falcon" % +% Case description: 3D cylinder array with CHT couplings % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.08 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= MULTIPHYSICS % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% CONFIG_LIST = (configFluid.cfg, configSolid.cfg) % MARKER_ZONE_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin1, solid_pin1, fluid_pin2, solid_pin2, fluid_pin3, solid_pin3 ) -%MARKER_ZONE_INTERFACE= (fluid_pin2, solid_pin2 ) % MARKER_CHT_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin1, solid_pin1, fluid_pin2, solid_pin2, fluid_pin3, solid_pin3 ) -%MARKER_CHT_INTERFACE= (fluid_pin2, solid_pin2 ) % -TIME_DOMAIN = NO +OUTER_ITER = 15000 +% +CONV_RESIDUAL_MINVAL= -26 % SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], PRESSURE_DROP[0], AVG_TEMPERATURE[1] ) SCREEN_WRT_FREQ_OUTER= 100 % -CONV_RESIDUAL_MINVAL= -26 -% Number of total iterations -OUTER_ITER = 15000 +OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) OUTPUT_WRT_FREQ= 2500 % %CHT_ROBIN= NO % -OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) -% % Mesh input file MESH_FILENAME= 3D_chtPinArray_coarse.su2 -%SPECIFIC_HEAT_CP = 871.0 % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= SU2 - -% These are just default parameters so that we can run SU2_DOT_AD, they have no physical meaning for this test case. - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, -% FFD_SETTING, FFD_NACELLE -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, -% HICKS_HENNE, SURFACE_BUMP) -DV_KIND= HICKS_HENNE +% These are just default parameters so that we can run SU2_DOT_AD, they have no physical meaning for this test case. % -% Marker of the surface in which we are going apply the shape deformation +DV_KIND= HICKS_HENNE DV_MARKER= (fluid_pin2, solid_pin2) -% -% Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) -% - TRANSLATION ( x_Disp, y_Disp, z_Disp ), as a unit vector -% - ROTATION ( x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) -% - SCALE ( 1.0 ) -% - ANGLE_OF_ATTACK ( 1.0 ) -% - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) -% - FFD_NACELLE ( FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Disp, phi_Disp ) -% - FFD_GULL ( FFD_BoxTag, j_Ind ) -% - FFD_ANGLE_OF_ATTACK ( FFD_BoxTag, 1.0 ) -% - FFD_CAMBER ( FFD_BoxTag, i_Ind, j_Ind ) -% - FFD_THICKNESS ( FFD_BoxTag, i_Ind, j_Ind ) -% - FFD_TWIST ( FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) -% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) -% - FFD_CAMBER_2D ( FFD_BoxTag, i_Ind ) -% - FFD_THICKNESS_2D ( FFD_BoxTag, i_Ind ) -% - FFD_TWIST_2D ( FFD_BoxTag, x_Orig, y_Orig ) -% - HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc ) -% - SURFACE_BUMP ( x_Start, x_End, x_Loc ) DV_PARAM= (0.0, 0.5) -% -% Value of the shape deformation DV_VALUE= 0.1 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index c6fc641ab4e2..443be0ed1c38 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -12,52 +12,40 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % SOLVER= HEAT_EQUATION -RESTART_SOL= NO -READ_BINARY_RESTART= YES -% -HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) % % ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% % INC_NONDIM= DIMENSIONAL SOLID_TEMPERATURE_INIT= 345.0 SOLID_DENSITY= 2719 -% -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% SPECIFIC_HEAT_CP = 871.0 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM = 6.99091 -% In solver_direct_heat:224 the thermal diff lambda/(cp * rho) is set and later -% used for the viscous res SOLID_THERMAL_CONDUCTIVITY= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % MARKER_SYM= ( solid_sym_sides) % -%MARKER_ISOTHERMAL= ( solid_bottom_heater, 300 ) +MARKER_HEATFLUX= ( solid_bottom_heater, 5e5, \ + solid_block_inlet, 0.0, \ + solid_block_outlet, 0.0, \ + solid_pin1_inlet, 0.0, \ + solid_pin3_outlet, 0.0, \ + solid_pins_top, 0.0, \ + solid_bottom_interface, 0.0, \ + solid_pin1, 0.0, \ + solid_pin3, 0.0 ) % %MARKER_HEATFLUX= ( solid_bottom_heater, 5e5, solid_block_inlet, 0.0, solid_block_outlet, 0.0, solid_pin1_inlet, 0.0, solid_pin3_outlet, 0.0, solid_pins_top, 0.0 ) -MARKER_HEATFLUX= ( solid_bottom_heater, 5e5, solid_block_inlet, 0.0, solid_block_outlet, 0.0, solid_pin1_inlet, 0.0, solid_pin3_outlet, 0.0, solid_pins_top, 0.0, solid_bottom_interface, 0.0, solid_pin1, 0.0, solid_pin3, 0.0 ) +%MARKER_ISOTHERMAL= ( solid_bottom_heater, 300 ) % % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -MARKER_PLOTTING = (solid_bottom_interface, solid_pin1, solid_pin2, solid_pin3, solid_pins_top) MARKER_MONITORING = ( solid_bottom_heater ) % % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % NUM_METHOD_GRAD= GREEN_GAUSS -% CFL_NUMBER= 1000 -CFL_ADAPT= NO -CFL_ADAPT_PARAM= ( 1.0, 0.8, 100.0, 100000.0 ) -BETA_FACTOR= 50 -MAX_DELTA_TIME= 1.0 % % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -69,32 +57,14 @@ LINEAR_SOLVER_ITER= 15 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -%RESIDUAL_REDUCTION= 10 CONV_RESIDUAL_MINVAL= -20 CONV_STARTITER= 10000000000 % % -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_HEAT = SPACE_CENTERED -MUSCL_HEAT= YES -JST_SENSOR_COEFF_HEAT= ( 0.5, 0.15 ) TIME_DISCRE_HEAT= EULER_IMPLICIT % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -%MESH_FILENAME= /home/kat7rng/scratch/2__Streamwise-Periodic/5__UnitCell4Print/1__Mesh/1__Res1/UnitCellPins.su2 -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_heat -RESTART_FILENAME= solution_heat -% -VOLUME_FILENAME= heat -SURFACE_FILENAME= surface_heat -WRT_CON_FREQ= 1 -WRT_RESIDUALS= YES -WRT_LIMITERS= YES -% -CONV_FILENAME= history -BREAKDOWN_FILENAME= forces_breakdown -VALUE_OBJFUNC_FILENAME= of_eval -GRAD_OBJFUNC_FILENAME= of_grad +HISTORY_OUTPUT= (ITER, RMS_RES, HEAT) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg index 1b2d9f71364f..bde6a715ac7a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg @@ -2,263 +2,91 @@ % % % SU2 configuration file % % Case description: Poiseuille flow case for testing a body force/periodicity % -% Author: Thomas D. Economon % -% Institution: Stanford University % -% Date: 2017.02.27 % -% File Version 6.1.0 "Falcon" % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 20.05.2020 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= INC_NAVIER_STOKES % -% If Navier-Stokes, kind of turbulent model (NONE, SA) -KIND_TURB_MODEL= NONE -% -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) -MATH_PROBLEM= DIRECT -% -% Restart solution (NO, YES) -RESTART_SOL= NO -% -% Read binary restart files (YES, NO) -READ_BINARY_RESTART= NO - -% ---------------------------- ENERGY EQUATION -------------------------------% -% -INC_ENERGY_EQUATION= YES -% -SPECIFIC_HEAT_CP= 3540.0 -% -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -PRANDTL_LAM= 1.17 -% -%TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -% -%PRANDTL_TURB= 0.90 -% -% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% -% -% Reference origin for moment computation (m or in) -REF_ORIGIN_MOMENT_X = 0.25 -REF_ORIGIN_MOMENT_Y = 0.00 -REF_ORIGIN_MOMENT_Z = 0.00 -% -% Reference length for pitching, rolling, and yawing non-dimensional -% moment (m or in) -REF_LENGTH= 0.001 -% -% Reference area for force coefficients (0 implies automatic -% calculation) (m^2 or in^2) -REF_AREA= 1.0 -% % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT -% -% Initial density for incompressible flows -% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) INC_DENSITY_INIT= 1.0 -% -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) -% -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. INC_NONDIM= DIMENSIONAL % -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) -FLUID_MODEL= CONSTANT_DENSITY -% % --------------------------- VISCOSITY MODEL ---------------------------------% % -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 1e-4 % +% ---------------------------- ENERGY EQUATION -------------------------------% +% +INC_ENERGY_EQUATION= YES +SPECIFIC_HEAT_CP= 3540.0 +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 1.17 +% % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= MASSFLOW -STREAMWISE_PERIODIC_TEMPERATURE= YES -% -% Delta P value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. +STREAMWISE_PERIODIC_MASSFLOW= 0.0027 STREAMWISE_PERIODIC_PRESSURE_DROP= 8.0 +INC_OUTLET_DAMPING= 0.1 % -% Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.0027 +STREAMWISE_PERIODIC_TEMPERATURE= YES % -INC_OUTLET_DAMPING= 0.1 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -MARKER_HEATFLUX= ( fluid_top, 0.0, fluid_pin_interface, 5e5 ) -% -% Symmetry boundary marker(s) (NONE = no marker) +MARKER_HEATFLUX= ( fluid_top, 0.0, \ + fluid_pin_interface, 5e5 ) MARKER_SYM= ( fluid_sym ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( inlet, outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.008,0.0,0.0 ) % -% Marker(s) of the surface to be plotted or designed -MARKER_PLOTTING= ( inlet ) -% -% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( fluid_pin_interface ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) MARKER_ANALYZE = ( inlet, outlet ) +MARKER_ANALYZE_AVERAGE = MASSFLUX % -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). -%MARKER_ANALYZE_AVERAGE = AREA - -% Kind of adaptation (needed to create the initial periodic mesh) -%KIND_ADAPT= PERIODIC - % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -% -% Courant-Friedrichs-Lewy condition of the finest grid CFL_NUMBER= 1e4 -% -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% -% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, -% CFL max value ) -CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) -% -% Number of total iterations ITER= 400 - +% % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver for implicit formulations (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1E-15 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 20 - +% % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= FDS -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -% -% Coefficient for the limiter (smooth regions) VENKAT_LIMITER_COEFF= 0.03 -% -% 2nd and 4th order artificial dissipation coefficients -JST_SENSOR_COEFF= ( 0.5, 0.04 ) -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % -% Convective numerical method (SCALAR_UPWIND) +KIND_TURB_MODEL= NONE CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Convergence criteria (CAUCHY, RESIDUAL) +% --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -24 -% -% Start convergence criteria at iteration number CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % -% Mesh input file MESH_FILENAME= channel_bump_2D.su2 % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= SU2 -% -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= solution_flow -% -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj -% -% Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FILES= (RESTART_ASCII, PARAVIEW_ASCII, SURFACE_PARAVIEW_ASCII) -OUTPUT_WRT_FREQ= 100 -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Output file restart flow -RESTART_FILENAME= restart_flow -% -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj -% -% Output file flow (w/o extension) variables -VOLUME_FILENAME= flow -% -% Output file adjoint (w/o extension) variables -VOLUME_ADJ_FILENAME= adjoint -% -% Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad -% -% Output file surface flow coefficient (w/o extension) -SURFACE_FILENAME= surface_flow -% -% Output file surface adjoint coefficient (w/o extension) -SURFACE_ADJ_FILENAME= surface_adjoint -% -% Writing solution file frequency -WRT_SOL_FREQ= 400 -% -% Writing convergence history frequency -WRT_CON_FREQ= 1 -% -WRT_RESIDUALS= YES +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg index 89615b6391c7..c054326f6e04 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg @@ -1,66 +1,37 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 20.05.2020 -% File Version 7.0.4 "Blackbird" % +% Case description: Unit Cell flow around pin array (fluid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% SOLVER= INC_RANS % -% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) KIND_TURB_MODEL= SST % -RESTART_SOL= NO -% % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT -% -% Solve the energy equation in the incompressible flow solver -INC_ENERGY_EQUATION = YES -% -% Initial density for incompressible flows INC_DENSITY_INIT= 1045.0 -% -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) % -% Reference temperature for incompressible flows that include the -% energy equation (1.0 K by default) +INC_ENERGY_EQUATION = YES INC_TEMPERATURE_INIT= 338.0 -% -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. INC_NONDIM= DIMENSIONAL -% -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). SPECIFIC_HEAT_CP= 3540.0 % -% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, -% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) -% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! -FLUID_MODEL= CONSTANT_DENSITY +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 % % --------------------------- VISCOSITY MODEL ---------------------------------% % -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 0.001385 % % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% @@ -68,224 +39,100 @@ MU_CONSTANT= 0.001385 % Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] % = 1.385e-3 * 3540 / 0.42 % = 11.7 -% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, -% POLYNOMIAL_CONDUCTIVITY). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 11.7 % -% Definition of the turbulent thermal conductivity model for RANS -% (CONSTANT_PRANDTL_TURB by default, NONE). TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -% -% Turbulent Prandtl number (0.9 (air) by default) PRANDTL_TURB= 0.90 % % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -% -% Delta P [Pa] value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 +%STREAMWISE_PERIODIC_MASSFLOW= 0.85 +%INC_OUTLET_DAMPING= 0.01 % -% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. -STREAMWISE_PERIODIC_MASSFLOW= 0.85 -INC_OUTLET_DAMPING= 0.01 -% -% Use streamwise periodic temperature (default=NO, YES) -% If YES, the heatflux is taken out at the outlet -% This option is only necessary if INC_ENERGY_EQUATION=YES STREAMWISE_PERIODIC_TEMPERATURE= YES % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) -% -% Symmetry boundary marker(s) (NONE = no marker) -% Implementation identical to MARKER_EULER. +MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, \ + fluid_pin2_interface, 5e5, \ + fluid_pin3_interface, 5e5 ) MARKER_SYM= ( fluid_symmetry ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) % % Alternative to periodic simulation with velocity inlet and pressure outlet %INC_INLET_TYPE= VELOCITY_INLET %MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -% %INC_OUTLET_TYPE= PRESSURE_OUTLET %MARKER_OUTLET= ( fluid_outlet, 0.0 ) % -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING= ( fluid_pin2_interface ) -% -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. MARKER_MONITORING= ( fluid_pin2_interface ) % -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). MARKER_ANALYZE_AVERAGE = MASSFLUX % -% Objective function in gradient evaluation -OBJECTIVE_FUNCTION= DRAG -% -% List of weighting values when using more than one OBJECTIVE_FUNCTION. -OBJECTIVE_WEIGHT= 1.0 -% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Number of iterations for single-zone problems ITER= 3500 -% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= GREEN_GAUSS -% -% CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 1e2 % -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1e-3 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 20 % -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, -% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) CONV_NUM_METHOD_FLOW= FDS -% -% 2nd and 4th order artificial dissipation coefficients for -% the JST method ( 0.5, 0.02 by default ) -%JST_SENSOR_COEFF= ( 0.5, 0.05 ) -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_FLOW= NONE % -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % -% Convective numerical method (SCALAR_UPWIND) CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_TURB= NONE % -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Convergence criteria (default=RESIDUAL, CAUCHY) CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -26 -% -% Start convergence criteria at iteration number CONV_STARTITER= 100000000 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -% Mesh input file MESH_FILENAME= fluid_FFD.su2 % -% Mesh input file format (SU2, CGNS) -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Writing convergence history frequency -WRT_CON_FREQ= 1 -% -% Output tabular file format (TECPLOT, CSV) -TABULAR_FORMAT= CSV -GRAD_OBJFUNC_FILENAME= of_grad.csv -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) SCREEN_WRT_FREQ_INNER= 25 % -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow -READ_BINARY_RESTART= YES -% -% Writing frequency for volume/surface output -OUTPUT_WRT_FREQ= 5000 +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) % -% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) +OUTPUT_WRT_FREQ= 5000 % % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % -% Tolerance of the Free-Form Deformation point inversion FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 % -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, % 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) % -% -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) +% FFD box degree: 2D case (x_degree, y_degree, 0) FFD_DEGREE= (8, 1, 0) % % Surface grid continuity at the intersection with the faces of the FFD boxes. @@ -293,32 +140,28 @@ FFD_DEGREE= (8, 1, 0) % number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) FFD_CONTINUITY= NO_DERIVATIVE % -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) -% % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation DV_MARKER= ( fluid_pin2_interface ) % % Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) % - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) DV_PARAM= ( 1.0 ) -%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +%DV_PARAM= \ +%( BOX, 0, 1, 0.0, 1.0);\ +%( BOX, 1, 1, 0.0, 1.0);\ +%( BOX, 2, 1, 0.0, 1.0);\ +%( BOX, 3, 1, 0.0, 1.0);\ +%( BOX, 4, 1, 0.0, 1.0);\ +%( BOX, 5, 1, 0.0, 1.0);\ +%( BOX, 6, 1, 0.0, 1.0);\ +%( BOX, 7, 1, 0.0, 1.0);\ +%( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation DV_VALUE= 1.0 @@ -326,51 +169,32 @@ DV_VALUE= 1.0 % % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) DEFORM_LINEAR_SOLVER_PREC= ILU -% -% Number of smoothing iterations for mesh deformation -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 1 -% -% Minimum residual criteria for the linear solver convergence of grid deformation DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +DEFORM_NONLINEAR_ITER= 1 +DEFORM_LINEAR_SOLVER_ITER= 1000 % -% Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % % Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger % value is also possible) +% !!! What is this doing !!! DEFORM_COEFF = 1E6 % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +DEFINITION_DV= \ +( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES % -% Optimization objective function with scaling factor, separated by semicolons. -% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. -% ex= Objective * Scale -OPT_OBJECTIVE= DRAG -% % Finite difference step size for python scripts (0.001 default, recommended % 0.001 x REF_LENGTH) -FIN_DIFF_STEP= 0.00001 +FIN_DIFF_STEP= 1e-6 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg index 46982aae0a1d..65548b50b283 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg @@ -1,66 +1,37 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 20.05.2020 -% File Version 7.0.4 "Blackbird" % +% Case description: Unit Cell flow around pin array (fluid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% SOLVER= INC_RANS % -% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) KIND_TURB_MODEL= SST % -RESTART_SOL= NO -% % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT -% -% Solve the energy equation in the incompressible flow solver -INC_ENERGY_EQUATION = YES -% -% Initial density for incompressible flows INC_DENSITY_INIT= 1045.0 -% -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) % -% Reference temperature for incompressible flows that include the -% energy equation (1.0 K by default) +INC_ENERGY_EQUATION = YES INC_TEMPERATURE_INIT= 338.0 -% -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. INC_NONDIM= DIMENSIONAL -% -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). SPECIFIC_HEAT_CP= 3540.0 % -% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, -% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) -% !!!!!!!!!!!!!Is this option really necessary here?!!!!!!!!!!!!!!!! -FLUID_MODEL= CONSTANT_DENSITY +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 % % --------------------------- VISCOSITY MODEL ---------------------------------% % -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 0.001385 % % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% @@ -68,228 +39,101 @@ MU_CONSTANT= 0.001385 % Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] % = 1.385e-3 * 3540 / 0.42 % = 11.7 -% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, -% POLYNOMIAL_CONDUCTIVITY). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 11.7 % -% Definition of the turbulent thermal conductivity model for RANS -% (CONSTANT_PRANDTL_TURB by default, NONE). TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -% -% Turbulent Prandtl number (0.9 (air) by default) PRANDTL_TURB= 0.90 % % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= MASSFLOW -% -% Delta P [Pa] value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. -STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -% -% Target massflow [kg/s]. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. Default value 1.0. -% Use INC_OUTLET_DAMPING as a relaxation factor. Default value 0.1 is a good start. STREAMWISE_PERIODIC_MASSFLOW= 0.85 -% +STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 INC_OUTLET_DAMPING= 0.0001 % -% Use streamwise periodic temperature (default=NO, YES) -% If YES, the heatflux is taken out at the outlet -% This option is only necessary if INC_ENERGY_EQUATION=YES STREAMWISE_PERIODIC_TEMPERATURE= NO -% -% Cummulated pin arc-length/area is one full circle = 2*pi*r = 2*pi*0.002 -% Integrated heatflux into the domain is Area*const-heatflux = 2*pi*r*5e5 = 6283.185307 STREAMWISE_PERIODIC_OUTLET_HEAT= -6283.185307 -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, fluid_pin2_interface, 5e5, fluid_pin3_interface, 5e5 ) +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Symmetry boundary marker(s) (NONE = no marker) -% Implementation identical to MARKER_EULER. +MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, \ + fluid_pin2_interface, 5e5, \ + fluid_pin3_interface, 5e5 ) MARKER_SYM= ( fluid_symmetry ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) % % Alternative to periodic simulation with velocity inlet and pressure outlet %INC_INLET_TYPE= VELOCITY_INLET %MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -% %INC_OUTLET_TYPE= PRESSURE_OUTLET %MARKER_OUTLET= ( fluid_outlet, 0.0 ) % -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% % ------------------------ SURFACES IDENTIFICATION ----------------------------% % -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING= ( fluid_pin2_interface ) -% -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. MARKER_MONITORING= ( fluid_pin2_interface ) % -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). MARKER_ANALYZE_AVERAGE = MASSFLUX % -% Objective function in gradient evaluation -OBJECTIVE_FUNCTION= DRAG -% -% List of weighting values when using more than one OBJECTIVE_FUNCTION. -OBJECTIVE_WEIGHT= 1.0 -% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Number of iterations for single-zone problems ITER= 3500 -% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= GREEN_GAUSS -% -% CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 1e2 % -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1e-3 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 20 % -% -------------------------- MULTIGRID PARAMETERS -----------------------------% -% -% Multi-grid levels (0 = no multi-grid) -MGLEVEL= 0 -% % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, -% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) CONV_NUM_METHOD_FLOW= FDS -% -% 2nd and 4th order artificial dissipation coefficients for -% the JST method ( 0.5, 0.02 by default ) -%JST_SENSOR_COEFF= ( 0.5, 0.05 ) -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_FLOW= NONE % -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % -% Convective numerical method (SCALAR_UPWIND) CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_TURB= NONE % -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Convergence criteria (default=RESIDUAL, CAUCHY) CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -26 -% -% Start convergence criteria at iteration number CONV_STARTITER= 100000000 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -% Mesh input file MESH_FILENAME= fluid_FFD.su2 % -% Mesh input file format (SU2, CGNS) -MESH_FORMAT= SU2 -% -SOLUTION_FILENAME= solution_flow -RESTART_FILENAME= solution_flow -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Writing convergence history frequency -WRT_CON_FREQ= 1 -% -% Output tabular file format (TECPLOT, CSV) -TABULAR_FORMAT= CSV -GRAD_OBJFUNC_FILENAME= of_grad.csv -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) -% -% History output groups (use 'SU2_CFD -d ' to view list of available fields) -SCREEN_OUTPUT= ( INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP ) +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) SCREEN_WRT_FREQ_INNER= 25 % -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, PARAVIEW_LEGACY ) -VOLUME_FILENAME= flow -SURFACE_FILENAME= surface_flow -READ_BINARY_RESTART= YES -% -% Writing frequency for volume/surface output -OUTPUT_WRT_FREQ= 5000 +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) % -% Volume output fields/groups (use 'SU2_CFD -d ' to view list of available fields) +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) +OUTPUT_WRT_FREQ= 5000 % % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % -% Tolerance of the Free-Form Deformation point inversion FFD_TOLERANCE= 1E-10 -% -% Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 % -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, % 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) % -% -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) +% FFD box degree: 2D case (x_degree, y_degree, 0) FFD_DEGREE= (8, 1, 0) % % Surface grid continuity at the intersection with the faces of the FFD boxes. @@ -297,32 +141,28 @@ FFD_DEGREE= (8, 1, 0) % number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) FFD_CONTINUITY= NO_DERIVATIVE % -% Definition of the FFD planes to be frozen in the FFD (x,y,z). -% Value from 0 FFD degree in that direction. Pick a value larger than degree if you dont want to fix any plane. -%FFD_FIX_I= (0,2,3) -%FFD_FIX_J= (0,2,3) -%FFD_FIX_K= (0,2,3) -% % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, -% FFD_SETTING, FFD_NACELLE, -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, -% FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D +%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation DV_MARKER= ( fluid_pin2_interface ) % % Parameters of the shape deformation -% - NO_DEFORMATION ( 1.0 ) % - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) DV_PARAM= ( 1.0 ) -%DV_PARAM= ( BOX, 0, 0, 0.0, 1.0);( BOX, 1, 0, 0.0, 1.0); ( BOX, 2, 0, 0.0, 1.0); ( BOX, 3, 0, 0.0, 1.0); ( BOX, 4, 0, 0.0, 1.0); ( BOX, 5, 0, 0.0, 1.0); ( BOX, 6, 0, 0.0, 1.0); ( BOX, 7, 0, 0.0, 1.0); ( BOX, 8, 0, 0.0, 1.0); ( BOX, 0, 1, 0.0, 1.0); ( BOX, 1, 1, 0.0, 1.0); ( BOX, 2, 1, 0.0, 1.0); ( BOX, 3, 1, 0.0, 1.0); ( BOX, 4, 1, 0.0, 1.0); ( BOX, 5, 1, 0.0, 1.0); ( BOX, 6, 1, 0.0, 1.0); ( BOX, 7, 1, 0.0, 1.0); ( BOX, 8, 1, 0.0, 1.0) +%DV_PARAM= \ +%( BOX, 0, 1, 0.0, 1.0);\ +%( BOX, 1, 1, 0.0, 1.0);\ +%( BOX, 2, 1, 0.0, 1.0);\ +%( BOX, 3, 1, 0.0, 1.0);\ +%( BOX, 4, 1, 0.0, 1.0);\ +%( BOX, 5, 1, 0.0, 1.0);\ +%( BOX, 6, 1, 0.0, 1.0);\ +%( BOX, 7, 1, 0.0, 1.0);\ +%( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation DV_VALUE= 1.0 @@ -330,51 +170,32 @@ DV_VALUE= 1.0 % % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) DEFORM_LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) DEFORM_LINEAR_SOLVER_PREC= ILU -% -% Number of smoothing iterations for mesh deformation -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 1 -% -% Minimum residual criteria for the linear solver convergence of grid deformation DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +DEFORM_NONLINEAR_ITER= 1 +DEFORM_LINEAR_SOLVER_ITER= 1000 % -% Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % % Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger % value is also possible) +% !!! What is this doing !!! DEFORM_COEFF = 1E6 % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 -% -% Available design variables -% 2D Design variables -% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) -% FFD_CONTROL_POINT (X) -%DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 1.0, 0.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 1.0, 0.0 ) - -% FFD_CONTROL_POINT (Y) -DEFINITION_DV= ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 0, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); ( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +DEFINITION_DV= \ +( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); \ +( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES % -% Optimization objective function with scaling factor, separated by semicolons. -% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. -% ex= Objective * Scale -OPT_OBJECTIVE= DRAG -% % Finite difference step size for python scripts (0.001 default, recommended % 0.001 x REF_LENGTH) -FIN_DIFF_STEP= 0.00001 +FIN_DIFF_STEP= 1e-6 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index 27fe9cac670a..35680ee28916 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -1,227 +1,86 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Poiseuille flow case for testing a body force/periodicity % -% Author: Thomas D. Economon % -% Institution: Stanford University % -% Date: 2017.02.27 % -% File Version 6.1.0 "Falcon" % +% Case description: Poiseuille flow for testing a body force/periodicity % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.14 % +% File Version 7.0.8 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= INC_NAVIER_STOKES % -% If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= NONE % -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) -MATH_PROBLEM= DIRECT -% -% Restart solution (NO, YES) -RESTART_SOL= NO -% -HISTORY_OUTPUT= (FLOW_COEFF, LINSOL) - % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. INC_DENSITY_MODEL= CONSTANT -% -% Solve the energy equation in the incompressible flow solver INC_ENERGY_EQUATION = NO -% -% Initial density for incompressible flows -% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) INC_DENSITY_INIT= 1.0 -% -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) -INC_VELOCITY_INIT= ( 0.0, 0.0, 1.0 ) -% -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. -%INC_NONDIM= INITIAL_VALUES +INC_VELOCITY_INIT= ( 0.0, 0.0, 0.3 ) INC_NONDIM= DIMENSIONAL % -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) -FLUID_MODEL= CONSTANT_DENSITY -% % --------------------------- VISCOSITY MODEL ---------------------------------% % -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 1.8e-5 % % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Specify type of streamwise periodicty (NONE, PRESSURE_DROP, MASSFLOW) -%KIND_STREAMWISE_PERIODIC= MASSFLOW KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -% -% Delta P value that drives the flow as a source term in the momentum equations. -% Defaults to 1.0. STREAMWISE_PERIODIC_PRESSURE_DROP= 0.001 % -% Target massflow. Necessary pressure drop is determined iteratively. -% Initial value is given via STREAMWISE_PERIODIC_PRESSURE_DROP. -% Use INC_OUTLET_DAMPING as a relaxation factor. -STREAMWISE_PERIODIC_MASSFLOW= 0.00270 - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) MARKER_HEATFLUX= (wall, 0.0) -% -% Symmetry boundary marker(s) (NONE = no marker) -%MARKER_SYM= ( fluid_sym ) -% -% Periodic boundary marker(s) (NONE = no marker) -% Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, -% rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, -% rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) MARKER_PERIODIC= ( inlet, outlet, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0005 ) % -% Marker(s) of the surface to be plotted or designed MARKER_PLOTTING= ( inlet ) -% -% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated -MARKER_MONITORING= (wall) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_MONITORING= ( wall ) MARKER_ANALYZE = ( oulet ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). MARKER_ANALYZE_AVERAGE = AREA - -% Kind of adaptation (needed to create the initial periodic mesh) -%KIND_ADAPT= PERIODIC - +% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -% -% Courant-Friedrichs-Lewy condition of the finest grid +%CFL_NUMBER= 1e10 CFL_NUMBER= 50000 -% -% Adaptive CFL number (NO, YES) +%CFL_ADAPT= YES CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 0.5, 10, 15.0, 1e30 ) +ITER= 15000 % -% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, -% CFL max value ) -CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) -% -% Number of total iterations -ITER= 20000 - % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % -% Linear solver for implicit formulations (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1E-15 +LINEAR_SOLVER_ITER= 10 % -% Max number of iterations of the linear solver for the implicit formulation -LINEAR_SOLVER_ITER= 20 - % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= FDS -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -% -% Coefficient for the limiter (smooth regions) -VENKAT_LIMITER_COEFF= 0.03 -% -% 2nd and 4th order artificial dissipation coefficients -JST_SENSOR_COEFF= ( 0.5, 0.04 ) -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +SLOPE_LIMITER_FLOW= NONE TIME_DISCRE_FLOW= EULER_IMPLICIT - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Convergence criteria (CAUCHY, RESIDUAL) +% --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -24 -% -% Start convergence criteria at iteration number CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % -% Mesh input file MESH_FILENAME= pipe1cell3D.su2 % -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= SU2 -% -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= solution_flow -% -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj -% -% Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW, PARAVIEW_MULTIBLOCK, SURFACE_PARAVIEW_ASCII, SURFACE_TECPLOT_ASCII ) -OUTPUT_WRT_FREQ= 10 -% -% Output file convergence history (w/o extension) -%CONV_FILENAME= history -% -% Output file restart flow -RESTART_FILENAME= solution_flow -% -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj -% -% Output file flow (w/o extension) variables -VOLUME_FILENAME= flow -% -% Output file adjoint (w/o extension) variables -VOLUME_ADJ_FILENAME= adjoint -% -% Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad -% -% Output file surface flow coefficient (w/o extension) -SURFACE_FILENAME= surface_flow -% -% Output file surface adjoint coefficient (w/o extension) -SURFACE_ADJ_FILENAME= surface_adjoint +OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK, SURFACE_TECPLOT_ASCII ) +OUTPUT_WRT_FREQ= 1000 % -% Writing solution file frequency -WRT_SOL_FREQ= 200 +HISTORY_OUTPUT= ( RMS_RES, FLOW_COEFF, STREAMWISE_PERIODIC, LINSOL ) % -% Writing convergence history frequency -WRT_CON_FREQ= 1 +SCREEN_OUTPUT= ( INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Z, STREAMWISE_MASSFLOW ) +SCREEN_WRT_FREQ_INNER= 100 diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 18391ed738df..46bd671005b8 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -46,7 +46,7 @@ def main(): streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" streamwise_periodic_cylinder.test_iter = 30 streamwise_periodic_cylinder.test_vals = [30.000000, -7.819176, -6.796437, -6.969024] #last 4 lines - streamwise_periodic_cylinder.su2_exec = "parallel_computation.py -f" + streamwise_periodic_cylinder.su2_exec = "mpirun -n 2 SU2_CFD" streamwise_periodic_cylinder.timeout = 1600 streamwise_periodic_cylinder.tol = 0.00001 test_list.append(streamwise_periodic_cylinder) @@ -56,8 +56,8 @@ 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 = [10, -10.352122, -10.185237, -10.185237] #last 4 lines - sp_pipeSlice_3d_dp_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -8.694310, -0.000023] #last 4 lines + sp_pipeSlice_3d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pipeSlice_3d_dp_hf_tp.timeout = 1600 sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pipeSlice_3d_dp_hf_tp) @@ -68,10 +68,10 @@ def main(): sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 25 sp_pinArray_2d_dp_hf_tp.test_vals = [-4.667133, 1.395801, -0.709306, 208.023676] #last 4 lines - sp_pinArray_2d_dp_hf_tp.su2_exec = "parallel_computation.py -f" + sp_pinArray_2d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_2d_dp_hf_tp.timeout = 1600 sp_pinArray_2d_dp_hf_tp.tol = 0.00001 - test_list.append(sp_pinArray_2d_dp_hf_tp) + #test_list.append(sp_pinArray_2d_dp_hf_tp) # 2D pin case massflow periodic with heatflux BC and prescribed heat sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') @@ -79,7 +79,7 @@ def main(): sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 25 sp_pinArray_2d_mf_hf.test_vals = [-4.666406, 1.398210, -0.710070, 208.677550] #last 4 lines - sp_pinArray_2d_mf_hf.su2_exec = "parallel_computation.py -f" + sp_pinArray_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_2d_mf_hf.timeout = 1600 sp_pinArray_2d_mf_hf.tol = 0.00001 test_list.append(sp_pinArray_2d_mf_hf) @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.768252, -4.048246, -4.130988, -4.048246] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.054813, -4.137121, -4.054813] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From 889f326cbe72f4d7f7aa11d9c6c252c7a5c9d2e2 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 17 Dec 2020 18:13:23 +0100 Subject: [PATCH 106/326] Move GetStreamwise Properties --- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 25 ++++++++++--------- SU2_CFD/include/solvers/CSolver.hpp | 12 --------- .../half_cylinder_2D/half_cylinder_2D.cfg | 4 ++- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 505d11dfd771..e80fbfc1f04a 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -46,6 +46,19 @@ class CIncEulerSolver : public CFVMFlowSolverBase Date: Sun, 20 Dec 2020 12:07:50 +0100 Subject: [PATCH 107/326] Introduced more general treatment of forcing --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 53 +++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 2d6185a2149b..d978279ac68c 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -40,6 +40,35 @@ # Config class # ---------------------------------------------------------------------- +class ImposedMotionFunction: + + def __init__(self,time0,type,parameters): + self.time0 = time0 + self.type = type + for case in switch(self.type) + if case("SINUSOIDAL"): + self.bias = parameters[0] + self.amplitude = parameters[1] + self.frequency = parameters[2] + + + def GetDispl(self,time): + for case in switch(self.type): + if case("SINUSOIDAL"): + return self.bias+self.amplitude*sin(2*pi*self.frequency*(time-self.time0)) + + def GetVel(self,time): + for case in switch(self.type): + if case("SINUSOIDAL"): + return self.amplitude*cos(2*pi*self.frequency*(time-self.time0))*2*pi*self.frequency + + def GetAcc(self,time): + for case in switch(self.type): + if case("SINUSOIDAL"): + return -self.amplitude*sin(2*pi*self.frequency*(time-self.time0))*(2*pi*self.frequency)**2 + + + class RefSystem: def __init__(self): @@ -222,6 +251,8 @@ def __init__(self, config_fileName, ImposedMotion): self.node = [] self.markers = {} self.refsystems = [] + self.ImposedMotionToSet = True + self.ImposedMotionFunction = [] print("\n------------------------------ Reading the mesh ------------------------------") self.__readNastranMesh() @@ -268,7 +299,6 @@ def __readConfig(self): for case in switch(this_param): #integer values if case("NMODES") : pass - if case("IMPOSED_MODE") : pass if case("RESTART_ITER") : self.Config[this_param] = int(this_value) break @@ -285,15 +315,14 @@ def __readConfig(self): if case("MESH_FILE") : pass if case("PUNCH_FILE") : pass if case("RESTART_SOL") : pass - if case("IMPOSED_DISP") : pass - if case("IMPOSED_VEL") : pass - if case("IMPOSED_ACC") : pass if case("MOVING_MARKER") : self.Config[this_param] = this_value break #lists values - if case("INITIAL_MODES"): + if case("INITIAL_MODES"): pass + if case("IMPOSED_MODES"): pass + if case("IMPOSED_PARAMETERS"): self.Config[this_param] = eval(this_value) break @@ -411,7 +440,7 @@ def nastran_float(s): for iPoint in range(self.nPoint): if self.node[iPoint].GetID() == ID: break - self.markers[self.FSI_marker].append(iPoint) + self.markers[markerTag].append(iPoint) existValue = len(line)>=1 continue @@ -699,10 +728,14 @@ def __temporalIteration(self,time): self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot else: - self.q[self.Config["IMPOSED_MODE"]] = eval(self.Config["IMPOSED_DISP"]) - self.qdot[self.Config["IMPOSED_MODE"]] = eval(self.Config["IMPOSED_VEL"]) - self.qddot[self.Config["IMPOSED_MODE"]] = eval(self.Config["IMPOSED_ACC"]) - self.a = np.copy(self.qddot) + for imode in self.Config["IMPOSED_MODES"].keys(): + if ImposedMotionToSet: + self.ImposedMotionFunction.append(ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode])) + ImposedMotionToSet = False + self.q[imode] = self.ImposedMotionFunction[imode].GetDispl(time) + self.qdot[imode] = self.ImposedMotionFunction[imode].GetVel(time) + self.qddot[imode] = self.ImposedMotionFunction[imode].GetAcc(time) + self.a = np.copy(self.qddot) def __SetLoads(self): From f522bb5f7d11fbb1459e56917b6141f7f1b951ff Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 21 Dec 2020 09:45:15 +0100 Subject: [PATCH 108/326] Small bug in for statement --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index d978279ac68c..6d3ff8ac47a4 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -45,7 +45,7 @@ class ImposedMotionFunction: def __init__(self,time0,type,parameters): self.time0 = time0 self.type = type - for case in switch(self.type) + for case in switch(self.type): if case("SINUSOIDAL"): self.bias = parameters[0] self.amplitude = parameters[1] From aa2eb2360ef9a472816f05c6d4328a3e83505b83 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 21 Dec 2020 10:10:55 +0100 Subject: [PATCH 109/326] Small bug with variable name --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 6d3ff8ac47a4..2e834a5440ef 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -729,9 +729,9 @@ def __temporalIteration(self,time): self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot else: for imode in self.Config["IMPOSED_MODES"].keys(): - if ImposedMotionToSet: + if self.ImposedMotionToSet: self.ImposedMotionFunction.append(ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode])) - ImposedMotionToSet = False + self.ImposedMotionToSet = False self.q[imode] = self.ImposedMotionFunction[imode].GetDispl(time) self.qdot[imode] = self.ImposedMotionFunction[imode].GetVel(time) self.qddot[imode] = self.ImposedMotionFunction[imode].GetAcc(time) From 4ebf81b9afed13f6f4653b7046c3a325f235c02f Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 21 Dec 2020 10:33:32 +0100 Subject: [PATCH 110/326] Fixing switch statement --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 2e834a5440ef..43eaa3629ee8 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -50,22 +50,29 @@ def __init__(self,time0,type,parameters): self.bias = parameters[0] self.amplitude = parameters[1] self.frequency = parameters[2] + break + if case(): + print(self.type + " is an invalid option !") + break def GetDispl(self,time): for case in switch(self.type): if case("SINUSOIDAL"): return self.bias+self.amplitude*sin(2*pi*self.frequency*(time-self.time0)) + break def GetVel(self,time): for case in switch(self.type): if case("SINUSOIDAL"): return self.amplitude*cos(2*pi*self.frequency*(time-self.time0))*2*pi*self.frequency + break def GetAcc(self,time): for case in switch(self.type): if case("SINUSOIDAL"): return -self.amplitude*sin(2*pi*self.frequency*(time-self.time0))*(2*pi*self.frequency)**2 + break From 3a8044a9f7d8a335dfb6f42cba9dd80e42f996fc Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 21 Dec 2020 11:47:02 +0100 Subject: [PATCH 111/326] Introduced blended step --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 43eaa3629ee8..d3bfda96033f 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -51,8 +51,16 @@ def __init__(self,time0,type,parameters): self.amplitude = parameters[1] self.frequency = parameters[2] break + if case("BLENDED_STEP"): + self.kmax = parameters[0] + self.vinf = parameters[1] + self.lref = parameters[2] + self.amplitude = parameters[3] + self.tmax = 2*pi/self.kmax*self.lref/self.vinf + self.omega0 = 1/2*self.kmax + break if case(): - print(self.type + " is an invalid option !") + sys.exit('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.type)) break @@ -61,19 +69,33 @@ def GetDispl(self,time): if case("SINUSOIDAL"): return self.bias+self.amplitude*sin(2*pi*self.frequency*(time-self.time0)) break + if case("BLENDED_STEP"): + if time < self.tmax: + return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) + return self.amplitude + break def GetVel(self,time): for case in switch(self.type): if case("SINUSOIDAL"): return self.amplitude*cos(2*pi*self.frequency*(time-self.time0))*2*pi*self.frequency break + if case("BLENDED_STEP"): + if time < self.tmax: + return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) + return 0.0 + break def GetAcc(self,time): for case in switch(self.type): if case("SINUSOIDAL"): return -self.amplitude*sin(2*pi*self.frequency*(time-self.time0))*(2*pi*self.frequency)**2 break - + if case("BLENDED_STEP"): + if time < self.tmax: + return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 + return 0.0 + break class RefSystem: @@ -334,7 +356,7 @@ def __readConfig(self): break if case(): - print(this_param + " is an invalid option !") + sys.exit('{} is an invalid option !'.format(this_param)) break From 97247db823702c8da1f0672d4a8f1ea50eef1575 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 21 Dec 2020 23:43:25 +0100 Subject: [PATCH 112/326] Introduced compute_polar_modes.py --- SU2_PY/FSI_tools/compute_polar_modes.py | 108 ++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 SU2_PY/FSI_tools/compute_polar_modes.py diff --git a/SU2_PY/FSI_tools/compute_polar_modes.py b/SU2_PY/FSI_tools/compute_polar_modes.py new file mode 100644 index 000000000000..a5a7f3dfc297 --- /dev/null +++ b/SU2_PY/FSI_tools/compute_polar_modes.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python + +## \file compute_polar_modes.py +# \brief Polar computation using the FSI tools, with different mode amplitudes. +# \version 7.0.8 "Blackbird" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . +# +# +# Author: Nicola Fonzi + +import numpy as np +import os +import shutil + +def main(): + + # Main variables + alpha = np.array([0, 4, 6, 8, 10, 12, 14, 15, 16, 17]) + NModeSteps = 1 + Restart = False + HOME = os.getcwd() + FluidCfg = HOME+"/fluid.cfg" + SolidCfg = HOME+"/solid.cfg" + FsiCfg = HOME+"/fsi" + MeshFile = HOME+"/airfoil.su2" + PchFile = HOME+"/modal.pch" + MeshFileNastran = HOME+"/modal.f06" + RestartFile = HOME+"/restart_flow.dat" + + + # Initialisation + + for AoA in alpha: + os.chdir(HOME) + HOMEALPHA = os.getcwd()+"/Alpha={:2.1f}".format(AoA) + os.mkdir(HOMEALPHA) + writeFluidCfg(AoA,FluidCfg) + for mode in range(NModeStepsStep): + os.chdir(HOMEALPHA) + writeSolidCfg(mode,SolidCfg) + HOMEMODE = os.getcwd()+"/Mode={:2.1f}".format(mode) + os.mkdir(HOMEMODE) + shutil.copyfile(FluidCfg,HOMEMODE+"/fluid_new.cfg") + shutil.copyfile(FluidCfg,HOMEMODE+"/solid_new.cfg") + shutil.copyfile(MeshFile,HOMEMODE+"/airfoil.su2") + shutil.copyfile(FsiCfg,HOMEMODE+"/fsi.cfg") + shutil.copyfile(MeshFileNastran,HOMEMODE+"/modal.f06") + shutil.copyfile(PchFile,HOMEMODE+"/modal.pch") + if Restart: + shutil.copyfile(HOME+"/restart_flow.dat",HOMEMODE+"/restart_flow.dat") + os.chdir(HOMEMODE) + os.system("mpirun -np 38 python3 /scratch/aero/nfonzi/usr/SU2/bin/fsi_computation.py --parallel -f fsi.cfg > log.txt") + +def replace_line(file_name, line_num, text): + lines = open(file_name, 'r').readlines() + lines[line_num] = text + out = open(file_name, 'w') + out.writelines(lines) + out.close() + +def writeFluidCfg(alpha,FluidCfg): + line_num = 0 + with open(FluidCfg) as configfile: + while 1: + line = configfile.readline() + if not line: + break + pos = line.find('AOA') + if pos >= 0: + break + line_num = line_num + 1 + replace_line(FluidCfg,line_num,"AOA = "+str(alpha)) + +def writeSolidCfg(mode,SolidCfg): + line_num = 0 + with open(SolidCfg) as configfile: + while 1: + line = configfile.readline() + if not line: + break + pos = line.find('INITIAL_MODES') + if pos >= 0: + break + line_num = line_num + 1 + replace_line(SolidCfg,line_num,"INITIAL_MODES = {"+str(int(mode))+":1.0}") + + +if __name__ == '__main__': + main() From 2f6373879e8afe97aec46fe62656c67fa6658769 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 22 Dec 2020 11:43:59 +0100 Subject: [PATCH 113/326] Small bug with time --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index d3bfda96033f..071c7328e728 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -65,9 +65,10 @@ def __init__(self,time0,type,parameters): def GetDispl(self,time): + time = time - self.time0 for case in switch(self.type): if case("SINUSOIDAL"): - return self.bias+self.amplitude*sin(2*pi*self.frequency*(time-self.time0)) + return self.bias+self.amplitude*sin(2*pi*self.frequency*time) break if case("BLENDED_STEP"): if time < self.tmax: @@ -76,9 +77,10 @@ def GetDispl(self,time): break def GetVel(self,time): + time = time - self.time0 for case in switch(self.type): if case("SINUSOIDAL"): - return self.amplitude*cos(2*pi*self.frequency*(time-self.time0))*2*pi*self.frequency + return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency break if case("BLENDED_STEP"): if time < self.tmax: @@ -87,9 +89,10 @@ def GetVel(self,time): break def GetAcc(self,time): + time = time - self.time0 for case in switch(self.type): if case("SINUSOIDAL"): - return -self.amplitude*sin(2*pi*self.frequency*(time-self.time0))*(2*pi*self.frequency)**2 + return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 break if case("BLENDED_STEP"): if time < self.tmax: From a1e4a5006be2a3ec73cb0f5745b875bbd6490a03 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 22 Dec 2020 11:52:33 +0100 Subject: [PATCH 114/326] Removed and installed compute_polar_modes --- SU2_PY/{FSI_tools => SU2_Nastran}/compute_polar_modes.py | 0 SU2_PY/meson.build | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename SU2_PY/{FSI_tools => SU2_Nastran}/compute_polar_modes.py (100%) diff --git a/SU2_PY/FSI_tools/compute_polar_modes.py b/SU2_PY/SU2_Nastran/compute_polar_modes.py similarity index 100% rename from SU2_PY/FSI_tools/compute_polar_modes.py rename to SU2_PY/SU2_Nastran/compute_polar_modes.py diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index fa11084efc76..03451a192294 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -77,5 +77,6 @@ install_data(['FSI_tools/__init__.py', install_dir: join_paths(get_option('bindir'), 'FSI_tools')) install_data(['SU2_Nastran/__init__.py', - 'SU2_Nastran/pysu2_nastran.py',], + 'SU2_Nastran/pysu2_nastran.py', + 'SU2_Nastran/compute_polar_modes.py'], install_dir: join_paths(get_option('bindir'), 'SU2_Nastran')) From 3bb57d054b926703ddf52b9a50a118d3ce6b84c5 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 22 Dec 2020 14:53:02 +0100 Subject: [PATCH 115/326] Added comment, later to be removed --- SU2_CFD/src/solvers/CFEASolver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 8fce143bfd0d..cbba80085c39 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2722,6 +2722,12 @@ void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) { auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + if (rank == MASTER_NODE){ + if (iter >= config->GetDeform_Linear_Solver_Iter()){ + cout<<"WARNING!!!! Reached maximum number of iterations in structural deformation solver"< Date: Sun, 27 Dec 2020 14:33:07 +0100 Subject: [PATCH 116/326] Couple of modifications related to old treatment of iterations --- Common/src/CConfig.cpp | 6 +----- SU2_PY/SU2_Nastran/pysu2_nastran.py | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 2d92146202af..9713cb8af289 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3431,14 +3431,11 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if ((TimeMarching == TIME_STEPPING || TimeMarching == DT_STEPPING_1ST || TimeMarching == DT_STEPPING_2ND) && !Time_Domain){ - SU2_MPI::Error("TIME_DOMAIN must be set to YES if UNSTEADY_SIMULATION is " + SU2_MPI::Error("TIME_DOMAIN must be set to YES if TIME_MARCHING is " "TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER or DUAL_TIME_STEPPING-2ND_ORDER", CURRENT_FUNCTION); } if (Time_Domain){ - if (TimeMarching == TIME_STEPPING){ - InnerIter = 1; - } if (!OptionIsSet("OUTPUT_WRT_FREQ")) VolumeWrtFreq = 1; if (Restart == NO){ @@ -6398,7 +6395,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { if (TimeMarching == DT_STEPPING_2ND) cout << "Unsteady simulation, dual time stepping strategy (second order in time)."<< endl; if (Unst_CFL != 0.0) cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl; else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl; - cout << "Total number of internal Dual Time iterations: "<< InnerIter <<"." << endl; break; } } diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 071c7328e728..e4d2c8d4b63e 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -251,7 +251,7 @@ def __init__(self, config_fileName, ImposedMotion): self.Config_file = config_fileName self.Config = {} - print("\n------------------------------ Configuring the structural tester solver for FSI simulation ------------------------------") + print("\n---------- Configuring the structural tester solver for FSI simulation ----------") self.__readConfig() self.Mesh_file = self.Config['MESH_FILE'] @@ -286,13 +286,13 @@ def __init__(self, config_fileName, ImposedMotion): self.ImposedMotionToSet = True self.ImposedMotionFunction = [] - print("\n------------------------------ Reading the mesh ------------------------------") + print("\n------------------------------- Reading the mesh -------------------------------") self.__readNastranMesh() - print("\n------------------------------ Creating the structural model ------------------------------") + print("\n------------------------- Creating the structural model ------------------------") self.__setStructuralMatrices() - print("\n------------------------------ Setting the integration parameters ------------------------------") + print("\n---------------------- Setting the integration parameters ----------------------") self.__setIntegrationParameters() self.__setInitialConditions() From 76f1971881da641859ebefabc4351ccd6cee730f Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sun, 27 Dec 2020 23:00:13 +0100 Subject: [PATCH 117/326] Removed unrequired output --- SU2_CFD/src/solvers/CFEASolver.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index cbba80085c39..8fce143bfd0d 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2722,12 +2722,6 @@ void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) { auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); - if (rank == MASTER_NODE){ - if (iter >= config->GetDeform_Linear_Solver_Iter()){ - cout<<"WARNING!!!! Reached maximum number of iterations in structural deformation solver"< Date: Tue, 29 Dec 2020 16:30:13 +0100 Subject: [PATCH 118/326] Test case for regression --- TestCases/py_su2_nastran/fluid.cfg | 211 ++++++++ TestCases/py_su2_nastran/fsi.cfg | 35 ++ TestCases/py_su2_nastran/modal.f06 | 830 +++++++++++++++++++++++++++++ TestCases/py_su2_nastran/modal.pch | 510 ++++++++++++++++++ TestCases/py_su2_nastran/solid.cfg | 36 ++ TestCases/tutorials.py | 48 +- 6 files changed, 1652 insertions(+), 18 deletions(-) create mode 100644 TestCases/py_su2_nastran/fluid.cfg create mode 100644 TestCases/py_su2_nastran/fsi.cfg create mode 100644 TestCases/py_su2_nastran/modal.f06 create mode 100644 TestCases/py_su2_nastran/modal.pch create mode 100644 TestCases/py_su2_nastran/solid.cfg diff --git a/TestCases/py_su2_nastran/fluid.cfg b/TestCases/py_su2_nastran/fluid.cfg new file mode 100644 index 000000000000..6e94b3b4736b --- /dev/null +++ b/TestCases/py_su2_nastran/fluid.cfg @@ -0,0 +1,211 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unsteady periodic detached NACA0012 simulation % +% Author: Steffen Schotthöfer % +% Institution: TU Kaiserslautern % +% Date: Jan 21, 2020 % +% File Version 7.0.1 "Blackbird" (or newer) % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, NS_PLASMA) +% +SOLVER= RANS +% +% Specify turbulent model (NONE, SA, SA_NEG, SST) +KIND_TURB_MODEL= SST +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) +MATH_PROBLEM= DIRECT +% +% ------------------------- UNSTEADY SIMULATION -------------------------------% +% +TIME_DOMAIN = YES +% +% Numerical Method for Unsteady simulation(NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +% +% Time Step for dual time stepping simulations (s) +TIME_STEP= 1e-3 +% +% Maximum Number of physical time steps. +TIME_ITER= 4000 +MAX_TIME = 4.0 +% +% Number of internal iterations (dual time method) +INNER_ITER= 50 +% +% Restart after the transient phase has passed +RESTART_SOL = NO +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 0.1 +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% +% De-Dimensionalization +REF_DIMENSIONALIZATION = DIMENSIONAL +% +FREESTREAM_TEMPERATURE= 273.0 +% +% Reynolds number (non-dimensional, based on the free-stream values) +REYNOLDS_NUMBER= 4e+6 +% +% Reynolds length (1 m by default) +REYNOLDS_LENGTH= 1.0 +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +% Reference origin for moment computation +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +% +% Reference length for pitching, rolling, and yawing non-dimensional moment +REF_LENGTH= 1.0 +% +% Reference area for force coefficients (0 implies automatic calculation) +REF_AREA= 1.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes wall boundary marker(s) (NONE = no marker) +MARKER_HEATFLUX= ( airfoil, 0.0 ) +% +% Farfield boundary marker(s) (NONE = no marker) +MARKER_FAR= ( farfield ) +% +% Marker(s) of the surface to be plotted or designed +MARKER_PLOTTING= ( airfoil ) +% +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= ( airfoil ) +%-------------- Coupling conditions -------------------------------------------% +% +DEFORM_MESH = YES +MARKER_DEFORM_MESH = ( airfoil ) +DEFORM_STIFFNESS_TYPE = WALL_DISTANCE +DEFORM_LINEAR_SOLVER_ITER= 200 +MARKER_FLUID_LOAD = ( airfoil ) +DEFORM_CONSOLE_OUTPUT= YES +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +% Courant-Friedrichs-Lewy condition of the finest grid +CFL_NUMBER= 20.0 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) +% +% Runge-Kutta alpha coefficients +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +% +% +% Linear solver for the implicit formulation (BCGSTAB, FGMRES) +LINEAR_SOLVER= FGMRES +% +% Min error of the linear solver for the implicit formulation +LINEAR_SOLVER_ERROR= 1E-8 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= JST +% +% Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% Slope limiter (VENKATAKRISHNAN, MINMOD) +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +% +JST_SENSOR_COEFF= ( 0.5, 0.01 ) +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) +% +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA = RESIDUAL +% Field to apply Cauchy Criterion to +CONV_FIELD= RMS_DENSITY +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -9.0 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% +% Mesh input file +MESH_FILENAME= airfoil.su2 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FILENAME= restart_flow.dat +% +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= restart_adj.dat +% +% Output file format (PARAVIEW, TECPLOT, STL) +TABULAR_FORMAT= CSV +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FILENAME= restart_flow.dat +% +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow +% +% Writing solution file frequency +OUTPUT_WRT_FREQ = 10 +% +HISTORY_WRT_FREQ_INNER=1 +SCREEN_WRT_FREQ_INNER =1 +% Writing convergence history frequency% Writing convergence history frequency (dual time, only written to screen) +HISTORY_WRT_FREQ_TIME=1 +SCREEN_WRT_FREQ_TIME =1 +% +SCREEN_OUTPUT=(TIME_ITER, INNER_ITER, DRAG, LIFT, RMS_DENSITY, REL_RMS_DENSITY, CAUCHY_TAVG_DRAG, CAUCHY_TAVG_LIFT) +HISTORY_OUTPUT=(ITER,REL_RMS_RES,RMS_RES, AERO_COEFF) +% diff --git a/TestCases/py_su2_nastran/fsi.cfg b/TestCases/py_su2_nastran/fsi.cfg new file mode 100644 index 000000000000..8047b52a57e1 --- /dev/null +++ b/TestCases/py_su2_nastran/fsi.cfg @@ -0,0 +1,35 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: FSI: Template % +% Author: % +% Institution: % +% Date: % +% File Version 7.0.2 "Blackbird" % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%% +% INTEGER VALUES +%%%%%%%%%%%%%%%%%%%%%%% +NDIM = 2 +RESTART_ITER = 329 +NB_FSI_ITER = 20 +%%%%%%%%%%%%%%%%%%%%%%% +% FLOAT VALUES +%%%%%%%%%%%%%%%%%%%%%%% +RBF_RADIUS = 0.5 +AITKEN_PARAM = 0.4 +UNST_TIMESTEP = 0.001 +UNST_TIME = 4.0 +TIME_TRESHOLD = -1 +FSI_TOLERANCE = 0.000001 +%%%%%%%%%%%%%%%%%%%%%%% +% STRING VALUES +%%%%%%%%%%%%%%%%%%%%%%% +CFD_CONFIG_FILE_NAME = fluid.cfg +CSD_SOLVER = AEROELASTIC +CSD_CONFIG_FILE_NAME = solid.cfg +RESTART_SOL = NO +MATCHING_MESH = NO +MESH_INTERP_METHOD = RBF +DISP_PRED = SECOND_ORDER +AITKEN_RELAX = DYNAMIC +TIME_MARCHING = YES diff --git a/TestCases/py_su2_nastran/modal.f06 b/TestCases/py_su2_nastran/modal.f06 new file mode 100644 index 000000000000..4d6bde725c3c --- /dev/null +++ b/TestCases/py_su2_nastran/modal.f06 @@ -0,0 +1,830 @@ +1 + + + + + Warning: This computer program is protected by copyright law and international treaties. + Unauthorized use, reproduction or distribution of this computer program, or any portion of it, may + result in severe civil and criminal penalties. + Copyright (C) 2018 MSC Software Corporation and its licensors. All rights reserved. + + + * * * * * * * * * * * * * * * * * * * * + * * * * * * * * * * * * * * * * * * * * + * * * * + * * MSC Software * * + * * CORP * * + * * * * + * * M S C N a s t r a n * * + * * * * + * * S T U D E N T E D I T I O N * * + * * * * + * * Version 2019.0.0-CL621679 * * + * * * * + * * * * + * * * * + * * DEC 18, 2018 * * + * * * * + * * Intel * * + * *MODEL Xeon/2257 (DESKTOP-1VDF0SS * * + * * Windows 10 Home 6.2 9200 * * + * * Compiled for 8664 (SINGLE Mode) * * + * * * * + * * * * * * * * * * * * * * * * * * * * + * * * * * * * * * * * * * * * * * * * * + + + + This Student Edition version is + valid until NOV 30, 2020. + + + This program is being distributed as part of the MSC Software Student Edition. Use of this program + or its results at a commercial installation, for commercial purposes, or for production work + I S S T R I C T L Y P R O H I B I T E D. + ==================================== FOR EDUCATIONAL USE ONLY ===================================== + + +1News file - (November 7, 2018) + + Welcome to MSC Nastran 2019.0 + + + MSC Nastran brings powerful new features and enhancements for engineering + solutions. + + Dynamics + - RFORCE and GRAV loads can now be optionally applied to a subset of + the model + + SOL 128 (Nonlinear Harmonics) Rotordynamics Enhancements + - Option to reset initial conditions + - Nonlinear load output + - Output for multiple harmonics + - Support for continuation procedure for frequency-independent analysis + + Pyramid Element + - The linear and quadratic pyramid element is available in linear + solutions: statics, modes, buckling, frequency and transient dynamics, + linear contact, acoustics, fatigue, rotordynamics, aeroelasticity and + design optimization + - The element is also available in SOL 400 for linear, nlstatics, + nltransient and linear perturbation solutions + + Assembly + - Module Instantiation: Allow copy of a primary Module to create + a secondary Module at a new position by translation, rotation and mirror + + Contact + - Support geometry adjustment of initial stress free in S2S Contact + - Support model check output in S2S Contact + - Allow user input minimum angle between segments on BCPARA + + SOL 400 Implicit Nonlinear Analysis + - Support Automatic SGLUE setup for permanent glued contact with large + deformation + - Reduce the debug output when using "NLOPRM NLDBG(N3DSUM)" + - Support MONPNT1, MONPNT3, MONSUM, MONSUM1, and MONSUMT in NLSTAT + and NLTRAN + + SOL 700 Explicit Nonlinear Analysis + - Support failure of ACS surface and DMP of ACS algorithm + - Support Occupant Safety, including Articulated Total Body (ATB), + Initial Metric Method (IMM) and Air bag fabric material model (MATFAB) + - Support Viscoelastic Material (MATVE), Localized Cohesive friction, and + User Defined Services (UDS) + + High Performance Computing (HPC) +1 - Improved performance and scalability of acoustic coupling reduction + with ACMS for large models + - Improved performance for ACMS Phase 1 for large solid models + - Improved performance (up to 10X) in the RANDOM module + - New DMP implementation for Panel Participation factor calculation + (PFCALC) with linear parallel scaling + - Performance enhancements for FASTFR through shared-memory + parallelization (SMP) of frequency processing + + + Results HDF5 Database + - Support outputs of Aerodynamic solution SOL144, 145 and 146 results + - Support Modal effective mass, Modules, Contact Check and + Global contact body data + - Support Bar/Beam end loads under the shear stress effect of 2D elements + + + Documentation + The complete documentation set is provided in a separate installer and + when installed is available at: MSC_DOC_DIR/doc/pdf_nastran directory. + Where MSC_DOC_DIR is the directory where documentation was installed + This help set has cross references between documents, links to how-to + videos, and example files. + + Individual MSC Nastran documents are available for download from the + Simcompanion Website at: + http://simcompanion.mscsoftware.com/ + + These documents were updated for the MSC Nastran 2019 Release + + 1. MSC Nastran 2019.0 Installation and Operations Guide + 2. MSC Nastran 2019.0 Quick Reference Guide + 3. MSC Nastran 2019.0 Release Guide + 4. MSC Nastran 2019.0 Linear Statics Analysis User's Guide + 5. MSC Nastran 2019.0 Dynamic Analysis User's Guide + 6. MSC Nastran 2019.0 Superelements User's Guide + 7. MSC Nastran 2019.0 Rotordynamics User's Guide + 8. MSC Nastran 2019.0 Demonstration Problems Manual + 9. MSC Nastran 2019.0 Nastran Embedded Fatigue User's Guide + 10. MSC Nastran 2019.0 Design Sensitivity and Optimization + 11. MSC Nastran 2019.0 Nonlinear User's Guide SOL 400 + 12. MSC Nastran 2019.0 DMAP Programmer's Guide + 13. MSC Nastran 2019.0 High Performance Computing User's Guide + 14. MSC Nastran 2019.0 DEMATD Guide + 15. MSC Nastran 2019.0 Explicit Nonlinear (SOL 700) User's Guide + + Please refer to MSC_DOC_DIR/doc/pdf_nastran/nastran_library.pdf + for the complete document set: + + +1 Additional information about the release can be found at the MSC Nastran + Product Support page: http://simcompanion.mscsoftware.com + + The support page provides links to these valuable information: + * A searchable Knowledge Base containing examples and answers to thousands + of frequently asked questions written by MSC Software subject-matter + experts. + * Peer-to-peer Discussion Forums enabling you to post questions for your + MSC Software products and receive answers from other users worldwide. + * A list of known issues with the product and any workarounds. + * Instructions on how to contact technical support + * A mechanism for sending us product feedback or enhancement requests. + * Hardware and software requirements. + * Examples and Tutorials + * and much more. + + For information on training, please visit our Training web site + + http://www.mscsoftware.com/Contents/Services/Training/ + +1 **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 1 + +0 N A S T R A N F I L E A N D S Y S T E M P A R A M E T E R E C H O +0 + + + NASTRAN BUFFSIZE=8193 $(C:/MSC.SOFTWARE/MSC_NASTRAN_AND_PATRAN_STUDENT_EDITIONS/ + INIT MASTER(S) + NASTRAN SYSTEM(319)=1 +1 **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 2 + +0 N A S T R A N E X E C U T I V E C O N T R O L E C H O +0 + + + ID MODEL,FEMAP + SOL SEMODES + CEND +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 3 + +0 +0 C A S E C O N T R O L E C H O + COMMAND + COUNT + 1 TITLE = MSC/MD NASTRAN MODES ANALYSIS SET + 2 ECHO = SORT + 3 DISPLACEMENT(PRINT,PUNCH) = ALL + 4 METHOD = 1 + 5 SPC = 1 + 6 BEGIN BULK +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 4 + +0 + S O R T E D B U L K D A T A E C H O + ENTRY + COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . + 1- CELAS2 2 33422.341000 2 0. + 2- CELAS2 3 20591.971000 6 0. + 3- CONM2 1 16 0 162.702 0. 0. 0. + + 4- + 0. 0. 0. 0. 0. 7.626657 + 5- CORD2C 1 0 0. 0. 0. 0. 0. 1. + + 6- + 1. 0. 1. + 7- CORD2S 2 0 0. 0. 0. 0. 0. 1. + + 8- + 1. 0. 1. + 9- EIGRL 1 10 0 MASS + 10- GRID 1 0 0. 0. 0. 0 + 11- GRID 2 0 .025 0. 0. 0 + 12- GRID 3 0 .05 0. 0. 0 + 13- GRID 4 0 .075 0. 0. 0 + 14- GRID 5 0 .1 0. 0. 0 + 15- GRID 6 0 .125 0. 0. 0 + 16- GRID 7 0 .15 0. 0. 0 + 17- GRID 8 0 .175 0. 0. 0 + 18- GRID 9 0 .2 0. 0. 0 + 19- GRID 10 0 .225 0. 0. 0 + 20- GRID 11 0 .25 0. 0. 0 + 21- GRID 12 0 .275 0. 0. 0 + 22- GRID 13 0 .3 0. 0. 0 + 23- GRID 14 0 .325 0. 0. 0 + 24- GRID 15 0 .35 0. 0. 0 + 25- GRID 16 0 .375 0. 0. 0 + 26- GRID 17 0 .4 0. 0. 0 + 27- GRID 18 0 .425 0. 0. 0 + 28- GRID 19 0 .45 0. 0. 0 + 29- GRID 20 0 .475 0. 0. 0 + 30- GRID 21 0 .5 0. 0. 0 + 31- GRID 22 0 .525 0. 0. 0 + 32- GRID 23 0 .55 0. 0. 0 + 33- GRID 24 0 .575 0. 0. 0 + 34- GRID 25 0 .6 0. 0. 0 + 35- GRID 26 0 .625 0. 0. 0 + 36- GRID 27 0 .65 0. 0. 0 + 37- GRID 28 0 .675 0. 0. 0 + 38- GRID 29 0 .7 0. 0. 0 + 39- GRID 30 0 .725 0. 0. 0 + 40- GRID 31 0 .75 0. 0. 0 + 41- GRID 32 0 .775 0. 0. 0 + 42- GRID 33 0 .8 0. 0. 0 + 43- GRID 34 0 .825 0. 0. 0 + 44- GRID 35 0 .85 0. 0. 0 + 45- GRID 36 0 .875 0. 0. 0 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 5 + +0 + S O R T E D B U L K D A T A E C H O + ENTRY + COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . + 46- GRID 37 0 .9 0. 0. 0 + 47- GRID 38 0 .925 0. 0. 0 + 48- GRID 39 0 .95 0. 0. 0 + 49- GRID 40 0 .975 0. 0. 0 + 50- GRID 41 0 1. 0. 0. 0 + 51- GRID 42 0 0. .06 0. 0 + 52- GRID 43 0 .025 .06 0. 0 + 53- GRID 44 0 .05 .06 0. 0 + 54- GRID 45 0 .075 .06 0. 0 + 55- GRID 46 0 .1 .06 0. 0 + 56- GRID 47 0 .125 .06 0. 0 + 57- GRID 48 0 .15 .06 0. 0 + 58- GRID 49 0 .175 .06 0. 0 + 59- GRID 50 0 .2 .06 0. 0 + 60- GRID 51 0 .225 .06 0. 0 + 61- GRID 52 0 .25 .06 0. 0 + 62- GRID 53 0 .275 .06 0. 0 + 63- GRID 54 0 .3 .06 0. 0 + 64- GRID 55 0 .325 .06 0. 0 + 65- GRID 56 0 .35 .06 0. 0 + 66- GRID 57 0 .375 .06 0. 0 + 67- GRID 58 0 .4 .06 0. 0 + 68- GRID 59 0 .425 .06 0. 0 + 69- GRID 60 0 .45 .06 0. 0 + 70- GRID 61 0 .475 .06 0. 0 + 71- GRID 62 0 .5 .06 0. 0 + 72- GRID 63 0 .525 .06 0. 0 + 73- GRID 64 0 .55 .06 0. 0 + 74- GRID 65 0 .575 .06 0. 0 + 75- GRID 66 0 .6 .06 0. 0 + 76- GRID 67 0 .625 .06 0. 0 + 77- GRID 68 0 .65 .06 0. 0 + 78- GRID 69 0 .675 .06 0. 0 + 79- GRID 70 0 .7 .06 0. 0 + 80- GRID 71 0 .725 .06 0. 0 + 81- GRID 72 0 .75 .06 0. 0 + 82- GRID 73 0 .775 .06 0. 0 + 83- GRID 74 0 .8 .06 0. 0 + 84- GRID 75 0 .825 .06 0. 0 + 85- GRID 76 0 .85 .06 0. 0 + 86- GRID 77 0 .875 .06 0. 0 + 87- GRID 78 0 .9 .06 0. 0 + 88- GRID 79 0 .925 .06 0. 0 + 89- GRID 80 0 .95 .06 0. 0 + 90- GRID 81 0 .975 .06 0. 0 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 6 + +0 + S O R T E D B U L K D A T A E C H O + ENTRY + COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . + 91- GRID 82 0 1. .06 0. 0 + 92- GRID 83 0 0. -.06 0. 0 + 93- GRID 84 0 .025 -.06 0. 0 + 94- GRID 85 0 .05 -.06 0. 0 + 95- GRID 86 0 .075 -.06 0. 0 + 96- GRID 87 0 .1 -.06 0. 0 + 97- GRID 88 0 .125 -.06 0. 0 + 98- GRID 89 0 .15 -.06 0. 0 + 99- GRID 90 0 .175 -.06 0. 0 + 100- GRID 91 0 .2 -.06 0. 0 + 101- GRID 92 0 .225 -.06 0. 0 + 102- GRID 93 0 .25 -.06 0. 0 + 103- GRID 94 0 .275 -.06 0. 0 + 104- GRID 95 0 .3 -.06 0. 0 + 105- GRID 96 0 .325 -.06 0. 0 + 106- GRID 97 0 .35 -.06 0. 0 + 107- GRID 98 0 .375 -.06 0. 0 + 108- GRID 99 0 .4 -.06 0. 0 + 109- GRID 100 0 .425 -.06 0. 0 + 110- GRID 101 0 .45 -.06 0. 0 + 111- GRID 102 0 .475 -.06 0. 0 + 112- GRID 103 0 .5 -.06 0. 0 + 113- GRID 104 0 .525 -.06 0. 0 + 114- GRID 105 0 .55 -.06 0. 0 + 115- GRID 106 0 .575 -.06 0. 0 + 116- GRID 107 0 .6 -.06 0. 0 + 117- GRID 108 0 .625 -.06 0. 0 + 118- GRID 109 0 .65 -.06 0. 0 + 119- GRID 110 0 .675 -.06 0. 0 + 120- GRID 111 0 .7 -.06 0. 0 + 121- GRID 112 0 .725 -.06 0. 0 + 122- GRID 113 0 .75 -.06 0. 0 + 123- GRID 114 0 .775 -.06 0. 0 + 124- GRID 115 0 .8 -.06 0. 0 + 125- GRID 116 0 .825 -.06 0. 0 + 126- GRID 117 0 .85 -.06 0. 0 + 127- GRID 118 0 .875 -.06 0. 0 + 128- GRID 119 0 .9 -.06 0. 0 + 129- GRID 120 0 .925 -.06 0. 0 + 130- GRID 121 0 .95 -.06 0. 0 + 131- GRID 122 0 .975 -.06 0. 0 + 132- GRID 123 0 1. -.06 0. 0 + 133- GRID 1000 0 .25 0. 0. 0 + 134- PARAM AUTOSPC NO + 135- PARAM GRDPNT 0 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 7 + +0 + S O R T E D B U L K D A T A E C H O + ENTRY + COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . + 136- PARAM OGEOM NO + 137- PARAM POST -1 + 138- PARAM PRGPST YES + 139- RBE2 4 1000 123456 1 2 3 4 5 + + 140- + 6 7 8 9 10 12 13 14 + + 141- + 15 16 17 18 19 20 21 22 + + 142- + 23 24 25 26 27 28 29 30 + + 143- + 31 32 33 34 35 36 37 38 + + 144- + 39 40 41 42 43 44 45 46 + + 145- + 47 48 49 50 51 52 53 54 + + 146- + 55 56 57 58 59 60 61 62 + + 147- + 63 64 65 66 67 68 69 70 + + 148- + 71 72 73 74 75 76 77 78 + + 149- + 79 80 81 82 83 84 85 86 + + 150- + 87 88 89 90 91 92 93 94 + + 151- + 95 96 97 98 99 100 101 102 + + 152- + 103 104 105 106 107 108 109 110 + + 153- + 111 112 113 114 115 116 117 118 + + 154- + 119 120 121 122 123 11 + 155- SET1 1 1 2 3 4 5 6 7 + + 156- + 8 9 10 11 12 13 14 15 + + 157- + 16 17 18 19 20 21 22 23 + + 158- + 24 25 26 27 28 29 30 31 + + 159- + 32 33 34 35 36 37 38 39 + + 160- + 40 41 42 43 44 45 46 47 + + 161- + 48 49 50 51 52 53 54 55 + + 162- + 56 57 58 59 60 61 62 63 + + 163- + 64 65 66 67 68 69 70 71 + + 164- + 72 73 74 75 76 77 78 79 + + 165- + 80 81 82 83 84 85 86 87 + + 166- + 88 89 90 91 92 93 94 95 + + 167- + 96 97 98 99 100 101 102 103 + + 168- + 104 105 106 107 108 109 110 111 + + 169- + 112 113 114 115 116 117 118 119 + + 170- + 120 121 122 123 + 171- SPC1 1 1345 1000 + ENDDATA + TOTAL COUNT= 172 + INPUT BULK DATA ENTRY COUNT = 177 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 8 + +0 + M O D E L S U M M A R Y BULK = 0 + ENTRY NAME NUMBER OF ENTRIES + ---------- ----------------- + CELAS2 2 + CONM2 1 + CORD2C 1 + CORD2S 1 + EIGRL 1 + GRID 124 + PARAM 5 + RBE2 1 + SET1 1 + SPC1 1 + + ^^^ + ^^^ >>> IFP OPERATIONS COMPLETE <<< + ^^^ + *** USER INFORMATION MESSAGE 4109 (OUTPX2) + THE LABEL IS XXXXXXXX FOR FORTRAN UNIT 12 + (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 7 WORDS.) + (NUMBER OF FORTRAN RECORDS WRITTEN = 8 RECORDS.) + (TOTAL DATA WRITTEN FOR LABEL = 17 WORDS.) +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 9 + +0 + O U T P U T F R O M G R I D P O I N T W E I G H T G E N E R A T O R +0 REFERENCE POINT = 0 + M O + * 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 6.101325E+01 * + * 0.000000E+00 0.000000E+00 1.627020E+02 0.000000E+00 -6.101325E+01 0.000000E+00 * + * 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 0.000000E+00 -6.101325E+01 0.000000E+00 2.287997E+01 0.000000E+00 * + * 0.000000E+00 6.101325E+01 0.000000E+00 0.000000E+00 0.000000E+00 3.050663E+01 * + S + * 1.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 1.000000E+00 0.000000E+00 * + * 0.000000E+00 0.000000E+00 1.000000E+00 * + DIRECTION + MASS AXIS SYSTEM (S) MASS X-C.G. Y-C.G. Z-C.G. + X 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 + Y 1.627020E+02 3.750000E-01 0.000000E+00 0.000000E+00 + Z 1.627020E+02 3.750000E-01 0.000000E+00 0.000000E+00 + I(S) + * 0.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 0.000000E+00 7.626657E+00 * + I(Q) + * 0.000000E+00 * + * 0.000000E+00 * + * 7.626657E+00 * + Q + * 1.000000E+00 0.000000E+00 0.000000E+00 * + * 0.000000E+00 1.000000E+00 0.000000E+00 * + * 0.000000E+00 0.000000E+00 1.000000E+00 * + +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 10 + +0 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 11 + +0 +0 RESULTANTS ABOUT ORIGIN OF SUPERELEMENT BASIC COORDINATE SYSTEM IN SUPERELEMENT BASIC SYSTEM COORDINATES. + +0 OLOAD RESULTANT + SUBCASE/ LOAD + DAREA ID TYPE T1 T2 T3 R1 R2 R3 +0 1 FX 0.000000E+00 ---- ---- ---- 0.000000E+00 0.000000E+00 + FY ---- 0.000000E+00 ---- 0.000000E+00 ---- 0.000000E+00 + FZ ---- ---- 0.000000E+00 0.000000E+00 0.000000E+00 ---- + MX ---- ---- ---- 0.000000E+00 ---- ---- + MY ---- ---- ---- ---- 0.000000E+00 ---- + MZ ---- ---- ---- ---- ---- 0.000000E+00 + TOTALS 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 + *** USER INFORMATION MESSAGE 5458 (REIG) + QL HOUSEHOLDER METHOD IS AUTOMATICALLY SELECTED . + User information: + Based upon automatic selection criteria the eigensolution was changed + to this method. To turn off this automatic selection, please set + system cell 359 to 0. In the case of an original Lanczos method + selection, setting the NE field to zero on the READ DMAP line will + also turn off this automatic option. +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 12 + +0 + + R E A L E I G E N V A L U E S + MODE EXTRACTION EIGENVALUE RADIANS CYCLES GENERALIZED GENERALIZED + NO. ORDER MASS STIFFNESS + 1 1 1.999443E+02 1.414017E+01 2.250478E+00 1.000000E+00 1.999443E+02 + 2 2 2.773949E+03 5.266829E+01 8.382419E+00 1.000000E+00 2.773949E+03 +*** User Information: Select OptionX for OUTPUT2 Datablock OUG1 + *** USER INFORMATION MESSAGE 4114 (OUTPX2) + DATA BLOCK OUG1 WRITTEN ON FORTRAN UNIT 12 IN BINARY (LTLEND) FORMAT USING NDDL DESCRIPTION FOR OUG1, TRL = + 101 0 1984 0 0 0 5 + NAME OF DATA BLOCK WRITTEN ON FORTRAN UNIT IS OUG1 + (MAXIMUM POSSIBLE FORTRAN RECORD SIZE = 16386 WORDS.) + (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 992 WORDS.) + (NUMBER OF FORTRAN RECORDS WRITTEN = 30 RECORDS.) + (TOTAL DATA WRITTEN FOR DATA BLOCK = 2317 WORDS.) +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 13 + +0 + EIGENVALUE = 1.999443E+02 + CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 1 G 0.0 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 + 2 G 0.0 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 + 3 G 0.0 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 + 4 G 0.0 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 + 5 G 0.0 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 + 6 G 0.0 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 + 7 G 0.0 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 + 8 G 0.0 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 + 9 G 0.0 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 + 10 G 0.0 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 + 11 G 0.0 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 + 12 G 0.0 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 + 13 G 0.0 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 + 14 G 0.0 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 + 15 G 0.0 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 + 16 G 0.0 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 + 17 G 0.0 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 + 18 G 0.0 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 + 19 G 0.0 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 + 20 G 0.0 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 + 21 G 0.0 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 + 22 G 0.0 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 + 23 G 0.0 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 + 24 G 0.0 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 + 25 G 0.0 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 + 26 G 0.0 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 + 27 G 0.0 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 + 28 G 0.0 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 + 29 G 0.0 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 + 30 G 0.0 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 + 31 G 0.0 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 + 32 G 0.0 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 + 33 G 0.0 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 + 34 G 0.0 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 + 35 G 0.0 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 + 36 G 0.0 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 + 37 G 0.0 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 + 38 G 0.0 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 + 39 G 0.0 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 + 40 G 0.0 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 + 41 G 0.0 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 + 42 G 1.002122E-03 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 + 43 G 1.002122E-03 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 + 44 G 1.002122E-03 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 + 45 G 1.002122E-03 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 + 46 G 1.002122E-03 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 + 47 G 1.002122E-03 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 + 48 G 1.002122E-03 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 + 49 G 1.002122E-03 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 + 50 G 1.002122E-03 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 14 + +0 + EIGENVALUE = 1.999443E+02 + CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 51 G 1.002122E-03 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 + 52 G 1.002122E-03 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 + 53 G 1.002122E-03 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 + 54 G 1.002122E-03 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 + 55 G 1.002122E-03 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 + 56 G 1.002122E-03 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 + 57 G 1.002122E-03 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 + 58 G 1.002122E-03 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 + 59 G 1.002122E-03 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 + 60 G 1.002122E-03 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 + 61 G 1.002122E-03 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 + 62 G 1.002122E-03 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 + 63 G 1.002122E-03 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 + 64 G 1.002122E-03 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 + 65 G 1.002122E-03 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 + 66 G 1.002122E-03 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 + 67 G 1.002122E-03 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 + 68 G 1.002122E-03 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 + 69 G 1.002122E-03 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 + 70 G 1.002122E-03 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 + 71 G 1.002122E-03 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 + 72 G 1.002122E-03 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 + 73 G 1.002122E-03 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 + 74 G 1.002122E-03 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 + 75 G 1.002122E-03 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 + 76 G 1.002122E-03 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 + 77 G 1.002122E-03 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 + 78 G 1.002122E-03 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 + 79 G 1.002122E-03 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 + 80 G 1.002122E-03 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 + 81 G 1.002122E-03 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 + 82 G 1.002122E-03 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 + 83 G -1.002122E-03 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 + 84 G -1.002122E-03 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 + 85 G -1.002122E-03 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 + 86 G -1.002122E-03 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 + 87 G -1.002122E-03 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 + 88 G -1.002122E-03 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 + 89 G -1.002122E-03 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 + 90 G -1.002122E-03 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 + 91 G -1.002122E-03 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 + 92 G -1.002122E-03 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 + 93 G -1.002122E-03 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 + 94 G -1.002122E-03 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 + 95 G -1.002122E-03 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 + 96 G -1.002122E-03 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 + 97 G -1.002122E-03 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 + 98 G -1.002122E-03 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 + 99 G -1.002122E-03 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 + 100 G -1.002122E-03 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 15 + +0 + EIGENVALUE = 1.999443E+02 + CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 101 G -1.002122E-03 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 + 102 G -1.002122E-03 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 + 103 G -1.002122E-03 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 + 104 G -1.002122E-03 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 + 105 G -1.002122E-03 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 + 106 G -1.002122E-03 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 + 107 G -1.002122E-03 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 + 108 G -1.002122E-03 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 + 109 G -1.002122E-03 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 + 110 G -1.002122E-03 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 + 111 G -1.002122E-03 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 + 112 G -1.002122E-03 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 + 113 G -1.002122E-03 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 + 114 G -1.002122E-03 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 + 115 G -1.002122E-03 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 + 116 G -1.002122E-03 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 + 117 G -1.002122E-03 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 + 118 G -1.002122E-03 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 + 119 G -1.002122E-03 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 + 120 G -1.002122E-03 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 + 121 G -1.002122E-03 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 + 122 G -1.002122E-03 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 + 123 G -1.002122E-03 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 + 1000 G 0.0 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 16 + +0 + EIGENVALUE = 2.773949E+03 + CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 1 G 0.0 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 + 2 G 0.0 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 + 3 G 0.0 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 + 4 G 0.0 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 + 5 G 0.0 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 + 6 G 0.0 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 + 7 G 0.0 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 + 8 G 0.0 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 + 9 G 0.0 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 + 10 G 0.0 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 + 11 G 0.0 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 + 12 G 0.0 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 + 13 G 0.0 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 + 14 G 0.0 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 + 15 G 0.0 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 + 16 G 0.0 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 + 17 G 0.0 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 + 18 G 0.0 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 + 19 G 0.0 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 + 20 G 0.0 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 + 21 G 0.0 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 + 22 G 0.0 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 + 23 G 0.0 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 + 24 G 0.0 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 + 25 G 0.0 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 + 26 G 0.0 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 + 27 G 0.0 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 + 28 G 0.0 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 + 29 G 0.0 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 + 30 G 0.0 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 + 31 G 0.0 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 + 32 G 0.0 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 + 33 G 0.0 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 + 34 G 0.0 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 + 35 G 0.0 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 + 36 G 0.0 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 + 37 G 0.0 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 + 38 G 0.0 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 + 39 G 0.0 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 + 40 G 0.0 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 + 41 G 0.0 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 + 42 G 2.170309E-02 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 + 43 G 2.170309E-02 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 + 44 G 2.170309E-02 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 + 45 G 2.170309E-02 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 + 46 G 2.170309E-02 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 + 47 G 2.170309E-02 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 + 48 G 2.170309E-02 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 + 49 G 2.170309E-02 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 + 50 G 2.170309E-02 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 17 + +0 + EIGENVALUE = 2.773949E+03 + CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 51 G 2.170309E-02 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 + 52 G 2.170309E-02 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 + 53 G 2.170309E-02 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 + 54 G 2.170309E-02 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 + 55 G 2.170309E-02 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 + 56 G 2.170309E-02 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 + 57 G 2.170309E-02 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 + 58 G 2.170309E-02 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 + 59 G 2.170309E-02 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 + 60 G 2.170309E-02 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 + 61 G 2.170309E-02 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 + 62 G 2.170309E-02 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 + 63 G 2.170309E-02 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 + 64 G 2.170309E-02 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 + 65 G 2.170309E-02 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 + 66 G 2.170309E-02 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 + 67 G 2.170309E-02 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 + 68 G 2.170309E-02 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 + 69 G 2.170309E-02 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 + 70 G 2.170309E-02 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 + 71 G 2.170309E-02 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 + 72 G 2.170309E-02 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 + 73 G 2.170309E-02 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 + 74 G 2.170309E-02 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 + 75 G 2.170309E-02 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 + 76 G 2.170309E-02 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 + 77 G 2.170309E-02 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 + 78 G 2.170309E-02 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 + 79 G 2.170309E-02 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 + 80 G 2.170309E-02 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 + 81 G 2.170309E-02 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 + 82 G 2.170309E-02 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 + 83 G -2.170309E-02 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 + 84 G -2.170309E-02 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 + 85 G -2.170309E-02 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 + 86 G -2.170309E-02 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 + 87 G -2.170309E-02 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 + 88 G -2.170309E-02 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 + 89 G -2.170309E-02 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 + 90 G -2.170309E-02 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 + 91 G -2.170309E-02 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 + 92 G -2.170309E-02 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 + 93 G -2.170309E-02 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 + 94 G -2.170309E-02 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 + 95 G -2.170309E-02 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 + 96 G -2.170309E-02 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 + 97 G -2.170309E-02 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 + 98 G -2.170309E-02 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 + 99 G -2.170309E-02 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 + 100 G -2.170309E-02 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 18 + +0 + EIGENVALUE = 2.773949E+03 + CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 + + POINT ID. TYPE T1 T2 T3 R1 R2 R3 + 101 G -2.170309E-02 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 + 102 G -2.170309E-02 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 + 103 G -2.170309E-02 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 + 104 G -2.170309E-02 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 + 105 G -2.170309E-02 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 + 106 G -2.170309E-02 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 + 107 G -2.170309E-02 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 + 108 G -2.170309E-02 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 + 109 G -2.170309E-02 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 + 110 G -2.170309E-02 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 + 111 G -2.170309E-02 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 + 112 G -2.170309E-02 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 + 113 G -2.170309E-02 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 + 114 G -2.170309E-02 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 + 115 G -2.170309E-02 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 + 116 G -2.170309E-02 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 + 117 G -2.170309E-02 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 + 118 G -2.170309E-02 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 + 119 G -2.170309E-02 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 + 120 G -2.170309E-02 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 + 121 G -2.170309E-02 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 + 122 G -2.170309E-02 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 + 123 G -2.170309E-02 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 + 1000 G 0.0 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 + *** USER INFORMATION MESSAGE 4110 (OUTPX2) + END-OF-DATA SIMULATION ON FORTRAN UNIT 12 + (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 1 WORDS.) + (NUMBER OF FORTRAN RECORDS WRITTEN = 1 RECORDS.) + (TOTAL DATA WRITTEN FOR EOF MARKER = 1 WORDS.) +1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 19 + +0 + * * * * D B D I C T P R I N T * * * * SUBDMAP = PRTSUM , DMAP STATEMENT NO. 71 + + + +0 * * * * A N A L Y S I S S U M M A R Y T A B L E * * * * +0 SEID PEID PROJ VERS APRCH SEMG SEMR SEKR SELG SELR MODES DYNRED SOLLIN PVALID SOLNL LOOPID DESIGN CYCLE SENSITIVITY + -------------------------------------------------------------------------------------------------------------------------- + 0 0 1 1 ' ' T T T T T T F T 0 F -1 0 F +0SEID = SUPERELEMENT ID. + PEID = PRIMARY SUPERELEMENT ID OF IMAGE SUPERELEMENT. + PROJ = PROJECT ID NUMBER. + VERS = VERSION ID. + APRCH = BLANK FOR STRUCTURAL ANALYSIS. HEAT FOR HEAT TRANSFER ANALYSIS. + SEMG = STIFFNESS AND MASS MATRIX GENERATION STEP. + SEMR = MASS MATRIX REDUCTION STEP (INCLUDES EIGENVALUE SOLUTION FOR MODES). + SEKR = STIFFNESS MATRIX REDUCTION STEP. + SELG = LOAD MATRIX GENERATION STEP. + SELR = LOAD MATRIX REDUCTION STEP. + MODES = T (TRUE) IF NORMAL MODES OR BUCKLING MODES CALCULATED. + DYNRED = T (TRUE) MEANS GENERALIZED DYNAMIC AND/OR COMPONENT MODE REDUCTION PERFORMED. + SOLLIN = T (TRUE) IF LINEAR SOLUTION EXISTS IN DATABASE. + PVALID = P-DISTRIBUTION ID OF P-VALUE FOR P-ELEMENTS + LOOPID = THE LAST LOOPID VALUE USED IN THE NONLINEAR ANALYSIS. USEFUL FOR RESTARTS. + SOLNL = T (TRUE) IF NONLINEAR SOLUTION EXISTS IN DATABASE. + DESIGN CYCLE = THE LAST DESIGN CYCLE (ONLY VALID IN OPTIMIZATION). + SENSITIVITY = SENSITIVITY MATRIX GENERATION FLAG. + + No PARAM values were set in the Control File. + +1 * * * END OF JOB * * * + + + No Symbolic Replacement variables or values were specified. + diff --git a/TestCases/py_su2_nastran/modal.pch b/TestCases/py_su2_nastran/modal.pch new file mode 100644 index 000000000000..eefecb3e91c1 --- /dev/null +++ b/TestCases/py_su2_nastran/modal.pch @@ -0,0 +1,510 @@ +$TITLE = MSC/MD NASTRAN MODES ANALYSIS SET 1 +$SUBTITLE= 2 +$LABEL = 3 +$EIGENVECTOR 4 +$REAL OUTPUT 5 +$SUBCASE ID = 1 6 +$EIGENVALUE = 1.9994435E+02 MODE = 1 7 + 1 G 0.000000E+00 -7.205104E-02 0.000000E+00 8 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 9 + 2 G 0.000000E+00 -7.246859E-02 0.000000E+00 10 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 11 + 3 G 0.000000E+00 -7.288614E-02 0.000000E+00 12 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 13 + 4 G 0.000000E+00 -7.330369E-02 0.000000E+00 14 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 15 + 5 G 0.000000E+00 -7.372124E-02 0.000000E+00 16 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 17 + 6 G 0.000000E+00 -7.413879E-02 0.000000E+00 18 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 19 + 7 G 0.000000E+00 -7.455634E-02 0.000000E+00 20 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 21 + 8 G 0.000000E+00 -7.497389E-02 0.000000E+00 22 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 23 + 9 G 0.000000E+00 -7.539145E-02 0.000000E+00 24 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 25 + 10 G 0.000000E+00 -7.580900E-02 0.000000E+00 26 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 27 + 11 G 0.000000E+00 -7.622655E-02 0.000000E+00 28 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 29 + 12 G 0.000000E+00 -7.664410E-02 0.000000E+00 30 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 31 + 13 G 0.000000E+00 -7.706165E-02 0.000000E+00 32 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 33 + 14 G 0.000000E+00 -7.747920E-02 0.000000E+00 34 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 35 + 15 G 0.000000E+00 -7.789675E-02 0.000000E+00 36 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 37 + 16 G 0.000000E+00 -7.831430E-02 0.000000E+00 38 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 39 + 17 G 0.000000E+00 -7.873185E-02 0.000000E+00 40 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 41 + 18 G 0.000000E+00 -7.914940E-02 0.000000E+00 42 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 43 + 19 G 0.000000E+00 -7.956695E-02 0.000000E+00 44 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 45 + 20 G 0.000000E+00 -7.998450E-02 0.000000E+00 46 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 47 + 21 G 0.000000E+00 -8.040206E-02 0.000000E+00 48 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 49 + 22 G 0.000000E+00 -8.081961E-02 0.000000E+00 50 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 51 + 23 G 0.000000E+00 -8.123716E-02 0.000000E+00 52 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 53 + 24 G 0.000000E+00 -8.165471E-02 0.000000E+00 54 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 55 + 25 G 0.000000E+00 -8.207226E-02 0.000000E+00 56 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 57 + 26 G 0.000000E+00 -8.248981E-02 0.000000E+00 58 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 59 + 27 G 0.000000E+00 -8.290736E-02 0.000000E+00 60 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 61 + 28 G 0.000000E+00 -8.332491E-02 0.000000E+00 62 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 63 + 29 G 0.000000E+00 -8.374246E-02 0.000000E+00 64 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 65 + 30 G 0.000000E+00 -8.416001E-02 0.000000E+00 66 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 67 + 31 G 0.000000E+00 -8.457756E-02 0.000000E+00 68 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 69 + 32 G 0.000000E+00 -8.499511E-02 0.000000E+00 70 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 71 + 33 G 0.000000E+00 -8.541266E-02 0.000000E+00 72 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 73 + 34 G 0.000000E+00 -8.583022E-02 0.000000E+00 74 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 75 + 35 G 0.000000E+00 -8.624777E-02 0.000000E+00 76 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 77 + 36 G 0.000000E+00 -8.666532E-02 0.000000E+00 78 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 79 + 37 G 0.000000E+00 -8.708287E-02 0.000000E+00 80 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 81 + 38 G 0.000000E+00 -8.750042E-02 0.000000E+00 82 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 83 + 39 G 0.000000E+00 -8.791797E-02 0.000000E+00 84 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 85 + 40 G 0.000000E+00 -8.833552E-02 0.000000E+00 86 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 87 + 41 G 0.000000E+00 -8.875307E-02 0.000000E+00 88 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 89 + 42 G 1.002122E-03 -7.205104E-02 0.000000E+00 90 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 91 + 43 G 1.002122E-03 -7.246859E-02 0.000000E+00 92 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 93 + 44 G 1.002122E-03 -7.288614E-02 0.000000E+00 94 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 95 + 45 G 1.002122E-03 -7.330369E-02 0.000000E+00 96 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 97 + 46 G 1.002122E-03 -7.372124E-02 0.000000E+00 98 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 99 + 47 G 1.002122E-03 -7.413879E-02 0.000000E+00 100 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 101 + 48 G 1.002122E-03 -7.455634E-02 0.000000E+00 102 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 103 + 49 G 1.002122E-03 -7.497389E-02 0.000000E+00 104 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 105 + 50 G 1.002122E-03 -7.539145E-02 0.000000E+00 106 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 107 + 51 G 1.002122E-03 -7.580900E-02 0.000000E+00 108 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 109 + 52 G 1.002122E-03 -7.622655E-02 0.000000E+00 110 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 111 + 53 G 1.002122E-03 -7.664410E-02 0.000000E+00 112 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 113 + 54 G 1.002122E-03 -7.706165E-02 0.000000E+00 114 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 115 + 55 G 1.002122E-03 -7.747920E-02 0.000000E+00 116 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 117 + 56 G 1.002122E-03 -7.789675E-02 0.000000E+00 118 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 119 + 57 G 1.002122E-03 -7.831430E-02 0.000000E+00 120 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 121 + 58 G 1.002122E-03 -7.873185E-02 0.000000E+00 122 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 123 + 59 G 1.002122E-03 -7.914940E-02 0.000000E+00 124 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 125 + 60 G 1.002122E-03 -7.956695E-02 0.000000E+00 126 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 127 + 61 G 1.002122E-03 -7.998450E-02 0.000000E+00 128 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 129 + 62 G 1.002122E-03 -8.040206E-02 0.000000E+00 130 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 131 + 63 G 1.002122E-03 -8.081961E-02 0.000000E+00 132 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 133 + 64 G 1.002122E-03 -8.123716E-02 0.000000E+00 134 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 135 + 65 G 1.002122E-03 -8.165471E-02 0.000000E+00 136 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 137 + 66 G 1.002122E-03 -8.207226E-02 0.000000E+00 138 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 139 + 67 G 1.002122E-03 -8.248981E-02 0.000000E+00 140 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 141 + 68 G 1.002122E-03 -8.290736E-02 0.000000E+00 142 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 143 + 69 G 1.002122E-03 -8.332491E-02 0.000000E+00 144 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 145 + 70 G 1.002122E-03 -8.374246E-02 0.000000E+00 146 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 147 + 71 G 1.002122E-03 -8.416001E-02 0.000000E+00 148 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 149 + 72 G 1.002122E-03 -8.457756E-02 0.000000E+00 150 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 151 + 73 G 1.002122E-03 -8.499511E-02 0.000000E+00 152 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 153 + 74 G 1.002122E-03 -8.541266E-02 0.000000E+00 154 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 155 + 75 G 1.002122E-03 -8.583022E-02 0.000000E+00 156 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 157 + 76 G 1.002122E-03 -8.624777E-02 0.000000E+00 158 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 159 + 77 G 1.002122E-03 -8.666532E-02 0.000000E+00 160 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 161 + 78 G 1.002122E-03 -8.708287E-02 0.000000E+00 162 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 163 + 79 G 1.002122E-03 -8.750042E-02 0.000000E+00 164 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 165 + 80 G 1.002122E-03 -8.791797E-02 0.000000E+00 166 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 167 + 81 G 1.002122E-03 -8.833552E-02 0.000000E+00 168 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 169 + 82 G 1.002122E-03 -8.875307E-02 0.000000E+00 170 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 171 + 83 G -1.002122E-03 -7.205104E-02 0.000000E+00 172 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 173 + 84 G -1.002122E-03 -7.246859E-02 0.000000E+00 174 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 175 + 85 G -1.002122E-03 -7.288614E-02 0.000000E+00 176 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 177 + 86 G -1.002122E-03 -7.330369E-02 0.000000E+00 178 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 179 + 87 G -1.002122E-03 -7.372124E-02 0.000000E+00 180 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 181 + 88 G -1.002122E-03 -7.413879E-02 0.000000E+00 182 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 183 + 89 G -1.002122E-03 -7.455634E-02 0.000000E+00 184 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 185 + 90 G -1.002122E-03 -7.497389E-02 0.000000E+00 186 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 187 + 91 G -1.002122E-03 -7.539145E-02 0.000000E+00 188 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 189 + 92 G -1.002122E-03 -7.580900E-02 0.000000E+00 190 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 191 + 93 G -1.002122E-03 -7.622655E-02 0.000000E+00 192 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 193 + 94 G -1.002122E-03 -7.664410E-02 0.000000E+00 194 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 195 + 95 G -1.002122E-03 -7.706165E-02 0.000000E+00 196 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 197 + 96 G -1.002122E-03 -7.747920E-02 0.000000E+00 198 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 199 + 97 G -1.002122E-03 -7.789675E-02 0.000000E+00 200 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 201 + 98 G -1.002122E-03 -7.831430E-02 0.000000E+00 202 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 203 + 99 G -1.002122E-03 -7.873185E-02 0.000000E+00 204 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 205 + 100 G -1.002122E-03 -7.914940E-02 0.000000E+00 206 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 207 + 101 G -1.002122E-03 -7.956695E-02 0.000000E+00 208 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 209 + 102 G -1.002122E-03 -7.998450E-02 0.000000E+00 210 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 211 + 103 G -1.002122E-03 -8.040206E-02 0.000000E+00 212 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 213 + 104 G -1.002122E-03 -8.081961E-02 0.000000E+00 214 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 215 + 105 G -1.002122E-03 -8.123716E-02 0.000000E+00 216 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 217 + 106 G -1.002122E-03 -8.165471E-02 0.000000E+00 218 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 219 + 107 G -1.002122E-03 -8.207226E-02 0.000000E+00 220 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 221 + 108 G -1.002122E-03 -8.248981E-02 0.000000E+00 222 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 223 + 109 G -1.002122E-03 -8.290736E-02 0.000000E+00 224 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 225 + 110 G -1.002122E-03 -8.332491E-02 0.000000E+00 226 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 227 + 111 G -1.002122E-03 -8.374246E-02 0.000000E+00 228 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 229 + 112 G -1.002122E-03 -8.416001E-02 0.000000E+00 230 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 231 + 113 G -1.002122E-03 -8.457756E-02 0.000000E+00 232 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 233 + 114 G -1.002122E-03 -8.499511E-02 0.000000E+00 234 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 235 + 115 G -1.002122E-03 -8.541266E-02 0.000000E+00 236 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 237 + 116 G -1.002122E-03 -8.583022E-02 0.000000E+00 238 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 239 + 117 G -1.002122E-03 -8.624777E-02 0.000000E+00 240 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 241 + 118 G -1.002122E-03 -8.666532E-02 0.000000E+00 242 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 243 + 119 G -1.002122E-03 -8.708287E-02 0.000000E+00 244 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 245 + 120 G -1.002122E-03 -8.750042E-02 0.000000E+00 246 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 247 + 121 G -1.002122E-03 -8.791797E-02 0.000000E+00 248 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 249 + 122 G -1.002122E-03 -8.833552E-02 0.000000E+00 250 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 251 + 123 G -1.002122E-03 -8.875307E-02 0.000000E+00 252 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 253 + 1000 G 0.000000E+00 -7.622655E-02 0.000000E+00 254 +-CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 255 +$TITLE = MSC/MD NASTRAN MODES ANALYSIS SET 256 +$SUBTITLE= 257 +$LABEL = 258 +$EIGENVECTOR 259 +$REAL OUTPUT 260 +$SUBCASE ID = 1 261 +$EIGENVALUE = 2.7739492E+03 MODE = 2 262 + 1 G 0.000000E+00 1.392604E-01 0.000000E+00 263 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 264 + 2 G 0.000000E+00 1.302175E-01 0.000000E+00 265 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 266 + 3 G 0.000000E+00 1.211745E-01 0.000000E+00 267 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 268 + 4 G 0.000000E+00 1.121316E-01 0.000000E+00 269 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 270 + 5 G 0.000000E+00 1.030886E-01 0.000000E+00 271 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 272 + 6 G 0.000000E+00 9.404566E-02 0.000000E+00 273 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 274 + 7 G 0.000000E+00 8.500270E-02 0.000000E+00 275 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 276 + 8 G 0.000000E+00 7.595975E-02 0.000000E+00 277 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 278 + 9 G 0.000000E+00 6.691679E-02 0.000000E+00 279 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 280 + 10 G 0.000000E+00 5.787383E-02 0.000000E+00 281 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 282 + 11 G 0.000000E+00 4.883088E-02 0.000000E+00 283 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 284 + 12 G 0.000000E+00 3.978792E-02 0.000000E+00 285 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 286 + 13 G 0.000000E+00 3.074496E-02 0.000000E+00 287 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 288 + 14 G 0.000000E+00 2.170201E-02 0.000000E+00 289 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 290 + 15 G 0.000000E+00 1.265905E-02 0.000000E+00 291 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 292 + 16 G 0.000000E+00 3.616096E-03 0.000000E+00 293 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 294 + 17 G 0.000000E+00 -5.426860E-03 0.000000E+00 295 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 296 + 18 G 0.000000E+00 -1.446982E-02 0.000000E+00 297 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 298 + 19 G 0.000000E+00 -2.351277E-02 0.000000E+00 299 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 300 + 20 G 0.000000E+00 -3.255573E-02 0.000000E+00 301 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 302 + 21 G 0.000000E+00 -4.159868E-02 0.000000E+00 303 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 304 + 22 G 0.000000E+00 -5.064164E-02 0.000000E+00 305 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 306 + 23 G 0.000000E+00 -5.968460E-02 0.000000E+00 307 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 308 + 24 G 0.000000E+00 -6.872755E-02 0.000000E+00 309 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 310 + 25 G 0.000000E+00 -7.777051E-02 0.000000E+00 311 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 312 + 26 G 0.000000E+00 -8.681347E-02 0.000000E+00 313 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 314 + 27 G 0.000000E+00 -9.585642E-02 0.000000E+00 315 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 316 + 28 G 0.000000E+00 -1.048994E-01 0.000000E+00 317 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 318 + 29 G 0.000000E+00 -1.139423E-01 0.000000E+00 319 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 320 + 30 G 0.000000E+00 -1.229853E-01 0.000000E+00 321 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 322 + 31 G 0.000000E+00 -1.320282E-01 0.000000E+00 323 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 324 + 32 G 0.000000E+00 -1.410712E-01 0.000000E+00 325 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 326 + 33 G 0.000000E+00 -1.501142E-01 0.000000E+00 327 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 328 + 34 G 0.000000E+00 -1.591571E-01 0.000000E+00 329 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 330 + 35 G 0.000000E+00 -1.682001E-01 0.000000E+00 331 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 332 + 36 G 0.000000E+00 -1.772430E-01 0.000000E+00 333 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 334 + 37 G 0.000000E+00 -1.862860E-01 0.000000E+00 335 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 336 + 38 G 0.000000E+00 -1.953289E-01 0.000000E+00 337 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 338 + 39 G 0.000000E+00 -2.043719E-01 0.000000E+00 339 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 340 + 40 G 0.000000E+00 -2.134149E-01 0.000000E+00 341 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 342 + 41 G 0.000000E+00 -2.224578E-01 0.000000E+00 343 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 344 + 42 G 2.170309E-02 1.392604E-01 0.000000E+00 345 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 346 + 43 G 2.170309E-02 1.302175E-01 0.000000E+00 347 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 348 + 44 G 2.170309E-02 1.211745E-01 0.000000E+00 349 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 350 + 45 G 2.170309E-02 1.121316E-01 0.000000E+00 351 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 352 + 46 G 2.170309E-02 1.030886E-01 0.000000E+00 353 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 354 + 47 G 2.170309E-02 9.404566E-02 0.000000E+00 355 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 356 + 48 G 2.170309E-02 8.500270E-02 0.000000E+00 357 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 358 + 49 G 2.170309E-02 7.595975E-02 0.000000E+00 359 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 360 + 50 G 2.170309E-02 6.691679E-02 0.000000E+00 361 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 362 + 51 G 2.170309E-02 5.787383E-02 0.000000E+00 363 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 364 + 52 G 2.170309E-02 4.883088E-02 0.000000E+00 365 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 366 + 53 G 2.170309E-02 3.978792E-02 0.000000E+00 367 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 368 + 54 G 2.170309E-02 3.074496E-02 0.000000E+00 369 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 370 + 55 G 2.170309E-02 2.170201E-02 0.000000E+00 371 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 372 + 56 G 2.170309E-02 1.265905E-02 0.000000E+00 373 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 374 + 57 G 2.170309E-02 3.616096E-03 0.000000E+00 375 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 376 + 58 G 2.170309E-02 -5.426860E-03 0.000000E+00 377 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 378 + 59 G 2.170309E-02 -1.446982E-02 0.000000E+00 379 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 380 + 60 G 2.170309E-02 -2.351277E-02 0.000000E+00 381 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 382 + 61 G 2.170309E-02 -3.255573E-02 0.000000E+00 383 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 384 + 62 G 2.170309E-02 -4.159868E-02 0.000000E+00 385 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 386 + 63 G 2.170309E-02 -5.064164E-02 0.000000E+00 387 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 388 + 64 G 2.170309E-02 -5.968460E-02 0.000000E+00 389 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 390 + 65 G 2.170309E-02 -6.872755E-02 0.000000E+00 391 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 392 + 66 G 2.170309E-02 -7.777051E-02 0.000000E+00 393 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 394 + 67 G 2.170309E-02 -8.681347E-02 0.000000E+00 395 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 396 + 68 G 2.170309E-02 -9.585642E-02 0.000000E+00 397 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 398 + 69 G 2.170309E-02 -1.048994E-01 0.000000E+00 399 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 400 + 70 G 2.170309E-02 -1.139423E-01 0.000000E+00 401 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 402 + 71 G 2.170309E-02 -1.229853E-01 0.000000E+00 403 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 404 + 72 G 2.170309E-02 -1.320282E-01 0.000000E+00 405 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 406 + 73 G 2.170309E-02 -1.410712E-01 0.000000E+00 407 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 408 + 74 G 2.170309E-02 -1.501142E-01 0.000000E+00 409 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 410 + 75 G 2.170309E-02 -1.591571E-01 0.000000E+00 411 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 412 + 76 G 2.170309E-02 -1.682001E-01 0.000000E+00 413 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 414 + 77 G 2.170309E-02 -1.772430E-01 0.000000E+00 415 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 416 + 78 G 2.170309E-02 -1.862860E-01 0.000000E+00 417 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 418 + 79 G 2.170309E-02 -1.953289E-01 0.000000E+00 419 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 420 + 80 G 2.170309E-02 -2.043719E-01 0.000000E+00 421 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 422 + 81 G 2.170309E-02 -2.134149E-01 0.000000E+00 423 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 424 + 82 G 2.170309E-02 -2.224578E-01 0.000000E+00 425 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 426 + 83 G -2.170309E-02 1.392604E-01 0.000000E+00 427 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 428 + 84 G -2.170309E-02 1.302175E-01 0.000000E+00 429 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 430 + 85 G -2.170309E-02 1.211745E-01 0.000000E+00 431 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 432 + 86 G -2.170309E-02 1.121316E-01 0.000000E+00 433 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 434 + 87 G -2.170309E-02 1.030886E-01 0.000000E+00 435 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 436 + 88 G -2.170309E-02 9.404566E-02 0.000000E+00 437 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 438 + 89 G -2.170309E-02 8.500270E-02 0.000000E+00 439 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 440 + 90 G -2.170309E-02 7.595975E-02 0.000000E+00 441 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 442 + 91 G -2.170309E-02 6.691679E-02 0.000000E+00 443 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 444 + 92 G -2.170309E-02 5.787383E-02 0.000000E+00 445 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 446 + 93 G -2.170309E-02 4.883088E-02 0.000000E+00 447 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 448 + 94 G -2.170309E-02 3.978792E-02 0.000000E+00 449 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 450 + 95 G -2.170309E-02 3.074496E-02 0.000000E+00 451 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 452 + 96 G -2.170309E-02 2.170201E-02 0.000000E+00 453 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 454 + 97 G -2.170309E-02 1.265905E-02 0.000000E+00 455 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 456 + 98 G -2.170309E-02 3.616096E-03 0.000000E+00 457 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 458 + 99 G -2.170309E-02 -5.426860E-03 0.000000E+00 459 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 460 + 100 G -2.170309E-02 -1.446982E-02 0.000000E+00 461 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 462 + 101 G -2.170309E-02 -2.351277E-02 0.000000E+00 463 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 464 + 102 G -2.170309E-02 -3.255573E-02 0.000000E+00 465 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 466 + 103 G -2.170309E-02 -4.159868E-02 0.000000E+00 467 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 468 + 104 G -2.170309E-02 -5.064164E-02 0.000000E+00 469 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 470 + 105 G -2.170309E-02 -5.968460E-02 0.000000E+00 471 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 472 + 106 G -2.170309E-02 -6.872755E-02 0.000000E+00 473 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 474 + 107 G -2.170309E-02 -7.777051E-02 0.000000E+00 475 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 476 + 108 G -2.170309E-02 -8.681347E-02 0.000000E+00 477 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 478 + 109 G -2.170309E-02 -9.585642E-02 0.000000E+00 479 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 480 + 110 G -2.170309E-02 -1.048994E-01 0.000000E+00 481 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 482 + 111 G -2.170309E-02 -1.139423E-01 0.000000E+00 483 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 484 + 112 G -2.170309E-02 -1.229853E-01 0.000000E+00 485 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 486 + 113 G -2.170309E-02 -1.320282E-01 0.000000E+00 487 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 488 + 114 G -2.170309E-02 -1.410712E-01 0.000000E+00 489 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 490 + 115 G -2.170309E-02 -1.501142E-01 0.000000E+00 491 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 492 + 116 G -2.170309E-02 -1.591571E-01 0.000000E+00 493 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 494 + 117 G -2.170309E-02 -1.682001E-01 0.000000E+00 495 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 496 + 118 G -2.170309E-02 -1.772430E-01 0.000000E+00 497 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 498 + 119 G -2.170309E-02 -1.862860E-01 0.000000E+00 499 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 500 + 120 G -2.170309E-02 -1.953289E-01 0.000000E+00 501 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 502 + 121 G -2.170309E-02 -2.043719E-01 0.000000E+00 503 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 504 + 122 G -2.170309E-02 -2.134149E-01 0.000000E+00 505 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 506 + 123 G -2.170309E-02 -2.224578E-01 0.000000E+00 507 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 508 + 1000 G 0.000000E+00 4.883088E-02 0.000000E+00 509 +-CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 510 diff --git a/TestCases/py_su2_nastran/solid.cfg b/TestCases/py_su2_nastran/solid.cfg new file mode 100644 index 000000000000..72f2cc925851 --- /dev/null +++ b/TestCases/py_su2_nastran/solid.cfg @@ -0,0 +1,36 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: FSI: Vertical Cantilever in Channel using Python - Structure % +% Author: Ruben Sanchez Fernandez % +% Institution: TU Kaiserslautern % +% Date: 2020-03-04 % +% File Version 7.0.3 "Blackbird" % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%% +% INTEGER VALUES +%%%%%%%%%%%%%%%%%%%%%%% +NMODES = 2 +%%%%%%%%%%%%%%%%%%%%%%% +% STRING VALUES +%%%%%%%%%%%%%%%%%%%%%%% +% +MESH_FILE = modal.f06 +PUNCH_FILE = modal.pch +MOVING_MARKER = airfoil +TIME_MARCHING = YES +RESTART_SOL = NO +% +% +% +%%%%%%%%%%%%%%%%%%%%%%% +% FLOAT VALUES +%%%%%%%%%%%%%%%%%%%%%%% +% +MODAL_DAMPING = 0.0 +DELTA_T = 0.001 +RHO = 0.5 +%%%%%%%%%%%%%%%%%%%%%%% +% Initial conditions for the modes +%%%%%%%%%%%%%%%%%%%%%%% +% 5 degrees and no plunge +INITIAL_MODES = {0:-0.1501,1:-0.2343} diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index ae285f46c67c..d9d50eb7f5b3 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -6,8 +6,8 @@ # \version 7.0.8 "Blackbird" # # SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation +# +# The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) @@ -16,7 +16,7 @@ # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. -# +# # SU2 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -29,21 +29,21 @@ from __future__ import print_function import sys -from TestCase import TestCase +from TestCase import TestCase 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 + '''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 to make sure nothing is broken. ''' test_list = [] - + ###################################### ### RUN TUTORIAL CASES ### ###################################### - + ### Compressible Flow - + # Inviscid Bump tutorial_inv_bump = TestCase('inviscid_bump_tutorial') tutorial_inv_bump.cfg_dir = "../Tutorials/compressible_flow/Inviscid_Bump" @@ -55,7 +55,7 @@ def main(): tutorial_inv_bump.tol = 0.00001 tutorial_inv_bump.no_restart = True test_list.append(tutorial_inv_bump) - + # Inviscid Wedge tutorial_inv_wedge = TestCase('inviscid_wedge_tutorial') tutorial_inv_wedge.cfg_dir = "../Tutorials/compressible_flow/Inviscid_Wedge" @@ -67,7 +67,7 @@ def main(): tutorial_inv_wedge.tol = 0.00001 tutorial_inv_wedge.no_restart = True test_list.append(tutorial_inv_wedge) - + # Inviscid ONERA M6 tutorial_inv_onera = TestCase('inviscid_onera_tutorial') tutorial_inv_onera.cfg_dir = "../Tutorials/compressible_flow/Inviscid_ONERAM6" @@ -79,7 +79,7 @@ def main(): tutorial_inv_onera.tol = 0.00001 tutorial_inv_onera.no_restart = True test_list.append(tutorial_inv_onera) - + # Laminar Cylinder tutorial_lam_cylinder = TestCase('laminar_cylinder_tutorial') tutorial_lam_cylinder.cfg_dir = "../Tutorials/compressible_flow/Laminar_Cylinder" @@ -103,7 +103,7 @@ def main(): tutorial_lam_flatplate.tol = 0.00001 tutorial_lam_flatplate.no_restart = True test_list.append(tutorial_lam_flatplate) - + # Turbulent Flat Plate tutorial_turb_flatplate = TestCase('turbulent_flatplate_tutorial') tutorial_turb_flatplate.cfg_dir = "../Tutorials/compressible_flow/Turbulent_Flat_Plate" @@ -115,7 +115,7 @@ def main(): tutorial_turb_flatplate.tol = 0.00001 tutorial_turb_flatplate.no_restart = True test_list.append(tutorial_turb_flatplate) - + # Transitional FlatPlate tutorial_trans_flatplate = TestCase('transitional_flatplate_tutorial') tutorial_trans_flatplate.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate" @@ -150,7 +150,7 @@ def main(): tutorial_nicfd_nozzle.tol = 0.00001 tutorial_nicfd_nozzle.no_restart = True test_list.append(tutorial_nicfd_nozzle) - + # Unsteady NACA0012 tutorial_unst_naca0012 = TestCase('unsteady_naca0012') @@ -163,7 +163,7 @@ def main(): tutorial_unst_naca0012.tol = 0.00001 tutorial_unst_naca0012.unsteady = True test_list.append(tutorial_unst_naca0012) - + # PROPELLER VARIBLE LOAD propeller_var_load = TestCase('propeller_variable_load') propeller_var_load.cfg_dir = "../Tutorials/compressible_flow/ActuatorDisk_VariableLoad" @@ -176,7 +176,7 @@ def main(): test_list.append(propeller_var_load) ### Design - + # Inviscid NACA 0012 Design tutorial_design_inv_naca0012 = TestCase('design_inv_naca0012') tutorial_design_inv_naca0012.cfg_dir = "../Tutorials/design/Inviscid_2D_Unconstrained_NACA0012" @@ -213,10 +213,22 @@ def main(): tutorial_design_multiobj.no_restart = True test_list.append(tutorial_design_multiobj) + # Multi Objective Design + testcase_su2_nastran = TestCase('py_su2_nastran') + testcase_su2_nastran.cfg_dir = "TestCases/py_su2_nastran" + testcase_su2_nastran.cfg_file = "fsi.cfg" + testcase_su2_nastran.test_iter = 4 + testcase_su2_nastran.test_vals = [0.006316, -0.114296, -2.522122, 0.000000] #last 4 columns + testcase_su2_nastran.su2_exec = "mpirun -np 2 python3 install/bin/fsi_computation.py --parallel -f" + testcase_su2_nastran.timeout = 1600 + testcase_su2_nastran.tol = 0.00001 + testcase_su2_nastran.no_restart = True + test_list.append(testcase_su2_nastran) + ###################################### ### RUN TESTS ### ###################################### - + pass_list = [ test.run_test() for test in test_list ] # Tests summary From ab36f35865cd4ffe35cb95e4424bb4c6a2ff7a89 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 16:58:09 +0100 Subject: [PATCH 119/326] Modifications for code factor --- SU2_PY/SU2_Nastran/compute_polar_modes.py | 2 +- SU2_PY/SU2_Nastran/pysu2_nastran.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SU2_PY/SU2_Nastran/compute_polar_modes.py b/SU2_PY/SU2_Nastran/compute_polar_modes.py index a5a7f3dfc297..ce1abe3ada10 100644 --- a/SU2_PY/SU2_Nastran/compute_polar_modes.py +++ b/SU2_PY/SU2_Nastran/compute_polar_modes.py @@ -40,7 +40,7 @@ def main(): HOME = os.getcwd() FluidCfg = HOME+"/fluid.cfg" SolidCfg = HOME+"/solid.cfg" - FsiCfg = HOME+"/fsi" + FsiCfg = HOME+"/fsi.cfg" MeshFile = HOME+"/airfoil.su2" PchFile = HOME+"/modal.pch" MeshFileNastran = HOME+"/modal.f06" diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index e4d2c8d4b63e..441273157866 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -42,10 +42,10 @@ class ImposedMotionFunction: - def __init__(self,time0,type,parameters): + def __init__(self,time0,tipo,parameters): self.time0 = time0 - self.type = type - for case in switch(self.type): + self.tipo = tipo + for case in switch(self.tipo): if case("SINUSOIDAL"): self.bias = parameters[0] self.amplitude = parameters[1] @@ -60,13 +60,13 @@ def __init__(self,time0,type,parameters): self.omega0 = 1/2*self.kmax break if case(): - sys.exit('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.type)) + sys.exit('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) break def GetDispl(self,time): time = time - self.time0 - for case in switch(self.type): + for case in switch(self.tipo): if case("SINUSOIDAL"): return self.bias+self.amplitude*sin(2*pi*self.frequency*time) break @@ -78,7 +78,7 @@ def GetDispl(self,time): def GetVel(self,time): time = time - self.time0 - for case in switch(self.type): + for case in switch(self.tipo): if case("SINUSOIDAL"): return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency break @@ -90,7 +90,7 @@ def GetVel(self,time): def GetAcc(self,time): time = time - self.time0 - for case in switch(self.type): + for case in switch(self.tipo): if case("SINUSOIDAL"): return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 break From 9b94b0d865d3df00763d7bececa3d78d7ff5e1ce Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 17:00:16 +0100 Subject: [PATCH 120/326] Removed unrequired file --- SU2_PY/SU2_Nastran/compute_polar_modes.py | 108 ---------------------- 1 file changed, 108 deletions(-) delete mode 100644 SU2_PY/SU2_Nastran/compute_polar_modes.py diff --git a/SU2_PY/SU2_Nastran/compute_polar_modes.py b/SU2_PY/SU2_Nastran/compute_polar_modes.py deleted file mode 100644 index ce1abe3ada10..000000000000 --- a/SU2_PY/SU2_Nastran/compute_polar_modes.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python - -## \file compute_polar_modes.py -# \brief Polar computation using the FSI tools, with different mode amplitudes. -# \version 7.0.8 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -# -# Author: Nicola Fonzi - -import numpy as np -import os -import shutil - -def main(): - - # Main variables - alpha = np.array([0, 4, 6, 8, 10, 12, 14, 15, 16, 17]) - NModeSteps = 1 - Restart = False - HOME = os.getcwd() - FluidCfg = HOME+"/fluid.cfg" - SolidCfg = HOME+"/solid.cfg" - FsiCfg = HOME+"/fsi.cfg" - MeshFile = HOME+"/airfoil.su2" - PchFile = HOME+"/modal.pch" - MeshFileNastran = HOME+"/modal.f06" - RestartFile = HOME+"/restart_flow.dat" - - - # Initialisation - - for AoA in alpha: - os.chdir(HOME) - HOMEALPHA = os.getcwd()+"/Alpha={:2.1f}".format(AoA) - os.mkdir(HOMEALPHA) - writeFluidCfg(AoA,FluidCfg) - for mode in range(NModeStepsStep): - os.chdir(HOMEALPHA) - writeSolidCfg(mode,SolidCfg) - HOMEMODE = os.getcwd()+"/Mode={:2.1f}".format(mode) - os.mkdir(HOMEMODE) - shutil.copyfile(FluidCfg,HOMEMODE+"/fluid_new.cfg") - shutil.copyfile(FluidCfg,HOMEMODE+"/solid_new.cfg") - shutil.copyfile(MeshFile,HOMEMODE+"/airfoil.su2") - shutil.copyfile(FsiCfg,HOMEMODE+"/fsi.cfg") - shutil.copyfile(MeshFileNastran,HOMEMODE+"/modal.f06") - shutil.copyfile(PchFile,HOMEMODE+"/modal.pch") - if Restart: - shutil.copyfile(HOME+"/restart_flow.dat",HOMEMODE+"/restart_flow.dat") - os.chdir(HOMEMODE) - os.system("mpirun -np 38 python3 /scratch/aero/nfonzi/usr/SU2/bin/fsi_computation.py --parallel -f fsi.cfg > log.txt") - -def replace_line(file_name, line_num, text): - lines = open(file_name, 'r').readlines() - lines[line_num] = text - out = open(file_name, 'w') - out.writelines(lines) - out.close() - -def writeFluidCfg(alpha,FluidCfg): - line_num = 0 - with open(FluidCfg) as configfile: - while 1: - line = configfile.readline() - if not line: - break - pos = line.find('AOA') - if pos >= 0: - break - line_num = line_num + 1 - replace_line(FluidCfg,line_num,"AOA = "+str(alpha)) - -def writeSolidCfg(mode,SolidCfg): - line_num = 0 - with open(SolidCfg) as configfile: - while 1: - line = configfile.readline() - if not line: - break - pos = line.find('INITIAL_MODES') - if pos >= 0: - break - line_num = line_num + 1 - replace_line(SolidCfg,line_num,"INITIAL_MODES = {"+str(int(mode))+":1.0}") - - -if __name__ == '__main__': - main() From 0a4b6797f966a2cad90deabc6f5699e14257fa54 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 17:09:37 +0100 Subject: [PATCH 121/326] Removed unrequired meson line --- SU2_PY/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index 03451a192294..5addc2a5de2e 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -77,6 +77,5 @@ install_data(['FSI_tools/__init__.py', install_dir: join_paths(get_option('bindir'), 'FSI_tools')) install_data(['SU2_Nastran/__init__.py', - 'SU2_Nastran/pysu2_nastran.py', - 'SU2_Nastran/compute_polar_modes.py'], + 'SU2_Nastran/pysu2_nastran.py'], install_dir: join_paths(get_option('bindir'), 'SU2_Nastran')) From d6a10d77a9e9d557c4980c2dbd1486c67bdb698e Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 18:22:29 +0100 Subject: [PATCH 122/326] Corrected headers --- TestCases/py_su2_nastran/fluid.cfg | 16 ++++++++-------- TestCases/py_su2_nastran/fsi.cfg | 12 +++++++----- TestCases/py_su2_nastran/solid.cfg | 18 ++++++++++-------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/TestCases/py_su2_nastran/fluid.cfg b/TestCases/py_su2_nastran/fluid.cfg index 6e94b3b4736b..f2dfaef63b69 100644 --- a/TestCases/py_su2_nastran/fluid.cfg +++ b/TestCases/py_su2_nastran/fluid.cfg @@ -1,18 +1,18 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unsteady periodic detached NACA0012 simulation % -% Author: Steffen Schotthöfer % -% Institution: TU Kaiserslautern % -% Date: Jan 21, 2020 % -% File Version 7.0.1 "Blackbird" (or newer) % +% Case description: Unsteady FSI of a NACA 0012 % +% Author: Nicola Fonzi, Vittorio Cavalieri % +% Institution: Politecnico di Milano % +% Date: Dec 10, 2020 % +% File Version 7.0.8 "Blackbird" (or newer) % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES, NS_PLASMA) -% +% SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) @@ -165,7 +165,7 @@ CONV_RESIDUAL_MINVAL= -9.0 % % % Mesh input file -MESH_FILENAME= airfoil.su2 +MESH_FILENAME= airfoil.su2 % % Mesh input file format (SU2, CGNS, NETCDF_ASCII) MESH_FORMAT= SU2 @@ -182,7 +182,7 @@ SOLUTION_ADJ_FILENAME= restart_adj.dat % Output file format (PARAVIEW, TECPLOT, STL) TABULAR_FORMAT= CSV % -% Output file convergence history (w/o extension) +% Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow diff --git a/TestCases/py_su2_nastran/fsi.cfg b/TestCases/py_su2_nastran/fsi.cfg index 8047b52a57e1..ff6b0723f41a 100644 --- a/TestCases/py_su2_nastran/fsi.cfg +++ b/TestCases/py_su2_nastran/fsi.cfg @@ -1,10 +1,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % % SU2 configuration file % -% Case description: FSI: Template % -% Author: % -% Institution: % -% Date: % -% File Version 7.0.2 "Blackbird" % +% Case description: Unsteady FSI of a NACA 0012 % +% Author: Nicola Fonzi, Vittorio Cavalieri % +% Institution: Politecnico di Milano % +% Date: Dec 10, 2020 % +% File Version 7.0.8 "Blackbird" (or newer) % +% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% % INTEGER VALUES diff --git a/TestCases/py_su2_nastran/solid.cfg b/TestCases/py_su2_nastran/solid.cfg index 72f2cc925851..d14658a017c6 100644 --- a/TestCases/py_su2_nastran/solid.cfg +++ b/TestCases/py_su2_nastran/solid.cfg @@ -1,11 +1,13 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% SU2 configuration file % -% Case description: FSI: Vertical Cantilever in Channel using Python - Structure % -% Author: Ruben Sanchez Fernandez % -% Institution: TU Kaiserslautern % -% Date: 2020-03-04 % -% File Version 7.0.3 "Blackbird" % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Unsteady FSI of a NACA 0012 % +% Author: Nicola Fonzi, Vittorio Cavalieri % +% Institution: Politecnico di Milano % +% Date: Dec 10, 2020 % +% File Version 7.0.8 "Blackbird" (or newer) % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% % INTEGER VALUES %%%%%%%%%%%%%%%%%%%%%%% From b74187802d36c188aed0514861962b26655445d0 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 18:30:35 +0100 Subject: [PATCH 123/326] Removed unrequired options --- TestCases/py_su2_nastran/fluid.cfg | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/TestCases/py_su2_nastran/fluid.cfg b/TestCases/py_su2_nastran/fluid.cfg index f2dfaef63b69..39e63931adae 100644 --- a/TestCases/py_su2_nastran/fluid.cfg +++ b/TestCases/py_su2_nastran/fluid.cfg @@ -104,14 +104,6 @@ CFL_NUMBER= 20.0 % Adaptive CFL number (NO, YES) CFL_ADAPT= NO % -% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, -% CFL max value ) -CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) -% -% Runge-Kutta alpha coefficients -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -% -% % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES % @@ -127,14 +119,6 @@ LINEAR_SOLVER_ITER= 10 % TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= JST % -% Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_FLOW= YES -% Slope limiter (VENKATAKRISHNAN, MINMOD) -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -% JST_SENSOR_COEFF= ( 0.5, 0.01 ) % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -147,7 +131,6 @@ CONV_NUM_METHOD_TURB= SCALAR_UPWIND % Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) % MUSCL_TURB= NO -SLOPE_LIMITER_TURB= VENKATAKRISHNAN % % Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT From 0b38cd021c335d3a70c5a1997e8c1e9bebf2b6f5 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 29 Dec 2020 18:39:54 +0100 Subject: [PATCH 124/326] Better handling of errors --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 441273157866..890e2d2e0284 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -29,7 +29,7 @@ # Imports # ---------------------------------------------------------------------- -import os, sys, shutil, copy +import os, shutil, copy import numpy as np import scipy as sp import scipy.linalg as linalg @@ -60,7 +60,7 @@ def __init__(self,time0,tipo,parameters): self.omega0 = 1/2*self.kmax break if case(): - sys.exit('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) + raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) break @@ -359,7 +359,7 @@ def __readConfig(self): break if case(): - sys.exit('{} is an invalid option !'.format(this_param)) + raise Exception('{} is an invalid option !'.format(this_param)) break @@ -403,7 +403,7 @@ def nastran_float(s): if self.refsystems[iRefSys].GetCID()==CP: break if self.refsystems[iRefSys].GetCID()!=CP: - sys.exit('Definition reference {} system not found'.format(CP)) + raise Exception('Definition reference {} system not found'.format(CP)) DeltaPos = self.refsystems[iRefSys].GetOrigin() RotatedPos = self.refsystems[iRefSys].GetRotMatrix().dot(np.array([[x],[y],[z]])) x = RotatedPos[0]+DeltaPos[0] @@ -428,8 +428,7 @@ def nastran_float(s): self.refsystems[self.nRefSys].SetCID(CID) RID = int(line[16:24]) if RID!=0: - print('ERROR: Reference system {} must be defined with respect to global reference system'.format(CID)) - sys.exit() + raise Exception('ERROR: Reference system {} must be defined with respect to global reference system'.format(CID)) self.refsystems[self.nRefSys].SetRID(RID) AX = nastran_float(line[24:32]) AY = nastran_float(line[32:40]) @@ -541,7 +540,7 @@ def __setStructuralMatrices(self): if self.refsystems[iRefSys].GetCID()==self.node[iPoint].GetCD(): break if self.refsystems[iRefSys].GetCID()!=self.node[iPoint].GetCD(): - sys.exit('Output reference {} system not found'.format(self.node[iPoint].GetCD())) + raise Exception('Output reference {} system not found'.format(self.node[iPoint].GetCD())) RotatedOutput = self.refsystems[iRefSys].GetRotMatrix().dot(np.array([[ux],[uy],[uz]])) ux = RotatedOutput[0] uy = RotatedOutput[1] @@ -564,8 +563,7 @@ def __setStructuralMatrices(self): self.UzT = self.Uz.transpose() if n Date: Tue, 29 Dec 2020 19:07:11 +0100 Subject: [PATCH 125/326] Improved output --- SU2_PY/FSI_tools/FSIInterface.py | 6 ++++-- SU2_PY/SU2_Nastran/pysu2_nastran.py | 12 ++++++++---- SU2_PY/fsi_computation.py | 15 ++++++++++----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 951460377d6b..4d524e6560e2 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1956,7 +1956,8 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): if TimeIter > TimeIterTreshold: NbFSIIter = NbFSIIterMax - self.MPIPrint('\n*************** Enter Block Gauss Seidel (BGS) method for strong coupling FSI on time iteration {} ***************'.format(TimeIter)) + self.MPIPrint("\n") + self.MPIPrint(" Enter Block Gauss Seidel (BGS) method for strong coupling FSI on time iteration {} ".format(TimeIter).center(80,"*")) else: NbFSIIter = 1 @@ -2069,7 +2070,8 @@ def SteadyFSI(self, FSI_config,FluidSolver, SolidSolver): self.MPIPrint('\n********************************') self.MPIPrint('* Begin steady FSI computation *') self.MPIPrint('********************************\n') - self.MPIPrint('\n*************** Enter Block Gauss Seidel (BGS) method for strong coupling FSI ***************') + self.MPIPrint("\n") + self.MPIPrint(" Enter Block Gauss Seidel (BGS) method for strong coupling FSI ".center(80,"*")) self.MPIPrint('Setting initial deformed mesh') if myid in self.solidSolverProcessors: diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 890e2d2e0284..ff37fac2fcd7 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -251,7 +251,8 @@ def __init__(self, config_fileName, ImposedMotion): self.Config_file = config_fileName self.Config = {} - print("\n---------- Configuring the structural tester solver for FSI simulation ----------") + print("\n") + print(" Configuring the structural tester solver for FSI simulation ".center(80,"-")) self.__readConfig() self.Mesh_file = self.Config['MESH_FILE'] @@ -286,13 +287,16 @@ def __init__(self, config_fileName, ImposedMotion): self.ImposedMotionToSet = True self.ImposedMotionFunction = [] - print("\n------------------------------- Reading the mesh -------------------------------") + print("\n") + print(" Reading the mesh ".center(80,"-")) self.__readNastranMesh() - print("\n------------------------- Creating the structural model ------------------------") + print("\n") + print(" Creating the structural model ".center(80,"-")) self.__setStructuralMatrices() - print("\n---------------------- Setting the integration parameters ----------------------") + print("\n") + print(" Setting the integration parameters ".center(80,"-")) self.__setIntegrationParameters() self.__setInitialConditions() diff --git a/SU2_PY/fsi_computation.py b/SU2_PY/fsi_computation.py index c4b8a0e277fc..d9af21ba2663 100644 --- a/SU2_PY/fsi_computation.py +++ b/SU2_PY/fsi_computation.py @@ -97,7 +97,8 @@ def main(): # --- Initialize the fluid solver --- # if myid == rootProcess: - print('\n***************************** Initializing fluid solver *****************************') + print("\n") + print(" Initializing fluid solver ".center(80,"*")) try: FluidSolver = pysu2.CSinglezoneDriver(CFD_ConFile, 1, comm) except TypeError as exception: @@ -113,7 +114,8 @@ def main(): # --- Initialize the solid solver --- # (!! for now we are using only serial solid solvers) if myid == rootProcess: - print('\n***************************** Initializing solid solver *****************************') + print("\n") + print(" Initializing solid solver ".center(80,"*")) if CSD_Solver == 'AEROELASTIC': from SU2_Nastran import pysu2_nastran SolidSolver = pysu2_nastran.Solver(CSD_ConFile,False) @@ -130,19 +132,22 @@ def main(): # --- Initialize and set the FSI interface (coupling environement) --- # if myid == rootProcess: - print('\n***************************** Initializing FSI interface *****************************') + print("\n") + print(" Initializing FSI interface ".center(80,"*")) if have_MPI: comm.barrier() FSIInterface = FSI.Interface(FSI_config, FluidSolver, SolidSolver, have_MPI) if myid == rootProcess: - print('\n***************************** Connect fluid and solid solvers *****************************') + print("\n") + print(" Connect fluid and solid solvers ".center(80,"*")) if have_MPI: comm.barrier() FSIInterface.connect(FSI_config, FluidSolver, SolidSolver) if myid == rootProcess: - print('\n***************************** Mapping fluid-solid interfaces *****************************') + print("\n") + print(" Mapping fluid-solid interfaces ".center(80,"*")) if have_MPI: comm.barrier() FSIInterface.interfaceMapping(FluidSolver, SolidSolver, FSI_config) From 95f66147f191dc408f9e0550b0d452f3add3ce61 Mon Sep 17 00:00:00 2001 From: bigfootedrockmidget Date: Sat, 9 Jan 2021 16:38:47 +0100 Subject: [PATCH 126/326] add testcase for intersection prevention --- TestCases/deformation/config.cfg | 452 ++++++++++++++++++ .../intersection_prevention/config.cfg | 452 ++++++++++++++++++ 2 files changed, 904 insertions(+) create mode 100644 TestCases/deformation/config.cfg create mode 100644 TestCases/deformation/intersection_prevention/config.cfg diff --git a/TestCases/deformation/config.cfg b/TestCases/deformation/config.cfg new file mode 100644 index 000000000000..e13c859d6454 --- /dev/null +++ b/TestCases/deformation/config.cfg @@ -0,0 +1,452 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% case description: % +% This is a test for the new implementation to prevent % +% self-intersecting meshes % +% after mesh deformation. You can run the test by first running SU2_CFD % +% and then SU2_DEF % +% documentation: Lennaert Tol, Automatic Design Optimization of a Bunsen % +% Burner, MSc. Thesis Technische Universiteit Eindhoven (2020) % +% https://pure.tue.nl/ws/portalfiles/portal/165889356/0894988_Tol.pdf % +% the new keywords are on line 374-396 % +% Author: % +% Lennaert Tol and Nijso Beishuizen % +% Institution: % +% Technische Universiteit Eindhoven % +% Date: 2021.01.08 % +% File Version 7.0.8 "Blackbird" % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER = INC_NAVIER_STOKES + +% Specify turbulent model (NONE, SA, SA_NEG, SST) +KIND_TURB_MODEL= NONE + +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT + +% Restart solution (NO, YES) +RESTART_SOL = NO + +AXISYMMETRIC = NO + +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. + +INC_DENSITY_MODEL= CONSTANT + +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = NO + +% Initial density for incompressible flows +% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) +INC_DENSITY_INIT= 1.1728 + +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= (1.0, 0.0, 0.0 ) + +% Initial temperature for incompressible flows that include the +% energy equation (288.15 K by default). Value is ignored if +% INC_ENERGY_EQUATION is false. +INC_TEMPERATURE_INIT= 300.0 + +% List of inlet types for incompressible flows. List length must +% match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. +INC_INLET_TYPE= VELOCITY_INLET +% +% Damping coefficient for iterative updates at pressure inlets. (0.1 by default) +INC_INLET_DAMPING= 0.1 + +% List of outlet types for incompressible flows. List length must +% match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET +INC_OUTLET_TYPE= PRESSURE_OUTLET +% +% Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) +INC_OUTLET_DAMPING= 0.1 + +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= DIMENSIONAL + + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS) +FLUID_MODEL= CONSTANT_DENSITY +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP= 1004.703 + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.83463e-05 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 0.72 +% +% Turbulent Prandtl number (0.9 (air), only for CONSTANT_PRANDTL) +PRANDTL_TURB= 0.90 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +% Reference origin for moment computation +REF_ORIGIN_MOMENT_X = 0.00 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +% Reference length for pitching, rolling, and yawing non-dimensional moment +REF_LENGTH= 1.0 + +% Reference area for force coefficients (0 implies automatic calculation) +REF_AREA= 0.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +% Navier-Stokes wall boundary marker(s) (NONE = no marker) + +MARKER_PLOTTING = (outlet) +MARKER_ANALYZE = (outlet) + +MARKER_HEATFLUX= (wall_inner_bottom, 0.0, wall_inner_right, 0.0, wall_inner_top, 0.0) + +SPECIFIED_INLET_PROFILE= NO + +INLET_FILENAME = inletVelocity.dat + +INLET_MATCHING_TOLERANCE= 1e-5 + +% Inlet boundary marker(s) +MARKER_INLET = (inlet, 300.0, 1.0, 1.0, 0.0, 0.0) + +% Outler boundary marker (s) +MARKER_OUTLET = (outlet, 0.0) + +% Symmetry boundary marker +MARKER_SYM = (wall_outer) + +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= (outlet) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS + +% Courant-Friedrichs-Lewy condition of the finest grid + +CFL_NUMBER=100 + +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO + +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) + + +% Runge-Kutta alpha coefficients +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) + +% Number of total iterations +%EXT_ITER = 25 +ITER = 10000 + +% Writing solution file frequency +OUTPUT_WRT_FREQ= 50 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +% Linear solver for implicit formulations (BCGSTAB, FGMRES) +LINEAR_SOLVER= FGMRES + +% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) +LINEAR_SOLVER_PREC= ILU + +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-10 + +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 100 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +% Multi-Grid Levels (0 = no multi-grid) +MGLEVEL= 0 + +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE + +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) + +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) + +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) + +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.8 + +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% + +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= FDS + +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= NO + +% Slope limiter (VENKATAKRISHNAN, MINMOD) +SLOPE_LIMITER_FLOW= NONE + +% Coefficient for the limiter (smooth regions) +VENKAT_LIMITER_COEFF= 10.0 + +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.05, 0.02 ) + +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_ADJFLOW= FDS +ADJ_JST_SENSOR_COEFF= ( 0.05, 0.02 ) +CFL_REDUCTION_ADJFLOW= 0.5 +TIME_DISCRE_ADJFLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA= RESIDUAL + +% Min value of the residual (log10 of the residual) +%RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -10 + +% Start convergence criteria at iteration number +CONV_STARTITER= 100 + +% Number of elements to apply the criteria +CONV_CAUCHY_ELEMS= 20 + +% Epsilon to control the series convergence +CONV_CAUCHY_EPS= 1E-6 + +% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, +% SENS_MACH, DELTA_LIFT, DELTA_DRAG) + +SCREEN_OUTPUT = INNER_ITER WALL_TIME RMS_PRESSURE RMS_VELOCITY-X RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X U +CONV_FIELD = (RMS_PRESSURE, RMS_ADJ_PRESSURE) + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + + + +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 + +% Restart flow input file +%SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat + +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= solution_adj.dat + +% Output file format (PARAVIEW, PARAVIEW_BINARY, TECPLOT, STL) +OUTPUT_FILES = (RESTART, PARAVIEW_ASCII, SURFACE_CSV) +TABULAR_FORMAT = CSV + +% Output file convergence history (w/o extension) +CONV_FILENAME= history + +% Output file restart flow +%RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat + +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat + +% Output file flow (w/o extension) variables +%VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow + +% Output file adjoint (w/o extension) variables +VOLUME_ADJ_FILENAME= adjoint + +% Output objective function gradient (using continuous adjoint) +GRAD_OBJFUNC_FILENAME= of_grad.dat + +% Output file surface flow coefficient (w/o extension) +%SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow + +% Output file surface adjoint coefficient (w/o extension) +SURFACE_ADJ_FILENAME= surface_adjoint + +VOLUME_OUTPUT= RESIDUAL PRIMITIVE SOURCE SENSITIVITY COEFFICIENT + +% Writing convergence history frequency +SCREEN_WRT_FREQ_INNER = 1 +SCREEN_WRT_FREQ_OUTER = 1 + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, +% FFD_SETTING, FFD_NACELLE +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, +% HICKS_HENNE, SURFACE_BUMP) + +DV_KIND= FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D + +MESH_FILENAME = mesh_ffd.su2 + +% Mesh output file +MESH_OUT_FILENAME= mesh_ffd_deformed.su2 + +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= (wall_inner_bottom, wall_inner_right, wall_inner_top) + +% Parameters of the shape deformation +DV_PARAM= (MAIN_BOX, 0, 0, 0.0, 1.0); (MAIN_BOX, 1, 0, 0.0, 1.0); (MAIN_BOX, 2, 0, 0.0, 1.0); (MAIN_BOX, 3, 0, 0.0, 1.0); (MAIN_BOX, 4, 0, 0.0, 1.0); (MAIN_BOX, 5, 0, 0.0, 1.0); (MAIN_BOX, 6, 0, 0.0, 1.0); (MAIN_BOX, 7, 0, 0.0, 1.0); (MAIN_BOX, 8, 0, 0.0, 1.0); (MAIN_BOX, 9, 0, 0.0, 1.0); (MAIN_BOX, 10, 0, 0.0, 1.0); (MAIN_BOX, 0, 1, 0.0, 1.0); (MAIN_BOX, 1, 1, 0.0, 1.0); (MAIN_BOX, 2, 1, 0.0, 1.0); (MAIN_BOX, 3, 1, 0.0, 1.0); (MAIN_BOX, 4, 1, 0.0, 1.0); (MAIN_BOX, 5, 1, 0.0, 1.0); (MAIN_BOX, 6, 1, 0.0, 1.0); (MAIN_BOX, 7, 1, 0.0, 1.0); (MAIN_BOX, 8, 1, 0.0, 1.0); (MAIN_BOX, 9, 1, 0.0, 1.0); (MAIN_BOX, 10, 1, 0.0, 1.0) + +% Value of the shape deformation +DV_VALUE = 0, 0.0002, 0.0004, 0.0006, 0.0008, 0.001, 0.0012, 0.0014, 0.0016, 0.0018, 0.002, 0,-0.0002, -0.0004, -0.0006, -0.0008, -0.0010, -0.0012, -0.0014, -0.0016, -0.0018, -0.002 + +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Factor to multiply smallest cell volume for deform tolerance (0.001 default) +% DEFORM_TOL_FACTOR = 1e-10 +DEFORM_LINEAR_SOLVER_ERROR = 1e-5 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% + + +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 + +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 + +% -------------------------------------------------------------------------- % +% ----- NEW: intersection prevention --------------------------------------- % +% -------------------------------------------------------------------------- % +% Parameters for prevention of self-intersections within FFD box +% (after mesh deformation) +% switch on the check and repair for mesh intersection +FFD_INTPREV = YES +% +% number of iterations to make sure that the self-intersection has been resolved +FFD_INTPREV_ITER = 2 +% +% number of times we half the deformation within an iteration +FFD_INTPREV_DEPTH= 3 + +% Parameters for prevention of nonconvex elements in mesh after deformation +% switch on the check and repait for convexity of cells +CONVEXITY_CHECK = YES +% number of iterations +CONVEXITY_CHECK_ITER = 10 +% depth per iteration (number of times we half the deformation within an iteration) +CONVEXITY_CHECK_DEPTH = 3 +% -------------------------------------------------------------------------- % + +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (MAIN_BOX, 0.02, 0.005, 0, 0.05, 0.005, 0.0, 0.05, 0.007, 0.0, 0.02, 0.007, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= ( 10, 1, 0) + +% +% Surface continuity at the intersection with the FFD (1ST_DERIVATIVE, 2ND_DERIVATIVE) +FFD_CONTINUITY= USER_INPUT + +% +% Optimization objective function with scaling factor, separated by semicolons. +% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. +% ex= Objective * Scale +%OPT_OBJECTIVE= TOTAL_HEATFLUX * 1e-5 +OPT_OBJECTIVE= DRAG*5.0e-3 + +% +% Optimization constraint functions with pushing factors (affects its value, not the gradient in the python scripts), separated by semicolons +% ex= (Objective = Value ) * Scale, use '>','<','=' +OPT_CONSTRAINT= NONE + +% +% Factor to reduce the norm of the gradient (affects the objective function and gradient in the python scripts) +% In general, a norm of the gradient ~1E-6 is desired. +OPT_GRADIENT_FACTOR= 1.0 +% +% Factor to relax or accelerate the optimizer convergence (affects the line search in SU2_DEF) +% In general, surface deformations of 0.01'' or 0.0001m are desirable +OPT_RELAX_FACTOR= 1.0 +% +% Maximum number of iterations +OPT_ITERATIONS= 20 +% +% Requested accuracy +OPT_ACCURACY= 1E-200 + +% Optimization bound (bounds the line search in SU2_DEF) +OPT_LINE_SEARCH_BOUND= 1E6 +% +% Upper bound for each design variable (bound in the python optimizer) +OPT_BOUND_UPPER = 1e10 +OPT_BOUND_LOWER = -1e10 + +% +% Finite difference step size for python scripts (0.001 default, recommended +% 0.001 x REF_LENGTH) +FIN_DIFF_STEP = 1e-3 +% +DEFINITION_DV= (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 1, 0.0, 1.0) diff --git a/TestCases/deformation/intersection_prevention/config.cfg b/TestCases/deformation/intersection_prevention/config.cfg new file mode 100644 index 000000000000..9da3baedc893 --- /dev/null +++ b/TestCases/deformation/intersection_prevention/config.cfg @@ -0,0 +1,452 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% case description: % +% This is a test for the new implementation to prevent % +% self-intersecting meshes % +% after mesh deformation. You can run the test by first running SU2_CFD % +% and then SU2_DEF % +% documentation: Lennaert Tol, Automatic Design Optimization of a Bunsen % +% Burner, MSc. Thesis Technische Universiteit Eindhoven (2020) % +% https://pure.tue.nl/ws/portalfiles/portal/165889356/0894988_Tol.pdf % +% the new keywords are on line 374-397 % +% Author: % +% Lennaert Tol and Nijso Beishuizen % +% Institution: % +% Technische Universiteit Eindhoven % +% Date: 2021.01.08 % +% File Version 7.0.8 "Blackbird" % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER = INC_NAVIER_STOKES + +% Specify turbulent model (NONE, SA, SA_NEG, SST) +KIND_TURB_MODEL= NONE + +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT + +% Restart solution (NO, YES) +RESTART_SOL = NO + +AXISYMMETRIC = NO + +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +% Density model within the incompressible flow solver. +% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, +% an appropriate fluid model must be selected. + +INC_DENSITY_MODEL= CONSTANT + +% Solve the energy equation in the incompressible flow solver +INC_ENERGY_EQUATION = NO + +% Initial density for incompressible flows +% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) +INC_DENSITY_INIT= 1.1728 + +% Initial velocity for incompressible flows (1.0,0,0 m/s by default) +INC_VELOCITY_INIT= (1.0, 0.0, 0.0 ) + +% Initial temperature for incompressible flows that include the +% energy equation (288.15 K by default). Value is ignored if +% INC_ENERGY_EQUATION is false. +INC_TEMPERATURE_INIT= 300.0 + +% List of inlet types for incompressible flows. List length must +% match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. +INC_INLET_TYPE= VELOCITY_INLET +% +% Damping coefficient for iterative updates at pressure inlets. (0.1 by default) +INC_INLET_DAMPING= 0.1 + +% List of outlet types for incompressible flows. List length must +% match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET +INC_OUTLET_TYPE= PRESSURE_OUTLET +% +% Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) +INC_OUTLET_DAMPING= 0.1 + +% Non-dimensionalization scheme for incompressible flows. Options are +% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. +% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. +INC_NONDIM= DIMENSIONAL + + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS) +FLUID_MODEL= CONSTANT_DENSITY +% +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). +SPECIFIC_HEAT_CP= 1004.703 + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.83463e-05 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 0.72 +% +% Turbulent Prandtl number (0.9 (air), only for CONSTANT_PRANDTL) +PRANDTL_TURB= 0.90 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +% Reference origin for moment computation +REF_ORIGIN_MOMENT_X = 0.00 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +% Reference length for pitching, rolling, and yawing non-dimensional moment +REF_LENGTH= 1.0 + +% Reference area for force coefficients (0 implies automatic calculation) +REF_AREA= 0.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +% Navier-Stokes wall boundary marker(s) (NONE = no marker) + +MARKER_PLOTTING = (outlet) +MARKER_ANALYZE = (outlet) + +MARKER_HEATFLUX= (wall_inner_bottom, 0.0, wall_inner_right, 0.0, wall_inner_top, 0.0) + +SPECIFIED_INLET_PROFILE= NO + +INLET_FILENAME = inletVelocity.dat + +INLET_MATCHING_TOLERANCE= 1e-5 + +% Inlet boundary marker(s) +MARKER_INLET = (inlet, 300.0, 1.0, 1.0, 0.0, 0.0) + +% Outler boundary marker (s) +MARKER_OUTLET = (outlet, 0.0) + +% Symmetry boundary marker +MARKER_SYM = (wall_outer) + +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= (outlet) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS + +% Courant-Friedrichs-Lewy condition of the finest grid + +CFL_NUMBER=100 + +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO + +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) + + +% Runge-Kutta alpha coefficients +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) + +% Number of total iterations +%EXT_ITER = 25 +ITER = 10000 + +% Writing solution file frequency +OUTPUT_WRT_FREQ= 50 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +% Linear solver for implicit formulations (BCGSTAB, FGMRES) +LINEAR_SOLVER= FGMRES + +% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) +LINEAR_SOLVER_PREC= ILU + +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-10 + +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 100 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +% Multi-Grid Levels (0 = no multi-grid) +MGLEVEL= 0 + +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE + +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) + +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) + +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) + +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.8 + +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% + +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= FDS + +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= NO + +% Slope limiter (VENKATAKRISHNAN, MINMOD) +SLOPE_LIMITER_FLOW= NONE + +% Coefficient for the limiter (smooth regions) +VENKAT_LIMITER_COEFF= 10.0 + +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.05, 0.02 ) + +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_ADJFLOW= FDS +ADJ_JST_SENSOR_COEFF= ( 0.05, 0.02 ) +CFL_REDUCTION_ADJFLOW= 0.5 +TIME_DISCRE_ADJFLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA= RESIDUAL + +% Min value of the residual (log10 of the residual) +%RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -10 + +% Start convergence criteria at iteration number +CONV_STARTITER= 100 + +% Number of elements to apply the criteria +CONV_CAUCHY_ELEMS= 20 + +% Epsilon to control the series convergence +CONV_CAUCHY_EPS= 1E-6 + +% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, +% SENS_MACH, DELTA_LIFT, DELTA_DRAG) + +SCREEN_OUTPUT = INNER_ITER WALL_TIME RMS_PRESSURE RMS_VELOCITY-X RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X U +CONV_FIELD = (RMS_PRESSURE, RMS_ADJ_PRESSURE) + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + + + +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 + +% Restart flow input file +%SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat + +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= solution_adj.dat + +% Output file format (PARAVIEW, PARAVIEW_BINARY, TECPLOT, STL) +OUTPUT_FILES = (RESTART, PARAVIEW_ASCII, SURFACE_CSV) +TABULAR_FORMAT = CSV + +% Output file convergence history (w/o extension) +CONV_FILENAME= history + +% Output file restart flow +%RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat + +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat + +% Output file flow (w/o extension) variables +%VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow + +% Output file adjoint (w/o extension) variables +VOLUME_ADJ_FILENAME= adjoint + +% Output objective function gradient (using continuous adjoint) +GRAD_OBJFUNC_FILENAME= of_grad.dat + +% Output file surface flow coefficient (w/o extension) +%SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow + +% Output file surface adjoint coefficient (w/o extension) +SURFACE_ADJ_FILENAME= surface_adjoint + +VOLUME_OUTPUT= RESIDUAL PRIMITIVE SOURCE SENSITIVITY COEFFICIENT + +% Writing convergence history frequency +SCREEN_WRT_FREQ_INNER = 1 +SCREEN_WRT_FREQ_OUTER = 1 + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, +% FFD_SETTING, FFD_NACELLE +% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, +% HICKS_HENNE, SURFACE_BUMP) + +DV_KIND= FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D + +MESH_FILENAME = mesh_ffd.su2 + +% Mesh output file +MESH_OUT_FILENAME= mesh_ffd_deformed.su2 + +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= (wall_inner_bottom, wall_inner_right, wall_inner_top) + +% Parameters of the shape deformation +DV_PARAM= (MAIN_BOX, 0, 0, 0.0, 1.0); (MAIN_BOX, 1, 0, 0.0, 1.0); (MAIN_BOX, 2, 0, 0.0, 1.0); (MAIN_BOX, 3, 0, 0.0, 1.0); (MAIN_BOX, 4, 0, 0.0, 1.0); (MAIN_BOX, 5, 0, 0.0, 1.0); (MAIN_BOX, 6, 0, 0.0, 1.0); (MAIN_BOX, 7, 0, 0.0, 1.0); (MAIN_BOX, 8, 0, 0.0, 1.0); (MAIN_BOX, 9, 0, 0.0, 1.0); (MAIN_BOX, 10, 0, 0.0, 1.0); (MAIN_BOX, 0, 1, 0.0, 1.0); (MAIN_BOX, 1, 1, 0.0, 1.0); (MAIN_BOX, 2, 1, 0.0, 1.0); (MAIN_BOX, 3, 1, 0.0, 1.0); (MAIN_BOX, 4, 1, 0.0, 1.0); (MAIN_BOX, 5, 1, 0.0, 1.0); (MAIN_BOX, 6, 1, 0.0, 1.0); (MAIN_BOX, 7, 1, 0.0, 1.0); (MAIN_BOX, 8, 1, 0.0, 1.0); (MAIN_BOX, 9, 1, 0.0, 1.0); (MAIN_BOX, 10, 1, 0.0, 1.0) + +% Value of the shape deformation +DV_VALUE = 0, 0.0002, 0.0004, 0.0006, 0.0008, 0.001, 0.0012, 0.0014, 0.0016, 0.0018, 0.002, 0,-0.0002, -0.0004, -0.0006, -0.0008, -0.0010, -0.0012, -0.0014, -0.0016, -0.0018, -0.002 + +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Factor to multiply smallest cell volume for deform tolerance (0.001 default) +% DEFORM_TOL_FACTOR = 1e-10 +DEFORM_LINEAR_SOLVER_ERROR = 1e-5 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% + + +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 + +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 + +% ----- CHECK AND REPAIR MESH INTERSECTION ------------------------- % +% Parameters to check and repair self-intersections within FFD box +% (after deformation) +% +% switch on the intersection prevention +FFD_INTPREV = YES +% number of deformation iterations to make sure that the self-intersection has been resolved +FFD_INTPREV_ITER = 2 +% number of times we half the deformation size within the iteration +FFD_INTPREV_DEPTH= 3 + +% ----- CHECK AND REPAIR NONCONVEX CELLS ------------------------- % +% Parameters to check and repair nonconvex elements in mesh +% (after deformation) +% +% switch on the check for convexity of cells +CONVEXITY_CHECK = YES +% number of iterations +CONVEXITY_CHECK_ITER = 10 +% number of times we half the deformation size within the iteration +CONVEXITY_CHECK_DEPTH = 3 +% -------------------------------------------------------------------------- % + +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (MAIN_BOX, 0.02, 0.005, 0, 0.05, 0.005, 0.0, 0.05, 0.007, 0.0, 0.02, 0.007, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= ( 10, 1, 0) + +% +% Surface continuity at the intersection with the FFD (1ST_DERIVATIVE, 2ND_DERIVATIVE) +FFD_CONTINUITY= USER_INPUT + +% +% Optimization objective function with scaling factor, separated by semicolons. +% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. +% ex= Objective * Scale +%OPT_OBJECTIVE= TOTAL_HEATFLUX * 1e-5 +OPT_OBJECTIVE= DRAG*5.0e-3 + +% +% Optimization constraint functions with pushing factors (affects its value, not the gradient in the python scripts), separated by semicolons +% ex= (Objective = Value ) * Scale, use '>','<','=' +OPT_CONSTRAINT= NONE + +% +% Factor to reduce the norm of the gradient (affects the objective function and gradient in the python scripts) +% In general, a norm of the gradient ~1E-6 is desired. +OPT_GRADIENT_FACTOR= 1.0 +% +% Factor to relax or accelerate the optimizer convergence (affects the line search in SU2_DEF) +% In general, surface deformations of 0.01'' or 0.0001m are desirable +OPT_RELAX_FACTOR= 1.0 +% +% Maximum number of iterations +OPT_ITERATIONS= 20 +% +% Requested accuracy +OPT_ACCURACY= 1E-200 + +% Optimization bound (bounds the line search in SU2_DEF) +OPT_LINE_SEARCH_BOUND= 1E6 +% +% Upper bound for each design variable (bound in the python optimizer) +OPT_BOUND_UPPER = 1e10 +OPT_BOUND_LOWER = -1e10 + +% +% Finite difference step size for python scripts (0.001 default, recommended +% 0.001 x REF_LENGTH) +FIN_DIFF_STEP = 1e-3 +% +DEFINITION_DV= (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 1, 0.0, 1.0) From 3dcea4f0a0073a2cbba040f7740412650e82e4a7 Mon Sep 17 00:00:00 2001 From: bigfootedrockmidget Date: Sun, 10 Jan 2021 11:43:34 +0100 Subject: [PATCH 127/326] add testcase for intersection prevention --- TestCases/deformation/config.cfg | 452 ------------------------------- 1 file changed, 452 deletions(-) delete mode 100644 TestCases/deformation/config.cfg diff --git a/TestCases/deformation/config.cfg b/TestCases/deformation/config.cfg deleted file mode 100644 index e13c859d6454..000000000000 --- a/TestCases/deformation/config.cfg +++ /dev/null @@ -1,452 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% case description: % -% This is a test for the new implementation to prevent % -% self-intersecting meshes % -% after mesh deformation. You can run the test by first running SU2_CFD % -% and then SU2_DEF % -% documentation: Lennaert Tol, Automatic Design Optimization of a Bunsen % -% Burner, MSc. Thesis Technische Universiteit Eindhoven (2020) % -% https://pure.tue.nl/ws/portalfiles/portal/165889356/0894988_Tol.pdf % -% the new keywords are on line 374-396 % -% Author: % -% Lennaert Tol and Nijso Beishuizen % -% Institution: % -% Technische Universiteit Eindhoven % -% Date: 2021.01.08 % -% File Version 7.0.8 "Blackbird" % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) -SOLVER = INC_NAVIER_STOKES - -% Specify turbulent model (NONE, SA, SA_NEG, SST) -KIND_TURB_MODEL= NONE - -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT - -% Restart solution (NO, YES) -RESTART_SOL = NO - -AXISYMMETRIC = NO - -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -% Density model within the incompressible flow solver. -% Options are CONSTANT (default), BOUSSINESQ, or VARIABLE. If VARIABLE, -% an appropriate fluid model must be selected. - -INC_DENSITY_MODEL= CONSTANT - -% Solve the energy equation in the incompressible flow solver -INC_ENERGY_EQUATION = NO - -% Initial density for incompressible flows -% (1.2886 kg/m^3 by default (air), 998.2 Kg/m^3 (water)) -INC_DENSITY_INIT= 1.1728 - -% Initial velocity for incompressible flows (1.0,0,0 m/s by default) -INC_VELOCITY_INIT= (1.0, 0.0, 0.0 ) - -% Initial temperature for incompressible flows that include the -% energy equation (288.15 K by default). Value is ignored if -% INC_ENERGY_EQUATION is false. -INC_TEMPERATURE_INIT= 300.0 - -% List of inlet types for incompressible flows. List length must -% match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. -INC_INLET_TYPE= VELOCITY_INLET -% -% Damping coefficient for iterative updates at pressure inlets. (0.1 by default) -INC_INLET_DAMPING= 0.1 - -% List of outlet types for incompressible flows. List length must -% match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET -INC_OUTLET_TYPE= PRESSURE_OUTLET -% -% Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) -INC_OUTLET_DAMPING= 0.1 - -% Non-dimensionalization scheme for incompressible flows. Options are -% INITIAL_VALUES (default), REFERENCE_VALUES, or DIMENSIONAL. -% INC_*_REF values are ignored unless REFERENCE_VALUES is chosen. -INC_NONDIM= DIMENSIONAL - - -% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% -% -% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, -% CONSTANT_DENSITY, INC_IDEAL_GAS) -FLUID_MODEL= CONSTANT_DENSITY -% -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). -% Incompressible fluids with energy eqn. only (CONSTANT_DENSITY, INC_IDEAL_GAS). -SPECIFIC_HEAT_CP= 1004.703 - -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). -VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) -MU_CONSTANT= 1.83463e-05 - -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -% Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -% -% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) -PRANDTL_LAM= 0.72 -% -% Turbulent Prandtl number (0.9 (air), only for CONSTANT_PRANDTL) -PRANDTL_TURB= 0.90 - -% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% - -% Reference origin for moment computation -REF_ORIGIN_MOMENT_X = 0.00 -REF_ORIGIN_MOMENT_Y = 0.00 -REF_ORIGIN_MOMENT_Z = 0.00 - -% Reference length for pitching, rolling, and yawing non-dimensional moment -REF_LENGTH= 1.0 - -% Reference area for force coefficients (0 implies automatic calculation) -REF_AREA= 0.0 - -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% - -% Navier-Stokes wall boundary marker(s) (NONE = no marker) - -MARKER_PLOTTING = (outlet) -MARKER_ANALYZE = (outlet) - -MARKER_HEATFLUX= (wall_inner_bottom, 0.0, wall_inner_right, 0.0, wall_inner_top, 0.0) - -SPECIFIED_INLET_PROFILE= NO - -INLET_FILENAME = inletVelocity.dat - -INLET_MATCHING_TOLERANCE= 1e-5 - -% Inlet boundary marker(s) -MARKER_INLET = (inlet, 300.0, 1.0, 1.0, 0.0, 0.0) - -% Outler boundary marker (s) -MARKER_OUTLET = (outlet, 0.0) - -% Symmetry boundary marker -MARKER_SYM = (wall_outer) - -% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated -MARKER_MONITORING= (outlet) - -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% - -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) -NUM_METHOD_GRAD= GREEN_GAUSS - -% Courant-Friedrichs-Lewy condition of the finest grid - -CFL_NUMBER=100 - -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO - -% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, -% CFL max value ) -CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) - - -% Runge-Kutta alpha coefficients -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) - -% Number of total iterations -%EXT_ITER = 25 -ITER = 10000 - -% Writing solution file frequency -OUTPUT_WRT_FREQ= 50 - -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% - -% Linear solver for implicit formulations (BCGSTAB, FGMRES) -LINEAR_SOLVER= FGMRES - -% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) -LINEAR_SOLVER_PREC= ILU - -% Minimum error of the linear solver for implicit formulations -LINEAR_SOLVER_ERROR= 1E-10 - -% Max number of iterations of the linear solver for the implicit formulation -LINEAR_SOLVER_ITER= 100 - -% -------------------------- MULTIGRID PARAMETERS -----------------------------% - -% Multi-Grid Levels (0 = no multi-grid) -MGLEVEL= 0 - -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= V_CYCLE - -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) - -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) - -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) - -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.8 - -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.8 - -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% - -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) -CONV_NUM_METHOD_FLOW= FDS - -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_FLOW= NO - -% Slope limiter (VENKATAKRISHNAN, MINMOD) -SLOPE_LIMITER_FLOW= NONE - -% Coefficient for the limiter (smooth regions) -VENKAT_LIMITER_COEFF= 10.0 - -% 2nd and 4th order artificial dissipation coefficients -JST_SENSOR_COEFF= ( 0.05, 0.02 ) - -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) -TIME_DISCRE_FLOW= EULER_IMPLICIT - -CONV_NUM_METHOD_ADJFLOW= FDS -ADJ_JST_SENSOR_COEFF= ( 0.05, 0.02 ) -CFL_REDUCTION_ADJFLOW= 0.5 -TIME_DISCRE_ADJFLOW= EULER_IMPLICIT - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% - -% Convergence criteria (CAUCHY, RESIDUAL) -CONV_CRITERIA= RESIDUAL - -% Min value of the residual (log10 of the residual) -%RESIDUAL_MINVAL= -13 -CONV_RESIDUAL_MINVAL= -10 - -% Start convergence criteria at iteration number -CONV_STARTITER= 100 - -% Number of elements to apply the criteria -CONV_CAUCHY_ELEMS= 20 - -% Epsilon to control the series convergence -CONV_CAUCHY_EPS= 1E-6 - -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) - -SCREEN_OUTPUT = INNER_ITER WALL_TIME RMS_PRESSURE RMS_VELOCITY-X RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X U -CONV_FIELD = (RMS_PRESSURE, RMS_ADJ_PRESSURE) - -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% - - - -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= SU2 - -% Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FILENAME= solution_flow.dat - -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj.dat - -% Output file format (PARAVIEW, PARAVIEW_BINARY, TECPLOT, STL) -OUTPUT_FILES = (RESTART, PARAVIEW_ASCII, SURFACE_CSV) -TABULAR_FORMAT = CSV - -% Output file convergence history (w/o extension) -CONV_FILENAME= history - -% Output file restart flow -%RESTART_FLOW_FILENAME= restart_flow.dat -RESTART_FILENAME= restart_flow.dat - -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat - -% Output file flow (w/o extension) variables -%VOLUME_FLOW_FILENAME= flow -VOLUME_FILENAME= flow - -% Output file adjoint (w/o extension) variables -VOLUME_ADJ_FILENAME= adjoint - -% Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad.dat - -% Output file surface flow coefficient (w/o extension) -%SURFACE_FLOW_FILENAME= surface_flow -SURFACE_FILENAME= surface_flow - -% Output file surface adjoint coefficient (w/o extension) -SURFACE_ADJ_FILENAME= surface_adjoint - -VOLUME_OUTPUT= RESIDUAL PRIMITIVE SOURCE SENSITIVITY COEFFICIENT - -% Writing convergence history frequency -SCREEN_WRT_FREQ_INNER = 1 -SCREEN_WRT_FREQ_OUTER = 1 - -% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% -% -% Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, -% FFD_SETTING, FFD_NACELLE -% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, -% HICKS_HENNE, SURFACE_BUMP) - -DV_KIND= FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D, FFD_CONTROL_POINT_2D - -MESH_FILENAME = mesh_ffd.su2 - -% Mesh output file -MESH_OUT_FILENAME= mesh_ffd_deformed.su2 - -% Marker of the surface in which we are going apply the shape deformation -DV_MARKER= (wall_inner_bottom, wall_inner_right, wall_inner_top) - -% Parameters of the shape deformation -DV_PARAM= (MAIN_BOX, 0, 0, 0.0, 1.0); (MAIN_BOX, 1, 0, 0.0, 1.0); (MAIN_BOX, 2, 0, 0.0, 1.0); (MAIN_BOX, 3, 0, 0.0, 1.0); (MAIN_BOX, 4, 0, 0.0, 1.0); (MAIN_BOX, 5, 0, 0.0, 1.0); (MAIN_BOX, 6, 0, 0.0, 1.0); (MAIN_BOX, 7, 0, 0.0, 1.0); (MAIN_BOX, 8, 0, 0.0, 1.0); (MAIN_BOX, 9, 0, 0.0, 1.0); (MAIN_BOX, 10, 0, 0.0, 1.0); (MAIN_BOX, 0, 1, 0.0, 1.0); (MAIN_BOX, 1, 1, 0.0, 1.0); (MAIN_BOX, 2, 1, 0.0, 1.0); (MAIN_BOX, 3, 1, 0.0, 1.0); (MAIN_BOX, 4, 1, 0.0, 1.0); (MAIN_BOX, 5, 1, 0.0, 1.0); (MAIN_BOX, 6, 1, 0.0, 1.0); (MAIN_BOX, 7, 1, 0.0, 1.0); (MAIN_BOX, 8, 1, 0.0, 1.0); (MAIN_BOX, 9, 1, 0.0, 1.0); (MAIN_BOX, 10, 1, 0.0, 1.0) - -% Value of the shape deformation -DV_VALUE = 0, 0.0002, 0.0004, 0.0006, 0.0008, 0.001, 0.0012, 0.0014, 0.0016, 0.0018, 0.002, 0,-0.0002, -0.0004, -0.0006, -0.0008, -0.0010, -0.0012, -0.0014, -0.0016, -0.0018, -0.002 - -% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% -% -% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) -DEFORM_LINEAR_SOLVER= FGMRES -% -% Number of smoothing iterations for mesh deformation -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -% Number of nonlinear deformation iterations (surface deformation increments) -DEFORM_NONLINEAR_ITER= 1 -% -% Print the residuals during mesh deformation to the console (YES, NO) -DEFORM_CONSOLE_OUTPUT= YES -% -% Factor to multiply smallest cell volume for deform tolerance (0.001 default) -% DEFORM_TOL_FACTOR = 1e-10 -DEFORM_LINEAR_SOLVER_ERROR = 1e-5 -% -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, -% WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% - - -% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% -% -% Tolerance of the Free-Form Deformation point inversion -FFD_TOLERANCE= 1E-10 - -% Maximum number of iterations in the Free-Form Deformation point inversion -FFD_ITERATIONS= 500 - -% -------------------------------------------------------------------------- % -% ----- NEW: intersection prevention --------------------------------------- % -% -------------------------------------------------------------------------- % -% Parameters for prevention of self-intersections within FFD box -% (after mesh deformation) -% switch on the check and repair for mesh intersection -FFD_INTPREV = YES -% -% number of iterations to make sure that the self-intersection has been resolved -FFD_INTPREV_ITER = 2 -% -% number of times we half the deformation within an iteration -FFD_INTPREV_DEPTH= 3 - -% Parameters for prevention of nonconvex elements in mesh after deformation -% switch on the check and repait for convexity of cells -CONVEXITY_CHECK = YES -% number of iterations -CONVEXITY_CHECK_ITER = 10 -% depth per iteration (number of times we half the deformation within an iteration) -CONVEXITY_CHECK_DEPTH = 3 -% -------------------------------------------------------------------------- % - -% -% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, -% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) -% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, -% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) -FFD_DEFINITION= (MAIN_BOX, 0.02, 0.005, 0, 0.05, 0.005, 0.0, 0.05, 0.007, 0.0, 0.02, 0.007, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) - -% -% FFD box degree: 3D case (x_degree, y_degree, z_degree) -% 2D case (x_degree, y_degree, 0) -FFD_DEGREE= ( 10, 1, 0) - -% -% Surface continuity at the intersection with the FFD (1ST_DERIVATIVE, 2ND_DERIVATIVE) -FFD_CONTINUITY= USER_INPUT - -% -% Optimization objective function with scaling factor, separated by semicolons. -% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list. -% ex= Objective * Scale -%OPT_OBJECTIVE= TOTAL_HEATFLUX * 1e-5 -OPT_OBJECTIVE= DRAG*5.0e-3 - -% -% Optimization constraint functions with pushing factors (affects its value, not the gradient in the python scripts), separated by semicolons -% ex= (Objective = Value ) * Scale, use '>','<','=' -OPT_CONSTRAINT= NONE - -% -% Factor to reduce the norm of the gradient (affects the objective function and gradient in the python scripts) -% In general, a norm of the gradient ~1E-6 is desired. -OPT_GRADIENT_FACTOR= 1.0 -% -% Factor to relax or accelerate the optimizer convergence (affects the line search in SU2_DEF) -% In general, surface deformations of 0.01'' or 0.0001m are desirable -OPT_RELAX_FACTOR= 1.0 -% -% Maximum number of iterations -OPT_ITERATIONS= 20 -% -% Requested accuracy -OPT_ACCURACY= 1E-200 - -% Optimization bound (bounds the line search in SU2_DEF) -OPT_LINE_SEARCH_BOUND= 1E6 -% -% Upper bound for each design variable (bound in the python optimizer) -OPT_BOUND_UPPER = 1e10 -OPT_BOUND_LOWER = -1e10 - -% -% Finite difference step size for python scripts (0.001 default, recommended -% 0.001 x REF_LENGTH) -FIN_DIFF_STEP = 1e-3 -% -DEFINITION_DV= (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 0, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 0, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 1, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 2, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 3, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 4, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 5, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 6, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 7, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 8, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 9, 1, 0.0, 1.0); (19, 1.0 | wall_inner_bottom, wall_inner_right, wall_inner_top | MAIN_BOX, 10, 1, 0.0, 1.0) From da3ea47735dd3f834c18a4ee10e119d8501be8b4 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 11 Jan 2021 17:43:07 +0100 Subject: [PATCH 128/326] Consolidate GetStreamwisePeriodic_Properties function --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 8 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 157 +++++--------------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- 4 files changed, 46 insertions(+), 123 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index c73785fa05c8..a7758912a703 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7695,7 +7695,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, - Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); + Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index e80fbfc1f04a..e45a0003477e 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -52,12 +52,10 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetKind_Streamwise_Periodic()) GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); + if (config->GetKind_Streamwise_Periodic()) GetStreamwise_Periodic_Properties(geometry, config, iMesh); /*--- Initialize the Jacobian matrices ---*/ @@ -3594,28 +3595,14 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, CConfig *config, - unsigned short iMesh, - bool Output) { + unsigned short iMesh) { - //if (rank == MASTER_NODE) { cout << "------------------------------- New Routine Start --------------------------" << endl; } /*---------------------------------------------------------------------------------------------*/ // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results // 2. Update delta_p is target massflow is chosen. // 3. Loop Heatflux (or all for real heatflux) markers. compute heatflux in domain via config or real heatflux, communicate and set results. only if energy equation is on. /*---------------------------------------------------------------------------------------------*/ - /*--- Initialization and allocation done here. ---*/ - unsigned short iDim, iMarker; - unsigned long iVertex, iPoint; - unsigned long InnerIter = config->GetInnerIter(); - unsigned long OuterIter = config->GetOuterIter(); - unsigned short nZone = geometry->GetnZone(); - - bool axisymmetric = config->GetAxisymmetric(); - //bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*1)) == 0) // TK output at every iteration - // && (config->GetInnerIter()!= 0)) - // || (config->GetInnerIter() == 1)); - /*-------------------------------------------------------------------------------------------------*/ /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ /*--- (there can be only one) streamwise periodic outlet/donor marker. Massflow is obviously ---*/ @@ -3624,60 +3611,60 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ /*-------------------------------------------------------------------------------------------------*/ - su2double Area_Local = 0.0, Area_Global = 0.0, - MassFlow_Local = 0.0, MassFlow_Global = 0.0, - Average_Density_Local = 0.0, Average_Density_Global = 0.0, - FaceArea, AxiFactor; - - vector AreaNormal(nDim); - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + su2double Area_Local = 0.0, + MassFlow_Local = 0.0, + Average_Density_Local = 0.0, + Temperature_Local = 0.0; + + for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { /*--- Only "outlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 2) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { - - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - /*--- m_dot = dot_prod(n*v) * A * rho * Axifactor, with n beeing unit normal. ---*/ - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); - MassFlow_Local += AreaNormal[iDim] * nodes->GetVelocity(iPoint, iDim) * nodes->GetDensity(iPoint) * AxiFactor; - } - FaceArea = sqrt(FaceArea); + + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + + // Is there a way to get a pointer on just the velocity to put in the Dotproduct directly? + su2double Velocity[MAXNDIM] = {0.0}; + for (auto iDim = 0; iDim < nDim; iDim++) { Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); } + /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ + MassFlow_Local += GeometryToolbox::DotProduct(nDim, AreaNormal, Velocity) * nodes->GetDensity(iPoint); + Area_Local += FaceArea; Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); + /*--- Only "inlet"/master (1 ,now 2 for testpurpose) periodic marker, as I want to meet the specified inlet temperature ---*/ + Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); + } // if domain } // loop vertices } // loop periodic boundaries } // loop MarkerAll - // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflwo + // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow + su2double Area_Global(0), Average_Density_Global(0), MassFlow_Global(0), Temperature_Global(0); SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + // Set quantity by stringtag Average_Density_Global /= Area_Global; + Temperature_Global /= Area_Global; + // What do I do with the temperature now from here on? The only way really is to pipe it through the config... + config->SetStreamwise_Periodic_InletTemperature(Temperature_Global); config->SetStreamwise_Periodic_MassFlow(MassFlow_Global); if (rank == MASTER_NODE && false) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } @@ -3709,6 +3696,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry iteration does not get a pressure-update but the continuing simulation would have an update here. This can be fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at best ---*/ + auto nZone = geometry->GetnZone(); + auto InnerIter = config->GetInnerIter(); + auto OuterIter = config->GetOuterIter(); if((nZone==1 && InnerIter > 0) || (nZone>1 && OuterIter > 0)) config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); @@ -3737,37 +3727,24 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry su2double HeatFlux, HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; - string Marker_StringTag; /*--- Loop over all Marker ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { // Loop over all Heatflux marker if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { // Add up Heatflux /*--- Identify the boundary by string name ---*/ - Marker_StringTag = config->GetMarker_All_TagBound(iMarker); + auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); - FaceArea = sqrt(FaceArea); + auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); /*--- OPTION 1 for Heatflux calculation from config file ---*/ HeatFlux = -config->GetWall_HeatFlux(Marker_StringTag)/config->GetHeat_Flux_Ref(); @@ -3785,58 +3762,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry /*--- Set the Integrated Heatflux ---*/ if (iMesh == MESH_0) config->SetStreamwise_Periodic_IntegratedHeatFlow(HeatFlow_Global); - - // Compute area avg Temp of the inlet - su2double Area_Local = 0.0, - Area_Global = 0.0, - MassFlow_Local, - Temperature_Local = 0.0, - Temperature_Global = 0.0, - FaceArea, - AxiFactor; - - vector AreaNormal(nDim); - - //loop markers and find the "outlet marker" - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - /*--- Only "inlet"/master periodic marker, as I want to meet the specified inlet temperature ---*/ - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 1) { - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - geometry->vertex[iMarker][iVertex]->GetNormal(AreaNormal.data()); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint,1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint,1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } - - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(AreaNormal[iDim] * AxiFactor, 2); } - Area_Local += sqrt(FaceArea); - FaceArea = sqrt(FaceArea); - Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); - - } // if domain - } // loop vertices - } // loop periodic boundaries - } // loop MarkerAll - - // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow - SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - Temperature_Global /= Area_Global; - // What do I do with the temperature now from here on? The only way really is to pipe it through the config... - config->SetStreamwise_Periodic_InletTemperature(Temperature_Global); } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index cf5fb82a29ff..8eb2b423cd05 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -160,7 +160,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - GetStreamwise_Periodic_Properties(geometry, config, iMesh, Output); + GetStreamwise_Periodic_Properties(geometry, config, iMesh); } // if streamwise periodic /*--- Evaluate the vorticity and strain rate magnitude ---*/ From c608706016c10c2d8997eec5c5e3be963ce5b616 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 12 Jan 2021 15:56:58 +0100 Subject: [PATCH 129/326] change auxvargrad contribution in energy equation (correctness to be confirmed) --- SU2_CFD/src/numerics/flow/flow_sources.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index b3a48b19b2ce..e2b4e7fc24e1 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -149,14 +149,14 @@ void CSourceAxisymmetric_Flow::ResidualDiffusion(){ residual[0] -= 0.0; residual[1] -= Volume*(yinv*total_viscosity_i*(PrimVar_Grad_i[1][1]+PrimVar_Grad_i[2][0]) - -TWO3*AuxVar_Grad_i[0][0]); + -TWO3*AuxVar_Grad_i[0][0]); residual[2] -= Volume*(yinv*total_viscosity_i*2*(PrimVar_Grad_i[2][1]-v*yinv) - -TWO3*AuxVar_Grad_i[0][1]); + -TWO3*AuxVar_Grad_i[0][1]); residual[3] -= Volume*(yinv*(total_viscosity_i*(u*(PrimVar_Grad_i[2][0]+PrimVar_Grad_i[1][1]) - +v*TWO3*(2*PrimVar_Grad_i[1][1]-PrimVar_Grad_i[1][0] - -v*yinv+U_i[0]*turb_ke_i)) - -total_conductivity_i*PrimVar_Grad_i[0][1]) - -TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][1])); + +v*TWO3*(2*PrimVar_Grad_i[1][1]-PrimVar_Grad_i[1][0] + -v*yinv+U_i[0]*turb_ke_i)) + -total_conductivity_i*PrimVar_Grad_i[0][1]) + -TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][0])); } From 35cec330e50ac9a6f994c6b78d31913e7844b180 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 12 Jan 2021 18:45:33 +0100 Subject: [PATCH 130/326] Debug ParMETIS --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 6f2e5526c08a..643531b8f289 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8284,7 +8284,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Calling ParMETIS ---*/ if (rank == MASTER_NODE) cout << "Calling ParMETIS..."; - auto err = ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), vwgt.data(), + auto err = ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), nullptr, nullptr, &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), &ubvec, options, &edgecut, part.data(), &comm); if (err != METIS_OK) SU2_MPI::Error("Partitioning failed.", CURRENT_FUNCTION); From 80f2188f6ecadb613a4942dfdf9f9935e19019be Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 12 Jan 2021 18:46:54 +0100 Subject: [PATCH 131/326] Debug ParMETIS 2 --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 643531b8f289..9b8cd6243eaa 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8243,7 +8243,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Some recommended defaults for the various ParMETIS options. ---*/ - idx_t wgtflag = 2; + idx_t wgtflag = 0; idx_t numflag = 0; idx_t ncon = 1; real_t ubvec = 1.0 + config->GetParMETIS_Tolerance(); From ab406ac945a3c1d35484c529d6a2663f0671dc8f Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 12 Jan 2021 19:01:30 +0100 Subject: [PATCH 132/326] Removed Debug --- Common/src/geometry/CPhysicalGeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 9b8cd6243eaa..6f2e5526c08a 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8243,7 +8243,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Some recommended defaults for the various ParMETIS options. ---*/ - idx_t wgtflag = 0; + idx_t wgtflag = 2; idx_t numflag = 0; idx_t ncon = 1; real_t ubvec = 1.0 + config->GetParMETIS_Tolerance(); @@ -8284,7 +8284,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Calling ParMETIS ---*/ if (rank == MASTER_NODE) cout << "Calling ParMETIS..."; - auto err = ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), nullptr, + auto err = ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), vwgt.data(), nullptr, &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), &ubvec, options, &edgecut, part.data(), &comm); if (err != METIS_OK) SU2_MPI::Error("Partitioning failed.", CURRENT_FUNCTION); From ec4eb9fc013d0c0422b70603719c31d34c3c3c9e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 19 Jan 2021 15:47:02 +0000 Subject: [PATCH 133/326] initial implementation, not working with AD --- Common/include/CConfig.hpp | 8 +- Common/include/geometry/elements/CElement.hpp | 7 ++ Common/include/option_structure.hpp | 4 +- Common/src/CConfig.cpp | 7 +- SU2_CFD/include/solvers/CFEASolver.hpp | 11 +- SU2_CFD/include/solvers/CSolver.hpp | 10 +- .../numerics/elasticity/CFEAElasticity.cpp | 9 ++ .../elasticity/CFEALinearElasticity.cpp | 14 ++- .../elasticity/CFEANonlinearElasticity.cpp | 19 ++- SU2_CFD/src/output/CElasticityOutput.cpp | 3 + SU2_CFD/src/solvers/CFEASolver.cpp | 112 +++++++++++------- 11 files changed, 146 insertions(+), 58 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 9682fd95ad3e..d840895410c5 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -990,7 +990,8 @@ class CConfig { bool FEAAdvancedMode; /*!< \brief Determine if advanced features are used from the element-based FEA analysis (experimental). */ su2double RefGeom_Penalty, /*!< \brief Penalty weight value for the reference geometry objective function. */ RefNode_Penalty, /*!< \brief Penalty weight value for the reference node objective function. */ - DV_Penalty; /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */ + DV_Penalty, /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */ + AllowedVMStress; /*!< \brief Maximum stress for the stress penalty objective function. */ unsigned long Nonphys_Points, /*!< \brief Current number of non-physical points in the solution. */ Nonphys_Reconstr; /*!< \brief Current number of non-physical reconstructions for 2nd-order upwinding. */ su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */ @@ -8532,6 +8533,11 @@ class CConfig { */ su2double GetTotalDV_Penalty(void) const { return DV_Penalty; } + /*! + * \brief Get the maximum allowed VM stress for the stress penalty objective function. + */ + su2double GetAllowedVMStress(void) const { return AllowedVMStress; } + /*! * \brief Get whether a predictor is used for FSI applications. * \return Bool: determines if predictor is used or not diff --git a/Common/include/geometry/elements/CElement.hpp b/Common/include/geometry/elements/CElement.hpp index 8e86e8ece7c8..543023fbae98 100644 --- a/Common/include/geometry/elements/CElement.hpp +++ b/Common/include/geometry/elements/CElement.hpp @@ -470,6 +470,13 @@ class CElement { AD::SetPreaccOut(Mab.data(), nNodes*nNodes); } + /*! + * \brief Register the dead load as a pre-accumulation output. + */ + inline void SetPreaccOut_FDL_a(void) { + AD::SetPreaccOut(FDL_a.data(), nNodes*nDim); + } + }; /*! diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index c69c5f5d44ca..e39eba865c34 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1524,7 +1524,8 @@ enum ENUM_OBJECTIVE { REFERENCE_NODE = 61, /*!< \brief Objective function defined as the difference of a particular node respect to a reference position. */ VOLUME_FRACTION = 62, /*!< \brief Volume average physical density, for material-based topology optimization applications. */ TOPOL_DISCRETENESS = 63, /*!< \brief Measure of the discreteness of the current topology. */ - TOPOL_COMPLIANCE = 64 /*!< \brief Measure of the discreteness of the current topology. */ + TOPOL_COMPLIANCE = 64, /*!< \brief Measure of the discreteness of the current topology. */ + STRESS_PENALTY = 65, /*!< \brief Penalty function of VM stresses above a maximum value. */ }; static const MapType Objective_Map = { MakePair("DRAG", DRAG_COEFFICIENT) @@ -1575,6 +1576,7 @@ static const MapType Objective_Map = { MakePair("VOLUME_FRACTION", VOLUME_FRACTION) MakePair("TOPOL_DISCRETENESS", TOPOL_DISCRETENESS) MakePair("TOPOL_COMPLIANCE", TOPOL_COMPLIANCE) + MakePair("STRESS_PENALTY", STRESS_PENALTY) }; /*! diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index dc370d2e843d..5364c48430f2 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2289,11 +2289,14 @@ void CConfig::SetConfig_Options() { /*!\brief REFERENCE_NODE\n DESCRIPTION: Reference node for the structure (optimization applications) */ addUnsignedLongOption("REFERENCE_NODE", refNodeID, 0); - /* DESCRIPTION: Modulus of the electric fields */ + /*!\brief REFERENCE_NODE_DISPLACEMENT\n DESCRIPTION: Target displacement of the reference node \ingroup Config*/ addDoubleListOption("REFERENCE_NODE_DISPLACEMENT", nDim_RefNode, RefNode_Displacement); /*!\brief REFERENCE_NODE_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_NODE_PENALTY", RefNode_Penalty, 1E3); + /*!\brief ALLOWED_VONMISSES_STRESS\n DESCRIPTION: Maximum allowed stress for structural optimization \ingroup Config*/ + addDoubleOption("ALLOWED_VONMISSES_STRESS", AllowedVMStress, 1.0); + /*!\brief REGIME_TYPE \n DESCRIPTION: Geometric condition \n OPTIONS: see \link Struct_Map \endlink \ingroup Config*/ addEnumOption("GEOMETRIC_CONDITIONS", Kind_Struct_Solver, Struct_Map, SMALL_DEFORMATIONS); /*!\brief REGIME_TYPE \n DESCRIPTION: Material model \n OPTIONS: see \link Material_Map \endlink \ingroup Config*/ @@ -6051,6 +6054,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { case VOLUME_FRACTION: cout << "Volume fraction objective function." << endl; break; case TOPOL_DISCRETENESS: cout << "Topology discreteness objective function." << endl; break; case TOPOL_COMPLIANCE: cout << "Topology compliance objective function." << endl; break; + case STRESS_PENALTY: cout << "Stress penalty objective function." << endl; break; } } else { @@ -8018,6 +8022,7 @@ string CConfig::GetObjFunc_Extension(string val_filename) const { case VOLUME_FRACTION: AdjExt = "_volfrac"; break; case TOPOL_DISCRETENESS: AdjExt = "_topdisc"; break; case TOPOL_COMPLIANCE: AdjExt = "_topcomp"; break; + case STRESS_PENALTY: AdjExt = "_stress"; break; } } else{ diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index 31ec0790bad5..757eafae6798 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -69,6 +69,7 @@ class CFEASolver : public CSolver { su2double Total_OFVolFrac; /*!< \brief Total Objective Function: Volume fraction (topology optimization). */ su2double Total_OFDiscreteness; /*!< \brief Total Objective Function: Discreteness (topology optimization). */ su2double Total_OFCompliance; /*!< \brief Total Objective Function: Compliance (topology optimization). */ + su2double Total_OFStressPenalty; /*!< \brief Total Objective Function: Stress penalty. */ su2double ObjFunc; su2double Global_OFRefGeom; /*!< \brief Global Objective Function (added over time steps): Reference Geometry. */ @@ -546,7 +547,6 @@ class CFEASolver : public CSolver { /*! * \brief Provide the maximum Von Mises Stress for structural analysis. - * \return Value of the maximum Von Mises Stress. */ inline su2double GetTotal_CFEA(void) const final { return Total_CFEA; } @@ -572,10 +572,14 @@ class CFEASolver : public CSolver { /*! * \brief Retrieve the value of the structural compliance objective function - * \return Value of the objective function. */ inline su2double GetTotal_OFCompliance(void) const final { return Total_OFCompliance; } + /*! + * \brief Retrieve the value of the stress penalty objective function + */ + inline su2double GetTotal_OFStressPenalty(void) const final { return Total_OFStressPenalty; } + /*! * \brief Compute the objective function. * \param[in] config - Definition of the problem. @@ -598,6 +602,9 @@ class CFEASolver : public CSolver { case TOPOL_DISCRETENESS: ObjFunc = GetTotal_OFDiscreteness(); break; + case STRESS_PENALTY: + ObjFunc = GetTotal_OFStressPenalty(); + break; } } diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 2390a546ebfb..a48f946819f5 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -2465,16 +2465,22 @@ class CSolver { inline virtual su2double GetTotal_OFVolFrac() const { return 0; } /*! - * \brief Retrieve the value of the discreteness objective function + * \brief Retrieve the value of the discreteness objective function. */ inline virtual su2double GetTotal_OFDiscreteness() const { return 0; } /*! * \brief A virtual member. - * \return Value of the objective function for the structural compliance. + * \return Value of the compliance objective function. */ inline virtual su2double GetTotal_OFCompliance() const { return 0; } + /*! + * \brief A virtual member. + * \return Value of the stress penalty objective function. + */ + inline virtual su2double GetTotal_OFStressPenalty() const { return 0; } + /*! * \brief A virtual member. * \return Bool that defines whether the solution has an element-based file or not diff --git a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp index 737ea55bbdc1..31c5394577da 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp @@ -243,6 +243,11 @@ void CFEAElasticity::Compute_Dead_Load(CElement *element, const CConfig *config) SetElement_Properties(element, config); /*-----------------------------------------------------------*/ + /*--- Register pre-accumulation inputs, density and reference coords. ---*/ + AD::StartPreacc(); + AD::SetPreaccIn(Rho_s_DL); + element->SetPreaccIn_Coords(false); + unsigned short iGauss, nGauss; unsigned short iNode, iDim, nNode; @@ -286,6 +291,10 @@ void CFEAElasticity::Compute_Dead_Load(CElement *element, const CConfig *config) } + /*--- Register the dead load as preaccumulation output. ---*/ + element->SetPreaccOut_FDL_a(); + AD::EndPreacc(); + } diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index 44da9a63da88..1f0e6201186e 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -56,8 +56,6 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf AD::StartPreacc(); AD::SetPreaccIn(E); AD::SetPreaccIn(Nu); - AD::SetPreaccIn(Rho_s); - AD::SetPreaccIn(Rho_s_DL); element->SetPreaccIn_Coords(); /*--- Recompute Lame parameters as they depend on the material properties ---*/ Compute_Lame_Parameters(); @@ -247,6 +245,18 @@ void CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const /*--- Set element properties and recompute the constitutive matrix, this is needed for multiple material cases and for correct differentiation ---*/ SetElement_Properties(element, config); + + /*--- Register pre-accumulation inputs ---*/ + /*--- WARNING: Outputs must be registered outside of this method, this allows more + * flexibility in selecting what is captured by AD, capturing the entire stress + * tensor would use more memory than that used by the stress residuals. ---*/ + AD::StartPreacc(); + AD::SetPreaccIn(E); + AD::SetPreaccIn(Nu); + element->SetPreaccIn_Coords(); + /*--- Recompute Lame parameters as they depend on the material properties ---*/ + Compute_Lame_Parameters(); + Compute_Constitutive_Matrix(element, config); /*--- Initialize auxiliary matrices ---*/ diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index 135030eacb8c..a02a85294e02 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -240,8 +240,6 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC AD::StartPreacc(); AD::SetPreaccIn(E); AD::SetPreaccIn(Nu); - AD::SetPreaccIn(Rho_s); - AD::SetPreaccIn(Rho_s_DL); if (maxwell_stress) { AD::SetPreaccIn(EFieldMod_Ref); AD::SetPreaccIn(ke_DE); @@ -483,8 +481,6 @@ void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const AD::StartPreacc(); AD::SetPreaccIn(E); AD::SetPreaccIn(Nu); - AD::SetPreaccIn(Rho_s); - AD::SetPreaccIn(Rho_s_DL); if (maxwell_stress) { AD::SetPreaccIn(EFieldMod_Ref); AD::SetPreaccIn(ke_DE); @@ -756,6 +752,21 @@ void CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *element, co if (maxwell_stress) SetElectric_Properties(element, config); /*-----------------------------------------------------------*/ + /*--- Register pre-accumulation inputs ---*/ + /*--- WARNING: Outputs must be registered outside of this method, this allows more + * flexibility in selecting what is captured by AD, capturing the entire stress + * tensor would use more memory than that used by the stress residuals. ---*/ + AD::StartPreacc(); + AD::SetPreaccIn(E); + AD::SetPreaccIn(Nu); + if (maxwell_stress) { + AD::SetPreaccIn(EFieldMod_Ref); + AD::SetPreaccIn(ke_DE); + } + element->SetPreaccIn_Coords(); + /*--- Recompute Lame parameters as they depend on the material properties ---*/ + Compute_Lame_Parameters(); + su2double Weight, Jac_x; element->ClearStress(); diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp index 0f7408b01166..da1460df2b1c 100644 --- a/SU2_CFD/src/output/CElasticityOutput.cpp +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -136,6 +136,7 @@ void CElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("REFERENCE_NODE", fea_solver->GetTotal_OFRefNode()); SetHistoryOutputValue("TOPOL_COMPLIANCE", fea_solver->GetTotal_OFCompliance()); + SetHistoryOutputValue("STRESS_PENALTY", fea_solver->GetTotal_OFStressPenalty()); if (config->GetRefGeom()) { SetHistoryOutputValue("REFERENCE_GEOMETRY", fea_solver->GetTotal_OFRefGeom()); } @@ -171,6 +172,7 @@ void CElasticityOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("REFERENCE_NODE", "RefNode", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); AddHistoryOutput("TOPOL_COMPLIANCE", "TopComp", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("STRESS_PENALTY", "StressPen", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); if (config->GetRefGeom()) { AddHistoryOutput("REFERENCE_GEOMETRY", "RefGeom", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); } @@ -178,6 +180,7 @@ void CElasticityOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("VOLUME_FRACTION", "VolFrac", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); AddHistoryOutput("TOPOL_DISCRETENESS", "TopDisc", ScreenOutputFormat::SCIENTIFIC, "STRUCT_COEFF", "", HistoryFieldType::COEFFICIENT); } + } void CElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index f9afa46d1651..8e84ceebe29a 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -1321,24 +1321,51 @@ void CFEASolver::Compute_NodalStressRes(CGeometry *geometry, CNumerics **numeric } -void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +namespace { +template +su2double vonMissesStress(unsigned short nDim, const T& stress) { + if (nDim == 2) { + su2double Sxx = stress[0], Syy = stress[1], Sxy = stress[2]; - /*--- Never record this method as atm it is not differentiable. ---*/ - const bool wasActive = AD::BeginPassive(); + su2double S1, S2; S1 = S2 = (Sxx+Syy)/2; + su2double tauMax = sqrt(pow((Sxx-Syy)/2, 2) + pow(Sxy,2)); + S1 += tauMax; + S2 -= tauMax; + + return sqrt(S1*S1+S2*S2-2*S1*S2); + } + else { + su2double Sxx = stress[0], Syy = stress[1], Szz = stress[3]; + su2double Sxy = stress[2], Sxz = stress[4], Syz = stress[5]; + + return sqrt(0.5*(pow(Sxx - Syy, 2) + + pow(Syy - Szz, 2) + + pow(Szz - Sxx, 2) + + 6.0*(Sxy*Sxy+Sxz*Sxz+Syz*Syz))); + } +} +} + +void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool prestretch_fem = config->GetPrestretch(); const bool topology_mode = config->GetTopology_Optimization(); - const su2double simp_exponent = config->GetSIMP_Exponent(); + const auto simp_exponent = config->GetSIMP_Exponent(); const unsigned short nStress = (nDim == 2) ? 3 : 6; + const auto stressScale = 1.0 / config->GetAllowedVMStress(); + su2double StressPenalty = 0.0; su2double MaxVonMises_Stress = 0.0; /*--- Start OpenMP parallel region. ---*/ SU2_OMP_PARALLEL { + /*--- Some parts are not recorded, atm only StressPenalty is differentiated to save memory. ---*/ + bool wasActive = AD::BeginPassive(); + /*--- Clear reactions. ---*/ LinSysReact.SetValZero(); @@ -1349,9 +1376,12 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, nodes->SetStress_FEM(iPoint,iStress, 0.0); } } + AD::EndPassive(wasActive); for(auto color : ElemColoring) { + su2double stressPen = 0.0; + /*--- Chunk size is at least OMP_MIN_SIZE and a multiple of the color group size. ---*/ SU2_OMP_FOR_DYN(nextMultiple(OMP_MIN_SIZE, color.groupSize)) for(auto k = 0ul; k < color.size; ++k) { @@ -1379,7 +1409,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, for (iDim = 0; iDim < nDim; iDim++) { /*--- Compute current coordinate. ---*/ - su2double val_Coord = Get_ValCoord(geometry, indexNode[iNode], iDim); + su2double val_Coord = geometry->nodes->GetCoord(indexNode[iNode],iDim); su2double val_Sol = nodes->GetSolution(indexNode[iNode],iDim) + val_Coord; /*--- If pre-stretched the reference coordinate is stored in the nodes. ---*/ @@ -1406,6 +1436,12 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, numerics[NUM_TERM]->Compute_Averaged_NodalStress(element, config); + /*--- Average the stresses for the element to compute the stress penalty, + * this is the way to make the AD of that function more economical. ---*/ + su2double avgStressElem[6] = {0.0}; + AD::SetPreaccIn(simp_penalty); + const su2double el_weight = simp_penalty / nNodes; + for (iNode = 0; iNode < nNodes; iNode++) { auto iPoint = indexNode[iNode]; @@ -1417,18 +1453,30 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, LinSysReact(iPoint,iVar) += simp_penalty*Ta[iVar]; /*--- Divide the nodal stress by the number of elements that will contribute to this point. ---*/ - su2double weight = simp_penalty / geometry->nodes->GetnElem(iPoint); + su2double pt_weight = simp_penalty / geometry->nodes->GetnElem(iPoint); - for (iStress = 0; iStress < nStress; iStress++) - nodes->AddStress_FEM(iPoint,iStress, weight*element->Get_NodalStress(iNode,iStress)); + for (iStress = 0; iStress < nStress; iStress++) { + auto sigma = element->Get_NodalStress(iNode,iStress); + nodes->AddStress_FEM(iPoint,iStress, pt_weight*sigma); + avgStressElem[iStress] += el_weight*sigma; + } if (LockStrategy) omp_unset_lock(&UpdateLocks[iPoint]); } + su2double elPenalty = pow(max(0.0, vonMissesStress(nDim,avgStressElem)*stressScale - 1.0), 2); + AD::SetPreaccOut(elPenalty); + AD::EndPreacc(); // started above in Compute_Averaged_NodalStress + + stressPen += elPenalty; + } // end iElem loop + SU2_OMP_ATOMIC + StressPenalty += stressPen; } // end color loop + wasActive = AD::BeginPassive(); /*--- Compute the von Misses stress at each point, and the maximum for the domain. ---*/ su2double maxVonMises = 0.0; @@ -1436,51 +1484,24 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, SU2_OMP(for schedule(static,omp_chunk_size) nowait) for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { - /*--- Get the stresses, added up from all the elements that connect to the node. ---*/ - - auto Stress = nodes->GetStress_FEM(iPoint); - su2double VonMises_Stress; - - if (nDim == 2) { - - su2double Sxx = Stress[0], Syy = Stress[1], Sxy = Stress[2]; - - su2double S1, S2; S1 = S2 = (Sxx+Syy)/2; - su2double tauMax = sqrt(pow((Sxx-Syy)/2, 2) + pow(Sxy,2)); - S1 += tauMax; - S2 -= tauMax; + const auto vms = vonMissesStress(nDim, nodes->GetStress_FEM(iPoint)); - VonMises_Stress = sqrt(S1*S1+S2*S2-2*S1*S2); - } - else { - - su2double Sxx = Stress[0], Syy = Stress[1], Szz = Stress[3]; - su2double Sxy = Stress[2], Sxz = Stress[4], Syz = Stress[5]; - - VonMises_Stress = sqrt(0.5*(pow(Sxx - Syy, 2) + - pow(Syy - Szz, 2) + - pow(Szz - Sxx, 2) + - 6.0*(Sxy*Sxy+Sxz*Sxz+Syz*Syz))); - } + nodes->SetVonMises_Stress(iPoint, vms); - nodes->SetVonMises_Stress(iPoint,VonMises_Stress); - - /*--- Update the maximum value of the Von Mises Stress ---*/ - - maxVonMises = max(maxVonMises, VonMises_Stress); + maxVonMises = max(maxVonMises, vms); } SU2_OMP_CRITICAL MaxVonMises_Stress = max(MaxVonMises_Stress, maxVonMises); - } // end SU2_OMP_PARALLEL + AD::EndPassive(wasActive); - su2double tmp = MaxVonMises_Stress; - SU2_MPI::Allreduce(&tmp, &MaxVonMises_Stress, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + } // end SU2_OMP_PARALLEL /*--- Set the value of the MaxVonMises_Stress as the CFEA coeffient ---*/ + SU2_MPI::Allreduce(&MaxVonMises_Stress, &Total_CFEA, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - Total_CFEA = MaxVonMises_Stress; - + /*--- Reduce the stress penalty over all ranks ---*/ + SU2_MPI::Allreduce(&StressPenalty, &Total_OFStressPenalty, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); bool outputReactions = false; @@ -1603,8 +1624,6 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, } - AD::EndPassive(wasActive); - } void CFEASolver::Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { @@ -1928,6 +1947,9 @@ void CFEASolver::Postprocessing(CGeometry *geometry, CConfig *config, CNumerics case VOLUME_FRACTION: Compute_OFVolFrac(geometry, config); break; case TOPOL_DISCRETENESS: Compute_OFVolFrac(geometry, config); break; case TOPOL_COMPLIANCE: Compute_OFCompliance(geometry, config); break; + case STRESS_PENALTY: + Compute_NodalStress(geometry, numerics, config); + break; } return; } From 162265a00536a13a4a9966c52a486dec31b86371 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 19 Jan 2021 17:54:17 +0000 Subject: [PATCH 134/326] fix the AD problem and avoid stopping the preacc outside of what starts it --- SU2_CFD/include/numerics/CNumerics.hpp | 2 +- .../numerics/elasticity/CFEAElasticity.hpp | 28 +++++++++- .../elasticity/CFEALinearElasticity.hpp | 2 +- .../elasticity/CFEANonlinearElasticity.hpp | 2 +- .../elasticity/CFEALinearElasticity.cpp | 19 +++++-- .../elasticity/CFEANonlinearElasticity.cpp | 17 +++++- SU2_CFD/src/solvers/CFEASolver.cpp | 55 ++++--------------- 7 files changed, 71 insertions(+), 54 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 368c83cebc1b..29ca32b66b45 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1495,7 +1495,7 @@ class CNumerics { * \brief A virtual member to compute the averaged nodal stresses * \param[in] element_container - Element structure for the particular element integrated. */ - inline virtual void Compute_Averaged_NodalStress(CElement *element_container, const CConfig* config) { } + inline virtual su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig* config) { return 0; } /*! * \brief Computes a basis of orthogonal vectors from a supplied vector diff --git a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp index fd96e38a99d9..b1583466cf1c 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp @@ -174,7 +174,33 @@ class CFEAElasticity : public CNumerics { * \param[in,out] element_container - The finite element. * \param[in] config - Definition of the problem. */ - inline void Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) override { }; + inline su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) override { return 0; }; + + /*! + * \brief Compute VonMises stress from components Sxx Syy Sxy Szz Sxz Syz. + */ + template + static su2double VonMisesStress(unsigned short nDim, const T& stress) { + if (nDim == 2) { + su2double Sxx = stress[0], Syy = stress[1], Sxy = stress[2]; + + su2double S1, S2; S1 = S2 = (Sxx+Syy)/2; + su2double tauMax = sqrt(pow((Sxx-Syy)/2, 2) + pow(Sxy,2)); + S1 += tauMax; + S2 -= tauMax; + + return sqrt(S1*S1+S2*S2-2*S1*S2); + } + else { + su2double Sxx = stress[0], Syy = stress[1], Szz = stress[3]; + su2double Sxy = stress[2], Sxz = stress[4], Syz = stress[5]; + + return sqrt(0.5*(pow(Sxx - Syy, 2) + + pow(Syy - Szz, 2) + + pow(Szz - Sxx, 2) + + 6.0*(Sxy*Sxy+Sxz*Sxz+Syz*Syz))); + } + } protected: /*! diff --git a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp index 7541cc11dd7e..afd58c34e98d 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp @@ -72,7 +72,7 @@ class CFEALinearElasticity : public CFEAElasticity { * \param[in,out] element_container - The finite element. * \param[in] config - Definition of the problem. */ - void Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final; + su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final; private: /*! diff --git a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp index 3ef778734aea..8a1f5206711f 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp @@ -127,7 +127,7 @@ class CFEANonlinearElasticity : public CFEAElasticity { * \param[in,out] element_container - The finite element. * \param[in] config - Definition of the problem. */ - void Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final; + su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final; protected: /*! diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index 1f0e6201186e..84d0f7215e02 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -232,7 +232,7 @@ void CFEALinearElasticity::Compute_Constitutive_Matrix(CElement *element_contain } -void CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { +su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { unsigned short iVar, jVar; unsigned short iGauss, nGauss; @@ -240,16 +240,13 @@ void CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const unsigned short iDim, bDim; /*--- Auxiliary vector ---*/ - su2double Strain[6], Stress[6]; + su2double Strain[DIM_STRAIN_3D], Stress[DIM_STRAIN_3D], avgStress[DIM_STRAIN_3D] = {0.0}; /*--- Set element properties and recompute the constitutive matrix, this is needed for multiple material cases and for correct differentiation ---*/ SetElement_Properties(element, config); /*--- Register pre-accumulation inputs ---*/ - /*--- WARNING: Outputs must be registered outside of this method, this allows more - * flexibility in selecting what is captured by AD, capturing the entire stress - * tensor would use more memory than that used by the stress residuals. ---*/ AD::StartPreacc(); AD::SetPreaccIn(E); AD::SetPreaccIn(Nu); @@ -351,6 +348,18 @@ void CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const } + for (unsigned short iStress = 0; iStress < bDim; ++iStress) + for (iNode = 0; iNode < nNode; iNode++) + avgStress[iStress] += element->Get_NodalStress(iNode, iStress) / nNode; + + auto elStress = VonMisesStress(nDim, avgStress); + + /*--- We only differentiate w.r.t. an avg VM stress for the element as + * considering all nodal stresses would use too much memory. ---*/ + AD::SetPreaccOut(elStress); + AD::EndPreacc(); + + return elStress; } diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index a02a85294e02..5c7a338ba7fc 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -741,7 +741,7 @@ void CFEANonlinearElasticity::Assign_cijkl_D_Mat(void) { } -void CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { +su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { unsigned short iVar, jVar, kVar; unsigned short iGauss, nGauss; @@ -879,4 +879,19 @@ void CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *element, co } + su2double avgStress[DIM_STRAIN_3D] = {0.0}; + const auto nStress = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; + + for (unsigned short iStress = 0; iStress < nStress; ++iStress) + for (iNode = 0; iNode < nNode; iNode++) + avgStress[iStress] += element->Get_NodalStress(iNode, iStress) / nNode; + + auto elStress = VonMisesStress(nDim, avgStress); + + /*--- We only differentiate w.r.t. an avg VM stress for the element as + * considering all nodal stresses would use too much memory. ---*/ + AD::SetPreaccOut(elStress); + AD::EndPreacc(); + + return elStress; } diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 8e84ceebe29a..f874260e87f9 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -27,6 +27,7 @@ #include "../../include/solvers/CFEASolver.hpp" #include "../../include/variables/CFEABoundVariable.hpp" +#include "../../include/numerics/elasticity/CFEAElasticity.hpp" #include "../../../Common/include/toolboxes/printing_toolbox.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" #include @@ -1321,31 +1322,6 @@ void CFEASolver::Compute_NodalStressRes(CGeometry *geometry, CNumerics **numeric } -namespace { -template -su2double vonMissesStress(unsigned short nDim, const T& stress) { - if (nDim == 2) { - su2double Sxx = stress[0], Syy = stress[1], Sxy = stress[2]; - - su2double S1, S2; S1 = S2 = (Sxx+Syy)/2; - su2double tauMax = sqrt(pow((Sxx-Syy)/2, 2) + pow(Sxy,2)); - S1 += tauMax; - S2 -= tauMax; - - return sqrt(S1*S1+S2*S2-2*S1*S2); - } - else { - su2double Sxx = stress[0], Syy = stress[1], Szz = stress[3]; - su2double Sxy = stress[2], Sxz = stress[4], Syz = stress[5]; - - return sqrt(0.5*(pow(Sxx - Syy, 2) + - pow(Syy - Szz, 2) + - pow(Szz - Sxx, 2) + - 6.0*(Sxy*Sxy+Sxz*Sxz+Syz*Syz))); - } -} -} - void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool prestretch_fem = config->GetPrestretch(); @@ -1355,7 +1331,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const unsigned short nStress = (nDim == 2) ? 3 : 6; - const auto stressScale = 1.0 / config->GetAllowedVMStress(); + const su2double stressScale = 1.0 / config->GetAllowedVMStress(); su2double StressPenalty = 0.0; su2double MaxVonMises_Stress = 0.0; @@ -1434,13 +1410,11 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, /*--- Compute the averaged nodal stresses. ---*/ int NUM_TERM = thread*MAX_TERMS + element_properties[iElem]->GetMat_Mod(); - numerics[NUM_TERM]->Compute_Averaged_NodalStress(element, config); + auto elStress = numerics[NUM_TERM]->Compute_Averaged_NodalStress(element, config); - /*--- Average the stresses for the element to compute the stress penalty, - * this is the way to make the AD of that function more economical. ---*/ - su2double avgStressElem[6] = {0.0}; - AD::SetPreaccIn(simp_penalty); - const su2double el_weight = simp_penalty / nNodes; + stressPen += pow(max(0.0, elStress*simp_penalty*stressScale - 1.0), 2); + + wasActive = AD::BeginPassive(); for (iNode = 0; iNode < nNodes; iNode++) { @@ -1453,22 +1427,15 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, LinSysReact(iPoint,iVar) += simp_penalty*Ta[iVar]; /*--- Divide the nodal stress by the number of elements that will contribute to this point. ---*/ - su2double pt_weight = simp_penalty / geometry->nodes->GetnElem(iPoint); + su2double weight = simp_penalty / geometry->nodes->GetnElem(iPoint); - for (iStress = 0; iStress < nStress; iStress++) { - auto sigma = element->Get_NodalStress(iNode,iStress); - nodes->AddStress_FEM(iPoint,iStress, pt_weight*sigma); - avgStressElem[iStress] += el_weight*sigma; - } + for (iStress = 0; iStress < nStress; iStress++) + nodes->AddStress_FEM(iPoint,iStress, weight*element->Get_NodalStress(iNode,iStress)); if (LockStrategy) omp_unset_lock(&UpdateLocks[iPoint]); } - su2double elPenalty = pow(max(0.0, vonMissesStress(nDim,avgStressElem)*stressScale - 1.0), 2); - AD::SetPreaccOut(elPenalty); - AD::EndPreacc(); // started above in Compute_Averaged_NodalStress - - stressPen += elPenalty; + AD::EndPassive(wasActive); } // end iElem loop SU2_OMP_ATOMIC @@ -1484,7 +1451,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, SU2_OMP(for schedule(static,omp_chunk_size) nowait) for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { - const auto vms = vonMissesStress(nDim, nodes->GetStress_FEM(iPoint)); + const auto vms = CFEAElasticity::VonMisesStress(nDim, nodes->GetStress_FEM(iPoint)); nodes->SetVonMises_Stress(iPoint, vms); From 4c44ffdfe470de77d4ca7088b111f7ce770aa0d1 Mon Sep 17 00:00:00 2001 From: bigfootedrockmidget Date: Wed, 20 Jan 2021 15:18:10 +0100 Subject: [PATCH 135/326] add regression test for intersection prevention --- .../{config.cfg => def_intersect.cfg} | 0 TestCases/serial_regression.py | 13 +++++++++++++ 2 files changed, 13 insertions(+) rename TestCases/deformation/intersection_prevention/{config.cfg => def_intersect.cfg} (100%) diff --git a/TestCases/deformation/intersection_prevention/config.cfg b/TestCases/deformation/intersection_prevention/def_intersect.cfg similarity index 100% rename from TestCases/deformation/intersection_prevention/config.cfg rename to TestCases/deformation/intersection_prevention/def_intersect.cfg diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 4cb0e85f6f8d..41835db722f3 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1511,6 +1511,19 @@ def main(): ### RUN SU2_DEF TESTS ### ###################################### + # intersection prevention + intersect_def = TestCase('intersectionprevention') + intersect_def.cfg_dir = "deformation/intersection_prevention" + intersect_def.cfg_file = "def_intersect.cfg" + intersect_def.test_iter = 10 + intersect_def.test_vals = [0.000112] #residual + intersect_def.su2_exec = "SU2_DEF" + intersect_def.timeout = 1600 + intersect_def.tol = 1e-04 + + pass_list.append(intersect_def.run_def()) + test_list.append(intersec_def) + # Inviscid NACA0012 (triangles) naca0012_def = TestCase('naca0012_def') naca0012_def.cfg_dir = "deformation/naca0012" From a5e8a7479247a2aadfc987f08cf1d8dcd4d2c524 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 22 Jan 2021 17:32:33 +0000 Subject: [PATCH 136/326] fix COptionDoubleArray, const correctness, and one bug --- Common/include/CConfig.hpp | 205 ++++++-------- Common/include/option_structure.inl | 39 +-- Common/src/CConfig.cpp | 252 ++++++++---------- Common/src/grid_movement/CSurfaceMovement.cpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 22 +- SU2_CFD/src/solvers/CFEASolver.cpp | 8 +- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 8 +- SU2_PY/SU2/io/historyMap.py | 17 ++ TestCases/fea_topology/config.cfg | 4 + 9 files changed, 251 insertions(+), 306 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index babf1eb237ad..0ea1ffc0c9e7 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -78,10 +78,7 @@ class CConfig { su2double Fan_Poly_Eff; /*!< \brief Fan polytropic effeciency. */ su2double MinLogResidual; /*!< \brief Minimum value of the log residual. */ su2double EA_ScaleFactor; /*!< \brief Equivalent Area scaling factor */ - su2double* EA_IntLimit; /*!< \brief Integration limits of the Equivalent Area computation */ su2double AdjointLimit; /*!< \brief Adjoint variable limit */ - su2double* Obj_ChainRuleCoeff; /*!< \brief Array defining objective function for adjoint problem based on - chain rule in terms of gradient w.r.t. density, velocity, pressure */ string* ConvField; /*!< \brief Field used for convergence check.*/ string* WndConvField; /*!< \brief Function where to apply the windowed convergence criteria for the time average of the unsteady (single zone) flow problem. */ @@ -93,10 +90,6 @@ class CConfig { bool Wnd_Cauchy_Crit; /*!< \brief True => Cauchy criterion is used for time average objective function in unsteady flows. */ bool MG_AdjointFlow; /*!< \brief MG with the adjoint flow problem */ - su2double* SubsonicEngine_Cyl; /*!< \brief Coordinates of the box subsonic region */ - su2double* SubsonicEngine_Values; /*!< \brief Values of the box subsonic region */ - su2double* Hold_GridFixed_Coord; /*!< \brief Coordinates of the box to hold fixed the nbumerical grid */ - su2double *DistortionRack; su2double *PressureLimits, *DensityLimits, *TemperatureLimits; /*!< \brief Limits for the primitive variables */ @@ -106,7 +99,6 @@ class CConfig { unsigned short ConvCriteria; /*!< \brief Kind of convergence criteria. */ unsigned short nFFD_Iter; /*!< \brief Iteration for the point inversion problem. */ unsigned short FFD_Blending; /*!< \brief Kind of FFD Blending function. */ - su2double* FFD_BSpline_Order; /*!< \brief BSpline order in i,j,k direction. */ su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */ bool FFD_IntPrev; /*!< \brief Enables self-intersection prevention procedure within the FFD box. */ unsigned short FFD_IntPrev_MaxIter; /*!< \brief Amount of iterations for FFD box self-intersection prevention procedure. */ @@ -470,7 +462,6 @@ class CConfig { *MG_PostSmooth, /*!< \brief Multigrid Post smoothing. */ *MG_CorrecSmooth; /*!< \brief Multigrid Jacobi implicit smoothing of the correction. */ su2double *LocationStations; /*!< \brief Airfoil sections in wing slicing subroutine. */ - su2double *NacelleLocation; /*!< \brief Definition of the nacelle location. */ unsigned short Kind_Solver, /*!< \brief Kind of solver Euler, NS, Continuous adjoint, etc. */ Kind_MZSolver, /*!< \brief Kind of multizone solver. */ @@ -592,13 +583,8 @@ class CConfig { su2double AdjTurb_Linear_Error; /*!< \brief Min error of the turbulent adjoint linear solver for the implicit formulation. */ su2double EntropyFix_Coeff; /*!< \brief Entropy fix coefficient. */ unsigned short AdjTurb_Linear_Iter; /*!< \brief Min error of the turbulent adjoint linear solver for the implicit formulation. */ - su2double *Stations_Bounds; /*!< \brief Airfoil section limit. */ unsigned short nLocationStations, /*!< \brief Number of section cuts to make when outputting mesh and cp . */ nWingStations; /*!< \brief Number of section cuts to make when calculating internal volume. */ - su2double* Kappa_Flow, /*!< \brief Numerical dissipation coefficients for the flow equations. */ - *Kappa_AdjFlow, /*!< \brief Numerical dissipation coefficients for the adjoint flow equations. */ - *Kappa_Heat; /*!< \brief Numerical dissipation coefficients for the (fvm) heat equation. */ - su2double* FFD_Axis; /*!< \brief Numerical dissipation coefficients for the adjoint equations. */ su2double Kappa_1st_AdjFlow, /*!< \brief Lax 1st order dissipation coefficient for adjoint flow equations (coarse multigrid levels). */ Kappa_2nd_AdjFlow, /*!< \brief JST 2nd order dissipation coefficient for adjoint flow equations. */ Kappa_4th_AdjFlow, /*!< \brief JST 4th order dissipation coefficient for adjoint flow equations. */ @@ -747,7 +733,6 @@ class CConfig { *CFL_AdaptParam, /*!< \brief Information about the CFL ramp. */ *RelaxFactor_Giles, /*!< \brief Information about the under relaxation factor for Giles BC. */ *CFL, /*!< \brief CFL number. */ - *HTP_Axis, /*!< \brief Location of the HTP axis. */ DomainVolume; /*!< \brief Volume of the computational grid. */ unsigned short nRefOriginMoment_X, /*!< \brief Number of X-coordinate moment computation origins. */ @@ -755,8 +740,6 @@ class CConfig { nRefOriginMoment_Z; /*!< \brief Number of Z-coordinate moment computation origins. */ unsigned short nMesh_Box_Size; short *Mesh_Box_Size; /*!< \brief Array containing the number of grid points in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */ - su2double* Mesh_Box_Length; /*!< \brief Array containing the length in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */ - su2double* Mesh_Box_Offset; /*!< \brief Array containing the offset from 0.0 in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */ string Mesh_FileName, /*!< \brief Mesh input file. */ Mesh_Out_FileName, /*!< \brief Mesh output file. */ Solution_FileName, /*!< \brief Flow solution input file. */ @@ -799,7 +782,6 @@ class CConfig { Inc_Velocity_Ref, /*!< \brief Reference velocity for custom incompressible non-dim. */ Inc_Temperature_Ref, /*!< \brief Reference temperature for custom incompressible non-dim. */ Inc_Density_Init, /*!< \brief Initial density for incompressible flows. */ - *Inc_Velocity_Init, /*!< \brief Initial velocity vector for incompressible flows. */ Inc_Temperature_Init, /*!< \brief Initial temperature for incompressible flows w/ heat transfer. */ Heat_Flux_Ref, /*!< \brief Reference heat flux for non-dim. */ Gas_Constant_Ref, /*!< \brief Reference specific gas constant. */ @@ -817,9 +799,6 @@ class CConfig { Mu_Temperature_RefND, /*!< \brief Non-dimensional reference temperature for Sutherland model. */ Mu_S, /*!< \brief Reference S for Sutherland model. */ Mu_SND; /*!< \brief Non-dimensional reference S for Sutherland model. */ - su2double* CpPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for specific heat Cp. */ - su2double* MuPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for viscosity. */ - su2double* KtPolyCoefficients; /*!< \brief Definition of the temperature polynomial coefficients for thermal conductivity. */ array CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */ array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ @@ -827,7 +806,6 @@ class CConfig { Thermal_Diffusivity_Solid, /*!< \brief Thermal diffusivity in solids. */ Temperature_Freestream_Solid, /*!< \brief Temperature in solids at freestream conditions. */ Density_Solid, /*!< \brief Total density in solids. */ - *Velocity_FreeStream, /*!< \brief Free-stream velocity vector of the fluid. */ Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */ ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */ @@ -888,20 +866,19 @@ class CConfig { su2double AitkenDynMinInit; /*!< \brief Aitken's minimum dynamic relaxation factor for the first iteration */ bool RampAndRelease; /*!< \brief option for ramp load and release */ bool Sine_Load; /*!< \brief option for sine load */ - su2double *SineLoad_Coeff; /*!< \brief Stores the load coefficient */ su2double Thermal_Diffusivity; /*!< \brief Thermal diffusivity used in the heat solver. */ su2double Cyclic_Pitch, /*!< \brief Cyclic pitch for rotorcraft simulations. */ Collective_Pitch; /*!< \brief Collective pitch for rotorcraft simulations. */ su2double Mach_Motion; /*!< \brief Mach number based on mesh velocity and freestream quantities. */ - su2double *Motion_Origin, /*!< \brief Mesh motion origin. */ - *Translation_Rate, /*!< \brief Translational velocity of the mesh. */ - *Rotation_Rate, /*!< \brief Angular velocity of the mesh . */ - *Pitching_Omega, /*!< \brief Angular frequency of the mesh pitching. */ - *Pitching_Ampl, /*!< \brief Pitching amplitude. */ - *Pitching_Phase, /*!< \brief Pitching phase offset. */ - *Plunging_Omega, /*!< \brief Angular frequency of the mesh plunging. */ - *Plunging_Ampl; /*!< \brief Plunging amplitude. */ + su2double Motion_Origin[3] = {0.0}, /*!< \brief Mesh motion origin. */ + Translation_Rate[3] = {0.0}, /*!< \brief Translational velocity of the mesh. */ + Rotation_Rate[3] = {0.0}, /*!< \brief Angular velocity of the mesh . */ + Pitching_Omega[3] = {0.0}, /*!< \brief Angular frequency of the mesh pitching. */ + Pitching_Ampl[3] = {0.0}, /*!< \brief Pitching amplitude. */ + Pitching_Phase[3] = {0.0}, /*!< \brief Pitching phase offset. */ + Plunging_Omega[3] = {0.0}, /*!< \brief Angular frequency of the mesh plunging. */ + Plunging_Ampl[3] = {0.0}; /*!< \brief Plunging amplitude. */ su2double *MarkerMotion_Origin, /*!< \brief Mesh motion origin of marker. */ *MarkerTranslation_Rate, /*!< \brief Translational velocity of marker. */ *MarkerRotation_Rate, /*!< \brief Angular velocity of marker. */ @@ -972,7 +949,6 @@ class CConfig { unsigned short Dynamic_LoadTransfer; /*!< \brief Method for dynamic load transferring. */ bool IncrementalLoad; /*!< \brief Apply the load in increments (for nonlinear structural analysis). */ unsigned long IncLoad_Nincrements; /*!< \brief Number of increments. */ - su2double *IncLoad_Criteria; /*!< \brief Criteria for the application of incremental loading. */ su2double Ramp_Time; /*!< \brief Time until the maximum load is applied. */ bool Predictor, /*!< \brief Determines whether a predictor step is used. */ Relaxation; /*!< \brief Determines whether a relaxation step is used. */ @@ -990,15 +966,15 @@ class CConfig { bool FEAAdvancedMode; /*!< \brief Determine if advanced features are used from the element-based FEA analysis (experimental). */ su2double RefGeom_Penalty, /*!< \brief Penalty weight value for the reference geometry objective function. */ RefNode_Penalty, /*!< \brief Penalty weight value for the reference node objective function. */ - DV_Penalty, /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */ - AllowedVMStress; /*!< \brief Maximum stress for the stress penalty objective function. */ + DV_Penalty; /*!< \brief Penalty weight to add a constraint to the total amount of stiffness. */ + array StressPenaltyParam = {{1.0, 20.0}}; /*!< \brief Allowed stress and KS aggregation exponent. */ unsigned long Nonphys_Points, /*!< \brief Current number of non-physical points in the solution. */ Nonphys_Reconstr; /*!< \brief Current number of non-physical reconstructions for 2nd-order upwinding. */ su2double ParMETIS_tolerance; /*!< \brief Load balancing tolerance for ParMETIS. */ long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */ long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */ unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */ - bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */ + bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */ su2double Const_DES; /*!< \brief Detached Eddy Simulation Constant. */ unsigned short Kind_WindowFct; /*!< \brief Type of window (weight) function for objective functional. */ unsigned short Kind_HybridRANSLES; /*!< \brief Kind of Hybrid RANS/LES. */ @@ -1012,19 +988,14 @@ class CConfig { bool SpatialFourier; /*!< \brief option for computing the fourier transforms for subsonic non-reflecting BC. */ bool RampRotatingFrame; /*!< \brief option for ramping up or down the Rotating Frame values */ bool RampOutletPressure; /*!< \brief option for ramping up or down the outlet pressure */ - su2double *Mixedout_Coeff; /*!< \brief coefficient for the */ - su2double *RampRotatingFrame_Coeff; /*!< \brief coefficient for Rotating frame ramp */ - su2double *RampOutletPressure_Coeff; /*!< \brief coefficient for outlet pressure ramp */ su2double AverageMachLimit; /*!< \brief option for turbulent mixingplane */ su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */ su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */ su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */ - array default_cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */ - array default_mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */ - array default_kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ - su2double *ExtraRelFacGiles; /*!< \brief coefficient for extra relaxation factor for Giles BC*/ + array cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */ + array mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */ + array kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ - su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ su2double Max_Vel2; /*!< \brief The maximum velocity^2 in the domain for the incompressible preconditioner. */ @@ -1041,11 +1012,9 @@ class CConfig { *top_optim_filter_radius; /*!< \brief Radius of the filter(s) used on the design density for topology optimization. */ unsigned short top_optim_proj_type; /*!< \brief The projection function used in topology optimization. */ su2double top_optim_proj_param; /*!< \brief The value of the parameter for the projection function. */ - bool HeatSource; /*!< \brief Flag to know if there is a volumetric heat source on the flow. */ - su2double ValHeatSource; /*!< \brief Value of the volumetric heat source on the flow (W/m3). */ - su2double Heat_Source_Rot_Z; /*!< \brief Rotation of the volumetric heat source on the Z axis. */ - su2double *Heat_Source_Center, /*!< \brief Position of the center of the heat source. */ - *Heat_Source_Axes; /*!< \brief Principal axes (x, y, z) of the ellipsoid containing the heat source. */ + bool HeatSource; /*!< \brief Flag to know if there is a volumetric heat source on the flow. */ + su2double ValHeatSource; /*!< \brief Value of the volumetric heat source on the flow (W/m3). */ + su2double Heat_Source_Rot_Z; /*!< \brief Rotation of the volumetric heat source on the Z axis. */ unsigned short Kind_Radiation; /*!< \brief Kind of radiation model used. */ unsigned short Kind_P1_Init; /*!< \brief Kind of initialization used in the P1 model. */ su2double Absorption_Coeff, /*!< \brief Absorption coefficient of the medium (radiation). */ @@ -1057,33 +1026,33 @@ class CConfig { su2double CFL_Rad; /*!< \brief CFL Number for the radiation solver. */ array default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */ - su2double default_vel_inf[3], /*!< \brief Default freestream velocity array for the COption class. */ - default_eng_cyl[7], /*!< \brief Default engine box array for the COption class. */ - default_eng_val[5], /*!< \brief Default engine box array values for the COption class. */ - default_jst_coeff[2], /*!< \brief Default artificial dissipation (flow) array for the COption class. */ - default_ffd_coeff[3], /*!< \brief Default artificial dissipation (flow) array for the COption class. */ - default_mixedout_coeff[3], /*!< \brief Default default mixedout algorithm coefficients for the COption class. */ - default_rampRotFrame_coeff[3], /*!< \brief Default ramp rotating frame coefficients for the COption class. */ - default_rampOutPres_coeff[3], /*!< \brief Default ramp outlet pressure coefficients for the COption class. */ - default_jst_adj_coeff[2], /*!< \brief Default artificial dissipation (adjoint) array for the COption class. */ - default_ad_coeff_heat[2], /*!< \brief Default artificial dissipation (heat) array for the COption class. */ - default_obj_coeff[5], /*!< \brief Default objective array for the COption class. */ - default_mesh_box_length[3], /*!< \brief Default mesh box length for the COption class. */ - default_mesh_box_offset[3], /*!< \brief Default mesh box offset for the COption class. */ - default_geo_loc[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */ - default_distortion[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */ - default_ea_lim[3], /*!< \brief Default equivalent area limit array for the COption class. */ - default_grid_fix[6], /*!< \brief Default fixed grid (non-deforming region) array for the COption class. */ - default_htp_axis[2], /*!< \brief Default HTP axis for the COption class. */ - default_ffd_axis[3], /*!< \brief Default FFD axis for the COption class. */ - default_inc_crit[3], /*!< \brief Default incremental criteria array for the COption class. */ - default_extrarelfac[2], /*!< \brief Default extra relaxation factor for Giles BC in the COption class. */ - default_sineload_coeff[3], /*!< \brief Default values for a sine load. */ - default_body_force[3], /*!< \brief Default body force vector for the COption class. */ - default_nacelle_location[5], /*!< \brief Location of the nacelle. */ - default_hs_axes[3], /*!< \brief Default principal axes (x, y, z) of the ellipsoid containing the heat source. */ - default_hs_center[3], /*!< \brief Default position of the center of the heat source. */ - default_roughness[1]; + su2double vel_init[3], /*!< \brief initial velocity array for the COption class. */ + vel_inf[3], /*!< \brief freestream velocity array for the COption class. */ + eng_cyl[7], /*!< \brief engine box array for the COption class. */ + eng_val[5], /*!< \brief engine box array values for the COption class. */ + jst_coeff[2], /*!< \brief artificial dissipation (flow) array for the COption class. */ + ffd_coeff[3], /*!< \brief artificial dissipation (flow) array for the COption class. */ + mixedout_coeff[3], /*!< \brief default mixedout algorithm coefficients for the COption class. */ + rampRotFrame_coeff[3], /*!< \brief ramp rotating frame coefficients for the COption class. */ + rampOutPres_coeff[3], /*!< \brief ramp outlet pressure coefficients for the COption class. */ + jst_adj_coeff[2], /*!< \brief artificial dissipation (adjoint) array for the COption class. */ + ad_coeff_heat[2], /*!< \brief artificial dissipation (heat) array for the COption class. */ + obj_coeff[5], /*!< \brief objective array for the COption class. */ + mesh_box_length[3], /*!< \brief mesh box length for the COption class. */ + mesh_box_offset[3], /*!< \brief mesh box offset for the COption class. */ + geo_loc[2], /*!< \brief SU2_GEO section locations array for the COption class. */ + distortion[2], /*!< \brief SU2_GEO section locations array for the COption class. */ + ea_lim[3], /*!< \brief equivalent area limit array for the COption class. */ + grid_fix[6], /*!< \brief fixed grid (non-deforming region) array for the COption class. */ + htp_axis[2], /*!< \brief HTP axis for the COption class. */ + ffd_axis[3], /*!< \brief FFD axis for the COption class. */ + inc_crit[3], /*!< \brief incremental criteria array for the COption class. */ + extrarelfac[2], /*!< \brief extra relaxation factor for Giles BC in the COption class. */ + sineload_coeff[3], /*!< \brief values for a sine load. */ + body_force[3], /*!< \brief body force vector for the COption class. */ + nacelle_location[5], /*!< \brief Location of the nacelle. */ + hs_axes[3], /*!< \brief principal axes (x, y, z) of the ellipsoid containing the heat source. */ + hs_center[3]; /*!< \brief position of the center of the heat source. */ unsigned short Riemann_Solver_FEM; /*!< \brief Riemann solver chosen for the DG method. */ su2double Quadrature_Factor_Straight; /*!< \brief Factor applied during quadrature of elements with a constant Jacobian. */ @@ -1219,7 +1188,7 @@ class CConfig { template void addEnumListOption(const string name, unsigned short & input_size, unsigned short * & option_field, const map & enum_map); - void addDoubleArrayOption(const string name, const int size, su2double * & option_field, su2double * default_value); + void addDoubleArrayOption(const string name, const int size, su2double* option_field); void addDoubleListOption(const string name, unsigned short & size, su2double * & option_field); @@ -1450,7 +1419,7 @@ class CConfig { * \param[in] index - 0 means x_min, and 1 means x_max. * \return Integration limits for the equivalent area computation. */ - su2double GetEA_IntLimit(unsigned short index) const { return EA_IntLimit[index]; } + su2double GetEA_IntLimit(unsigned short index) const { return ea_lim[index]; } /*! * \brief Get the integration limits for the equivalent area computation. @@ -1469,25 +1438,25 @@ class CConfig { * \brief Get the coordinates where of the box where the grid is going to be deformed. * \return Coordinates where of the box where the grid is going to be deformed. */ - const su2double *GetHold_GridFixed_Coord(void) const { return Hold_GridFixed_Coord; } + const su2double *GetHold_GridFixed_Coord(void) const { return grid_fix; } /*! * \brief Get the values of subsonic engine. * \return Values of subsonic engine. */ - su2double *GetSubsonicEngine_Values(void) { return SubsonicEngine_Values; } + const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } /*! * \brief Get the cycle of a subsonic engine. * \return Cyl of a subsonic engine. */ - su2double *GetSubsonicEngine_Cyl(void) { return SubsonicEngine_Cyl; } + const su2double *GetSubsonicEngine_Cyl(void) const { return eng_cyl; } /*! * \brief Get the distortion rack. * \return Distortion rack. */ - su2double *GetDistortionRack(void) { return DistortionRack; } + const su2double *GetDistortionRack(void) const { return distortion; } /*! * \brief Get the power of the dual volume in the grid adaptation sensor. @@ -1548,19 +1517,19 @@ class CConfig { * \brief Get the values of the CFL adapation. * \return Value of CFL adapation */ - su2double GetHTP_Axis(unsigned short val_index) const { return HTP_Axis[val_index]; } + su2double GetHTP_Axis(unsigned short val_index) const { return htp_axis[val_index]; } /*! * \brief Get the value of the limits for the sections. * \return Value of the limits for the sections. */ - su2double GetStations_Bounds(unsigned short val_var) const { return Stations_Bounds[val_var]; } + su2double GetStations_Bounds(unsigned short val_var) const { return geo_loc[val_var]; } /*! * \brief Get the value of the vector that connects the cartesian axis with a sherical or cylindrical one. * \return Coordinate of the Axis. */ - su2double GetFFD_Axis(unsigned short val_var) const { return FFD_Axis[val_var]; } + su2double GetFFD_Axis(unsigned short val_var) const { return ffd_axis[val_var]; } /*! * \brief Get the value of the bulk modulus. @@ -1830,8 +1799,8 @@ class CConfig { * \brief Get the vector of the dimensionalized freestream velocity. * \return Dimensionalized freestream velocity vector. */ - su2double* GetVelocity_FreeStream(void) { return Velocity_FreeStream; } - const su2double* GetVelocity_FreeStream(void) const { return Velocity_FreeStream; } + su2double* GetVelocity_FreeStream(void) { return vel_inf; } + const su2double* GetVelocity_FreeStream(void) const { return vel_inf; } /*! * \brief Get the value of the non-dimensionalized freestream temperature. @@ -2020,7 +1989,7 @@ class CConfig { * \brief Get the value of the initial velocity for incompressible flows. * \return Initial velocity for incompressible flows. */ - su2double* GetInc_Velocity_Init(void) { return Inc_Velocity_Init; } + const su2double* GetInc_Velocity_Init(void) const { return vel_init; } /*! * \brief Get the value of the initial temperature for incompressible flows. @@ -2501,7 +2470,7 @@ class CConfig { * \param[in] val_velocity_freestream - Value of the free-stream velocity component. * \param[in] val_dim - Value of the current dimension. */ - void SetVelocity_FreeStream(su2double val_velocity_freestream, unsigned short val_dim) { Velocity_FreeStream[val_dim] = val_velocity_freestream; } + void SetVelocity_FreeStream(su2double val_velocity_freestream, unsigned short val_dim) { vel_inf[val_dim] = val_velocity_freestream; } /*! * \brief Set the Froude number for free surface problems. @@ -2776,7 +2745,7 @@ class CConfig { * \brief Get the kind BSpline Order in i,j,k direction. * \return The kind BSpline Order in i,j,k direction. */ - su2double* GetFFD_BSplineOrder() { return FFD_BSpline_Order;} + const su2double* GetFFD_BSplineOrder() const { return ffd_coeff;} /*! * \brief Get the number of Runge-Kutta steps. @@ -2806,7 +2775,7 @@ class CConfig { * \brief Get the location of the time DOFs for ADER-DG on the interval [-1..1]. * \return The location of the time DOFs used in ADER-DG. */ - su2double *GetTimeDOFsADER_DG(void) { return TimeDOFsADER_DG; } + const su2double *GetTimeDOFsADER_DG(void) const { return TimeDOFsADER_DG; } /*! * \brief Get the number time integration points for ADER-DG. @@ -2818,13 +2787,13 @@ class CConfig { * \brief Get the location of the time integration points for ADER-DG on the interval [-1..1]. * \return The location of the time integration points used in ADER-DG. */ - su2double *GetTimeIntegrationADER_DG(void) { return TimeIntegrationADER_DG; } + const su2double *GetTimeIntegrationADER_DG(void) const { return TimeIntegrationADER_DG; } /*! * \brief Get the weights of the time integration points for ADER-DG. * \return The weights of the time integration points used in ADER-DG. */ - su2double *GetWeightsIntegrationADER_DG(void) { return WeightsIntegrationADER_DG; } + const su2double *GetWeightsIntegrationADER_DG(void) const { return WeightsIntegrationADER_DG; } /*! * \brief Get the total number of boundary markers including send/receive domains. @@ -3469,7 +3438,7 @@ class CConfig { * \param[in] val_index - Index of the section. * \return Coordinate of the nacelle location. */ - su2double GetNacelleLocation(unsigned short val_index) const { return NacelleLocation[val_index]; } + su2double GetNacelleLocation(unsigned short val_index) const { return nacelle_location[val_index]; } /*! * \brief Get the number of pre-smoothings in a multigrid strategy. @@ -3803,7 +3772,7 @@ class CConfig { * \param[in] val_index - Index of the array with all polynomial coefficients. * \return Temperature polynomial coefficient for specific heat Cp. */ - su2double GetCp_PolyCoeff(unsigned short val_index) const { return CpPolyCoefficients[val_index]; } + su2double GetCp_PolyCoeff(unsigned short val_index) const { return cp_polycoeffs[val_index]; } /*! * \brief Get the temperature polynomial coefficient for specific heat Cp. @@ -3817,7 +3786,7 @@ class CConfig { * \param[in] val_index - Index of the array with all polynomial coefficients. * \return Temperature polynomial coefficient for viscosity. */ - su2double GetMu_PolyCoeff(unsigned short val_index) const { return MuPolyCoefficients[val_index]; } + su2double GetMu_PolyCoeff(unsigned short val_index) const { return mu_polycoeffs[val_index]; } /*! * \brief Get the temperature polynomial coefficient for viscosity. @@ -3837,7 +3806,7 @@ class CConfig { * \param[in] val_index - Index of the array with all polynomial coefficients. * \return Temperature polynomial coefficient for thermal conductivity. */ - su2double GetKt_PolyCoeff(unsigned short val_index) const { return KtPolyCoefficients[val_index]; } + su2double GetKt_PolyCoeff(unsigned short val_index) const { return kt_polycoeffs[val_index]; } /*! * \brief Get the temperature polynomial coefficient for thermal conductivity. @@ -4769,7 +4738,7 @@ class CConfig { * \brief Get coeff for Rotating Frame Ramp. * \return coeff Ramp Rotating Frame. */ - su2double GetRampRotatingFrame_Coeff(unsigned short iCoeff) const { return RampRotatingFrame_Coeff[iCoeff];} + su2double GetRampRotatingFrame_Coeff(unsigned short iCoeff) const { return rampRotFrame_coeff[iCoeff];} /*! * \brief Get Rotating Frame Ramp option. @@ -4781,7 +4750,7 @@ class CConfig { * \brief Get coeff for Outlet Pressure Ramp. * \return coeff Ramp Outlet Pressure. */ - su2double GetRampOutletPressure_Coeff(unsigned short iCoeff) const { return RampOutletPressure_Coeff[iCoeff];} + su2double GetRampOutletPressure_Coeff(unsigned short iCoeff) const { return rampOutPres_coeff[iCoeff];} /*! * \brief Get final Outlet Pressure value for the ramp. @@ -4810,13 +4779,13 @@ class CConfig { * \brief Get mixedout coefficients. * \return mixedout coefficient. */ - su2double GetMixedout_Coeff(unsigned short iCoeff) const { return Mixedout_Coeff[iCoeff];} + su2double GetMixedout_Coeff(unsigned short iCoeff) const { return mixedout_coeff[iCoeff];} /*! * \brief Get extra relaxation factor coefficients for the Giels BC. * \return mixedout coefficient. */ - su2double GetExtraRelFacGiles(unsigned short iCoeff) const { return ExtraRelFacGiles[iCoeff];} + su2double GetExtraRelFacGiles(unsigned short iCoeff) const { return extrarelfac[iCoeff];} /*! * \brief Get mach limit for average massflow-based procedure . @@ -5059,7 +5028,7 @@ class CConfig { * calculated using the area averaged outlet values of density, velocity, and pressure. * Gradients are w.r.t density, velocity[3], and pressure. when 2D gradient w.r.t. 3rd component of velocity set to 0. */ - su2double GetCoeff_ObjChainRule(unsigned short iVar) const { return Obj_ChainRuleCoeff[iVar]; } + su2double GetCoeff_ObjChainRule(unsigned short iVar) const { return obj_coeff[iVar]; } /*! * \brief Get the kind of sensitivity smoothing technique. @@ -5692,7 +5661,7 @@ class CConfig { * \brief Get the Harmonic Balance frequency pointer. * \return Harmonic Balance Frequency pointer. */ - su2double* GetOmega_HB(void) { return Omega_HB; } + const su2double* GetOmega_HB(void) const { return Omega_HB; } /*! * \brief Get if harmonic balance source term is to be preconditioned @@ -5765,7 +5734,7 @@ class CConfig { * \brief Get a pointer to the body force vector. * \return A pointer to the body force vector. */ - const su2double* GetBody_Force_Vector(void) const { return Body_Force_Vector; } + const su2double* GetBody_Force_Vector(void) const { return body_force; } /*! * \brief Get information about the volumetric heat source. @@ -5795,7 +5764,7 @@ class CConfig { * \brief Get the position of the center of the volumetric heat source. * \return Pointer to the center of the ellipsoid that introduces a volumetric heat source. */ - inline const su2double* GetHeatSource_Center(void) const {return Heat_Source_Center;} + inline const su2double* GetHeatSource_Center(void) const {return hs_center;} /*! * \brief Set the position of the center of the volumetric heat source. @@ -5804,14 +5773,14 @@ class CConfig { * \param[in] z_cent = Z position of the center of the volumetric heat source. */ inline void SetHeatSource_Center(su2double x_cent, su2double y_cent, su2double z_cent) { - Heat_Source_Center[0] = x_cent; Heat_Source_Center[1] = y_cent; Heat_Source_Center[2] = z_cent; + hs_center[0] = x_cent; hs_center[1] = y_cent; hs_center[2] = z_cent; } /*! * \brief Get the radius of the ellipsoid that introduces a volumetric heat source. * \return Pointer to the radii (x, y, z) of the ellipsoid that introduces a volumetric heat source. */ - inline const su2double* GetHeatSource_Axes(void) const {return Heat_Source_Axes;} + inline const su2double* GetHeatSource_Axes(void) const {return hs_axes;} /*! * \brief Get information about the rotational frame. @@ -6397,7 +6366,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet velocity vector. */ - su2double* GetInlet_Velocity(string val_index); + const su2double* GetInlet_Velocity(string val_index) const; /*! * \brief Get the mass fraction vector at a supersonic inlet boundary. @@ -6473,7 +6442,7 @@ class CConfig { * \param[in] val_marker - Index corresponding to the Riemann boundary. * \return The Flowdir */ - su2double* GetRiemann_FlowDir(string val_marker); + const su2double* GetRiemann_FlowDir(string val_marker) const; /*! * \brief Get Kind Data of Riemann boundary. @@ -6501,7 +6470,7 @@ class CConfig { * \param[in] val_marker - Index corresponding to the Giles BC. * \return The Flowdir */ - su2double* GetGiles_FlowDir(string val_marker); + const su2double* GetGiles_FlowDir(string val_marker) const; /*! * \brief Get Kind Data for the Giles BC. @@ -6629,7 +6598,7 @@ class CConfig { * \param[in] val_marker - String of the viscous wall marker. * \return Pointer to the integer info for the given marker. */ - unsigned short* GetWallFunction_IntInfo(string val_marker); + const unsigned short* GetWallFunction_IntInfo(string val_marker) const; /*! * \brief Get the additional double info for the wall function treatment @@ -6637,7 +6606,7 @@ class CConfig { * \param[in] val_marker - String of the viscous wall marker. * \return Pointer to the double info for the given marker. */ - su2double* GetWallFunction_DoubleInfo(string val_marker); + const su2double* GetWallFunction_DoubleInfo(string val_marker) const; /*! * \brief Get the type of wall and roughness height on a wall boundary (Heatflux or Isothermal). @@ -8291,7 +8260,7 @@ class CConfig { * * \brief Set freestream turbonormal for initializing solution. */ - su2double* GetFreeStreamTurboNormal(void) { return FreeStreamTurboNormal; } + const su2double* GetFreeStreamTurboNormal(void) const { return FreeStreamTurboNormal; } /*! * @@ -8511,7 +8480,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the load boundary. * \return The pointer to the sine load values. */ - const su2double* GetLoad_Sine(void) const { return SineLoad_Coeff; } + const su2double* GetLoad_Sine(void) const { return sineload_coeff; } /*! * \brief Get the kind of load transfer method we want to use for dynamic problems @@ -8534,9 +8503,9 @@ class CConfig { su2double GetTotalDV_Penalty(void) const { return DV_Penalty; } /*! - * \brief Get the maximum allowed VM stress for the stress penalty objective function. + * \brief Get the maximum allowed VM stress and KS exponent for the stress penalty objective function. */ - su2double GetAllowedVMStress(void) const { return AllowedVMStress; } + array GetStressPenaltyParam(void) const { return StressPenaltyParam; } /*! * \brief Get whether a predictor is used for FSI applications. @@ -8608,7 +8577,7 @@ class CConfig { * \brief Get the value of the criteria for applying incremental loading. * \return Value of the log10 of the residual. */ - su2double GetIncLoad_Criteria(unsigned short val_var) const { return IncLoad_Criteria[val_var]; } + su2double GetIncLoad_Criteria(unsigned short val_var) const { return inc_crit[val_var]; } /*! * \brief Get the relaxation method chosen for the simulation @@ -9062,13 +9031,13 @@ class CConfig { * \brief Get the length of the analytic RECTANGLE or BOX grid in the specified coordinate direction. * \return Length the analytic RECTANGLE or BOX grid in the specified coordinate direction. */ - su2double GetMeshBoxLength(unsigned short val_iDim) const { return Mesh_Box_Length[val_iDim]; } + su2double GetMeshBoxLength(unsigned short val_iDim) const { return mesh_box_length[val_iDim]; } /*! * \brief Get the offset from 0.0 of the analytic RECTANGLE or BOX grid in the specified coordinate direction. * \return Offset from 0.0 the analytic RECTANGLE or BOX grid in the specified coordinate direction. */ - su2double GetMeshBoxOffset(unsigned short val_iDim) const { return Mesh_Box_Offset[val_iDim]; } + su2double GetMeshBoxOffset(unsigned short val_iDim) const { return mesh_box_offset[val_iDim]; } /*! * \brief Get the number of screen output variables requested (maximum 6) diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index ff56e139c01b..e69c7762b27b 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -335,25 +335,19 @@ public: }; class COptionDoubleArray : public COptionBase { - su2double * & field; // Reference to the feildname - string name; // identifier for the option - const int size; - su2double * def; - su2double * vals; - su2double * default_value; + string name; // Identifier for the option + const int size; // Number of elements + su2double* field; // Reference to the fieldname public: - COptionDoubleArray(string option_field_name, const int list_size, su2double * & option_field, su2double * default_value) : field(option_field), size(list_size) { - this->name = option_field_name; - this->default_value = default_value; - def = nullptr; - vals = nullptr; + COptionDoubleArray(string option_field_name, const int list_size, su2double* option_field) : + name(option_field_name), + size(list_size), + field(option_field) { } - ~COptionDoubleArray() override { - delete [] def; - delete [] vals; - }; + ~COptionDoubleArray() override {}; + string SetValue(vector option_value) override { COptionBase::SetValue(option_value); // Check that the size is correct @@ -371,27 +365,16 @@ public: newstring.append(" found"); return newstring; } - vals = new su2double[this->size]; for (int i = 0; i < this->size; i++) { istringstream is(option_value[i]); - su2double val; - if (!(is >> val)) { - delete [] vals; + if (!(is >> field[i])) { return badValue(option_value, "su2double array", this->name); } - vals[i] = val; } - this->field = vals; return ""; } - void SetDefault() override { - def = new su2double [size]; - for (int i = 0; i < size; i++) { - def[i] = default_value[i]; - } - this->field = def; - } + void SetDefault() override {} }; class COptionDoubleList : public COptionBase { diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 6d82d0091d8f..405b6f6e26b6 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -365,10 +365,10 @@ void CConfig::addEnumListOption(const string name, unsigned short & input_size, option_map.insert( pair(name, val) ); } -void CConfig::addDoubleArrayOption(const string name, const int size, su2double * & option_field, su2double * default_value) { +void CConfig::addDoubleArrayOption(const string name, const int size, su2double* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionDoubleArray(name, size, option_field, default_value); + COptionBase* val = new COptionDoubleArray(name, size, option_field); option_map.insert(pair(name, val)); } @@ -907,24 +907,14 @@ void CConfig::SetPointersNull(void) { Aeroelastic_plunge = nullptr; Aeroelastic_pitch = nullptr; - Velocity_FreeStream = nullptr; - Inc_Velocity_Init = nullptr; CFL_AdaptParam = nullptr; CFL = nullptr; - HTP_Axis = nullptr; PlaneTag = nullptr; - Kappa_Flow = nullptr; - Kappa_AdjFlow = nullptr; - Kappa_Heat = nullptr; - Stations_Bounds = nullptr; ParamDV = nullptr; DV_Value = nullptr; Design_Variable = nullptr; - Hold_GridFixed_Coord = nullptr; - SubsonicEngine_Cyl = nullptr; - EA_IntLimit = nullptr; TimeDOFsADER_DG = nullptr; TimeIntegrationADER_DG = nullptr; WeightsIntegrationADER_DG = nullptr; @@ -946,14 +936,6 @@ void CConfig::SetPointersNull(void) { nKind_SurfaceMovement = 0; Kind_SurfaceMovement = nullptr; LocationStations = nullptr; - Motion_Origin = nullptr; - Translation_Rate = nullptr; - Rotation_Rate = nullptr; - Pitching_Omega = nullptr; - Pitching_Ampl = nullptr; - Pitching_Phase = nullptr; - Plunging_Omega = nullptr; - Plunging_Ampl = nullptr; MarkerMotion_Origin = nullptr; MarkerTranslation_Rate = nullptr; MarkerRotation_Rate = nullptr; @@ -993,12 +975,7 @@ void CConfig::SetPointersNull(void) { RelaxFactorAverage = nullptr; RelaxFactorFourier = nullptr; nSpan_iZones = nullptr; - ExtraRelFacGiles = nullptr; - Mixedout_Coeff = nullptr; - RampRotatingFrame_Coeff = nullptr; - RampOutletPressure_Coeff = nullptr; Kind_TurboMachinery = nullptr; - SineLoad_Coeff = nullptr; Marker_MixingPlaneInterface = nullptr; Marker_TurboBoundIn = nullptr; @@ -1117,9 +1094,9 @@ void CConfig::SetConfig_Options() { addBoolOption("GRAVITY_FORCE", GravityForce, false); /* DESCRIPTION: Apply a body force as a source term (NO, YES) */ addBoolOption("BODY_FORCE", Body_Force, false); - default_body_force[0] = 0.0; default_body_force[1] = 0.0; default_body_force[2] = 0.0; + body_force[0] = 0.0; body_force[1] = 0.0; body_force[2] = 0.0; /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ - addDoubleArrayOption("BODY_FORCE_VECTOR", 3, Body_Force_Vector, default_body_force); + addDoubleArrayOption("BODY_FORCE_VECTOR", 3, body_force); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); /*!\brief BINARY_RESTART \n DESCRIPTION: Read binary SU2 native restart files. \n Options: YES, NO \ingroup Config */ @@ -1213,11 +1190,11 @@ void CConfig::SetConfig_Options() { /*--- Options related to temperature polynomial coefficients for fluid models. ---*/ /* DESCRIPTION: Definition of the temperature polynomial coefficients for specific heat Cp. */ - addDoubleArrayOption("CP_POLYCOEFFS", N_POLY_COEFFS, CpPolyCoefficients, default_cp_polycoeffs.data()); + addDoubleArrayOption("CP_POLYCOEFFS", N_POLY_COEFFS, cp_polycoeffs.data()); /* DESCRIPTION: Definition of the temperature polynomial coefficients for specific heat Cp. */ - addDoubleArrayOption("MU_POLYCOEFFS", N_POLY_COEFFS, MuPolyCoefficients, default_mu_polycoeffs.data()); + addDoubleArrayOption("MU_POLYCOEFFS", N_POLY_COEFFS, mu_polycoeffs.data()); /* DESCRIPTION: Definition of the temperature polynomial coefficients for specific heat Cp. */ - addDoubleArrayOption("KT_POLYCOEFFS", N_POLY_COEFFS, KtPolyCoefficients, default_kt_polycoeffs.data()); + addDoubleArrayOption("KT_POLYCOEFFS", N_POLY_COEFFS, kt_polycoeffs.data()); /*!\brief REYNOLDS_NUMBER \n DESCRIPTION: Reynolds number (non-dimensional, based on the free-stream values). Needed for viscous solvers. For incompressible solvers the Reynolds length will always be 1.0 \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("REYNOLDS_NUMBER", Reynolds, 0.0); @@ -1262,8 +1239,8 @@ void CConfig::SetConfig_Options() { /*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) \ingroup Config*/ addDoubleOption("INC_DENSITY_INIT", Inc_Density_Init, 1.2886); /*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) \ingroup Config*/ - default_vel_inf[0] = 1.0; default_vel_inf[1] = 0.0; default_vel_inf[2] = 0.0; - addDoubleArrayOption("INC_VELOCITY_INIT", 3, Inc_Velocity_Init, default_vel_inf); + vel_init[0] = 1.0; vel_init[1] = 0.0; vel_init[2] = 0.0; + addDoubleArrayOption("INC_VELOCITY_INIT", 3, vel_init); /*!\brief INC_TEMPERATURE_INIT \n DESCRIPTION: Initial temperature for incompressible flows with the energy equation (288.15 K by default) \ingroup Config*/ addDoubleOption("INC_TEMPERATURE_INIT", Inc_Temperature_Init, 288.15); /*!\brief INC_NONDIM \n DESCRIPTION: Non-dimensionalization scheme for incompressible flows. \ingroup Config*/ @@ -1275,9 +1252,9 @@ void CConfig::SetConfig_Options() { /*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass flow outlet in incompressible flow (0.1 by default). \ingroup Config*/ addDoubleOption("INC_OUTLET_DAMPING", Inc_Outlet_Damping, 0.1); - default_vel_inf[0] = 1.0; default_vel_inf[1] = 0.0; default_vel_inf[2] = 0.0; + vel_inf[0] = 1.0; vel_inf[1] = 0.0; vel_inf[2] = 0.0; /*!\brief FREESTREAM_VELOCITY\n DESCRIPTION: Free-stream velocity (m/s) */ - addDoubleArrayOption("FREESTREAM_VELOCITY", 3, Velocity_FreeStream, default_vel_inf); + addDoubleArrayOption("FREESTREAM_VELOCITY", 3, vel_inf); /* DESCRIPTION: Free-stream viscosity (1.853E-5 Ns/m^2 (air), 0.798E-3 Ns/m^2 (water)) */ addDoubleOption("FREESTREAM_VISCOSITY", Viscosity_FreeStream, -1.0); /* DESCRIPTION: Thermal conductivity used for heat equation */ @@ -1362,8 +1339,8 @@ void CConfig::SetConfig_Options() { /*--- Options related to various boundary markers ---*/ /*!\brief HTP_AXIS\n DESCRIPTION: Location of the HTP axis*/ - default_htp_axis[0] = 0.0; default_htp_axis[1] = 0.0; - addDoubleArrayOption("HTP_AXIS", 2, HTP_Axis, default_htp_axis); + htp_axis[0] = 0.0; htp_axis[1] = 0.0; + addDoubleArrayOption("HTP_AXIS", 2, htp_axis); /*!\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_PLOTTING", nMarker_Plotting, Marker_Plotting); /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ @@ -1458,8 +1435,8 @@ void CConfig::SetConfig_Options() { addBoolOption("SPATIAL_FOURIER", SpatialFourier, false); /*!\brief GILES_EXTRA_RELAXFACTOR \n DESCRIPTION: the 1st coeff the value of the under relaxation factor to apply to the shroud and hub, * the 2nd coefficient is the the percentage of span-wise height influenced by this extra under relaxation factor.*/ - default_extrarelfac[0] = 0.1; default_extrarelfac[1] = 0.1; - addDoubleArrayOption("GILES_EXTRA_RELAXFACTOR", 2, ExtraRelFacGiles, default_extrarelfac); + extrarelfac[0] = 0.1; extrarelfac[1] = 0.1; + addDoubleArrayOption("GILES_EXTRA_RELAXFACTOR", 2, extrarelfac); /*!\brief AVERAGE_PROCESS_TYPE \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ addEnumOption("MIXINGPLANE_INTERFACE_KIND", Kind_MixingPlaneInterface, MixingPlaneInterface_Map, NEAREST_SPAN); @@ -1469,25 +1446,25 @@ void CConfig::SetConfig_Options() { /*!\brief PERFORMANCE_AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries for performance computation. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ addEnumOption("PERFORMANCE_AVERAGE_PROCESS_KIND", Kind_PerformanceAverageProcess, AverageProcess_Map, AREA); - default_mixedout_coeff[0] = 1.0; default_mixedout_coeff[1] = 1.0E-05; default_mixedout_coeff[2] = 15.0; + mixedout_coeff[0] = 1.0; mixedout_coeff[1] = 1.0E-05; mixedout_coeff[2] = 15.0; /*!\brief MIXEDOUT_COEFF \n DESCRIPTION: the 1st coeff is an under relaxation factor for the Newton method, * the 2nd coefficient is the tolerance for the Newton method, 3rd coefficient is the maximum number of * iteration for the Newton Method.*/ - addDoubleArrayOption("MIXEDOUT_COEFF", 3, Mixedout_Coeff, default_mixedout_coeff); + addDoubleArrayOption("MIXEDOUT_COEFF", 3, mixedout_coeff); /*!\brief RAMP_ROTATING_FRAME\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_ROTATING_FRAME", RampRotatingFrame, false); - default_rampRotFrame_coeff[0] = 0; default_rampRotFrame_coeff[1] = 1.0; default_rampRotFrame_coeff[2] = 1000.0; + rampRotFrame_coeff[0] = 0; rampRotFrame_coeff[1] = 1.0; rampRotFrame_coeff[2] = 1000.0; /*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, * the 2nd coeff is the number of iterations for the update, 3rd is the number of iteration */ - addDoubleArrayOption("RAMP_ROTATING_FRAME_COEFF", 3, RampRotatingFrame_Coeff, default_rampRotFrame_coeff); + addDoubleArrayOption("RAMP_ROTATING_FRAME_COEFF", 3, rampRotFrame_coeff); /* DESCRIPTION: AVERAGE_MACH_LIMIT is a limit value for average procedure based on the mass flux. */ addDoubleOption("AVERAGE_MACH_LIMIT", AverageMachLimit, 0.03); /*!\brief RAMP_OUTLET_PRESSURE\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_OUTLET_PRESSURE", RampOutletPressure, false); - default_rampOutPres_coeff[0] = 100000.0; default_rampOutPres_coeff[1] = 1.0; default_rampOutPres_coeff[2] = 1000.0; + rampOutPres_coeff[0] = 100000.0; rampOutPres_coeff[1] = 1.0; rampOutPres_coeff[2] = 1000.0; /*!\brief RAMP_OUTLET_PRESSURE_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet pressure, * the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the final outlet pressure value */ - addDoubleArrayOption("RAMP_OUTLET_PRESSURE_COEFF", 3, RampOutletPressure_Coeff, default_rampOutPres_coeff); + addDoubleArrayOption("RAMP_OUTLET_PRESSURE_COEFF", 3, rampOutPres_coeff); /*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup Config*/ addStringListOption("MARKER_MIXINGPLANE_INTERFACE", nMarker_MixingPlaneInterface, Marker_MixingPlaneInterface); /*!\brief TURBULENT_MIXINGPLANE \n DESCRIPTION: Activate mixing plane also for turbulent quantities \ingroup Config*/ @@ -1545,16 +1522,15 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Actuator disk double surface */ addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ - default_distortion[0] = 5.0; default_distortion[1] = 15.0; - addDoubleArrayOption("DISTORTION_RACK", 2, DistortionRack, default_distortion); + distortion[0] = 5.0; distortion[1] = 15.0; + addDoubleArrayOption("DISTORTION_RACK", 2, distortion); /* DESCRIPTION: Values of the box to impose a subsonic nacellle (mach, Pressure, Temperature) */ - default_eng_val[0]=0.0; default_eng_val[1]=0.0; default_eng_val[2]=0.0; - default_eng_val[3]=0.0; default_eng_val[4]=0.0; - addDoubleArrayOption("SUBSONIC_ENGINE_VALUES", 5, SubsonicEngine_Values, default_eng_val); + eng_val[0]=0.0; eng_val[1]=0.0; eng_val[2]=0.0; eng_val[3]=0.0; eng_val[4]=0.0; + addDoubleArrayOption("SUBSONIC_ENGINE_VALUES", 5, eng_val); /* DESCRIPTION: Coordinates of the box to impose a subsonic nacellle cylinder (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, Radius) */ - default_eng_cyl[0] = 0.0; default_eng_cyl[1] = 0.0; default_eng_cyl[2] = 0.0; - default_eng_cyl[3] = 1E15; default_eng_cyl[4] = 1E15; default_eng_cyl[5] = 1E15; default_eng_cyl[6] = 1E15; - addDoubleArrayOption("SUBSONIC_ENGINE_CYL", 7, SubsonicEngine_Cyl, default_eng_cyl); + eng_cyl[0] = 0.0; eng_cyl[1] = 0.0; eng_cyl[2] = 0.0; + eng_cyl[3] = 1E15; eng_cyl[4] = 1E15; eng_cyl[5] = 1E15; eng_cyl[6] = 1E15; + addDoubleArrayOption("SUBSONIC_ENGINE_CYL", 7, eng_cyl); /* DESCRIPTION: Engine exhaust boundary marker(s) Format: (nacelle exhaust marker, total nozzle temp, total nozzle pressure, ... )*/ addExhaustOption("MARKER_ENGINE_EXHAUST", nMarker_EngineExhaust, Marker_EngineExhaust, Exhaust_Temperature_Target, Exhaust_Pressure_Target); @@ -1577,9 +1553,9 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); /*!\brief SINE_LOAD\n DESCRIPTION: option to apply the load as a sine*/ addBoolOption("SINE_LOAD", Sine_Load, false); - default_sineload_coeff[0] = 0.0; default_sineload_coeff[1] = 0.0; default_sineload_coeff[2] = 0.0; + sineload_coeff[0] = 0.0; sineload_coeff[1] = 0.0; sineload_coeff[2] = 0.0; /*!\brief SINE_LOAD_COEFF \n DESCRIPTION: the 1st coeff is the amplitude, the 2nd is the frequency, 3rd is the phase in radians */ - addDoubleArrayOption("SINE_LOAD_COEFF", 3, SineLoad_Coeff, default_sineload_coeff); + addDoubleArrayOption("SINE_LOAD_COEFF", 3, sineload_coeff); /*!\brief RAMP_AND_RELEASE\n DESCRIPTION: release the load after applying the ramp*/ addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); @@ -1805,14 +1781,14 @@ void CConfig::SetConfig_Options() { /*!\brief SLOPE_LIMITER_FLOW * DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_FLOW", Kind_SlopeLimit_Flow, Limiter_Map, VENKATAKRISHNAN); - default_jst_coeff[0] = 0.5; default_jst_coeff[1] = 0.02; + jst_coeff[0] = 0.5; jst_coeff[1] = 0.02; /*!\brief JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method \ingroup Config*/ - addDoubleArrayOption("JST_SENSOR_COEFF", 2, Kappa_Flow, default_jst_coeff); + addDoubleArrayOption("JST_SENSOR_COEFF", 2, jst_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - default_ad_coeff_heat[0] = 0.5; default_ad_coeff_heat[1] = 0.02; + ad_coeff_heat[0] = 0.5; ad_coeff_heat[1] = 0.02; /*!\brief JST_SENSOR_COEFF_HEAT \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method \ingroup Config*/ - addDoubleArrayOption("JST_SENSOR_COEFF_HEAT", 2, Kappa_Heat, default_ad_coeff_heat); + addDoubleArrayOption("JST_SENSOR_COEFF_HEAT", 2, ad_coeff_heat); /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ @@ -1829,9 +1805,9 @@ void CConfig::SetConfig_Options() { /*!\brief SLOPE_LIMITER_ADJFLOW * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_ADJFLOW", Kind_SlopeLimit_AdjFlow, Limiter_Map, VENKATAKRISHNAN); - default_jst_adj_coeff[0] = 0.5; default_jst_adj_coeff[1] = 0.02; + jst_adj_coeff[0] = 0.5; jst_adj_coeff[1] = 0.02; /*!\brief ADJ_JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the adjoint JST method. \ingroup Config*/ - addDoubleArrayOption("ADJ_JST_SENSOR_COEFF", 2, Kappa_AdjFlow, default_jst_adj_coeff); + addDoubleArrayOption("ADJ_JST_SENSOR_COEFF", 2, jst_adj_coeff); /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("ADJ_LAX_SENSOR_COEFF", Kappa_1st_AdjFlow, 0.15); @@ -1884,17 +1860,16 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: parameter for the definition of a complex objective function */ addDoubleOption("DCD_DCMY_VALUE", dCD_dCMy, 0.0); - default_obj_coeff[0]=0.0; default_obj_coeff[1]=0.0; default_obj_coeff[2]=0.0; - default_obj_coeff[3]=0.0; default_obj_coeff[4]=0.0; + obj_coeff[0]=0.0; obj_coeff[1]=0.0; obj_coeff[2]=0.0; obj_coeff[3]=0.0; obj_coeff[4]=0.0; /*!\brief OBJ_CHAIN_RULE_COEFF * \n DESCRIPTION: Coefficients defining the objective function gradient using the chain rule * with area-averaged outlet primitive variables. This is used with the genereralized outflow * objective. \ingroup Config */ - addDoubleArrayOption("OBJ_CHAIN_RULE_COEFF", 5, Obj_ChainRuleCoeff, default_obj_coeff); + addDoubleArrayOption("OBJ_CHAIN_RULE_COEFF", 5, obj_coeff); - default_geo_loc[0] = 0.0; default_geo_loc[1] = 1.0; + geo_loc[0] = 0.0; geo_loc[1] = 1.0; /* DESCRIPTION: Definition of the airfoil section */ - addDoubleArrayOption("GEO_BOUNDS", 2, Stations_Bounds, default_geo_loc); + addDoubleArrayOption("GEO_BOUNDS", 2, geo_loc); /* DESCRIPTION: Identify the body to slice */ addEnumOption("GEO_DESCRIPTION", Geo_Description, Geo_Description_Map, WING); /* DESCRIPTION: Z location of the waterline */ @@ -1903,10 +1878,10 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("GEO_NUMBER_STATIONS", nWingStations, 25); /* DESCRIPTION: Definition of the airfoil sections */ addDoubleListOption("GEO_LOCATION_STATIONS", nLocationStations, LocationStations); - default_nacelle_location[0] = 0.0; default_nacelle_location[1] = 0.0; default_nacelle_location[2] = 0.0; - default_nacelle_location[3] = 0.0; default_nacelle_location[4] = 0.0; + nacelle_location[0] = 0.0; nacelle_location[1] = 0.0; nacelle_location[2] = 0.0; + nacelle_location[3] = 0.0; nacelle_location[4] = 0.0; /* DESCRIPTION: Definition of the nacelle location (higlite coordinates, tilt angle, toe angle) */ - addDoubleArrayOption("GEO_NACELLE_LOCATION", 5, NacelleLocation, default_nacelle_location); + addDoubleArrayOption("GEO_NACELLE_LOCATION", 5, nacelle_location); /* DESCRIPTION: Output sectional forces for specified markers. */ addBoolOption("GEO_PLOT_STATIONS", Plot_Section_Forces, false); /* DESCRIPTION: Mode of the GDC code (analysis, or gradient) */ @@ -1951,12 +1926,12 @@ void CConfig::SetConfig_Options() { addShortListOption("MESH_BOX_SIZE", nMesh_Box_Size, Mesh_Box_Size); /* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */ - default_mesh_box_length[0] = 1.0; default_mesh_box_length[1] = 1.0; default_mesh_box_length[2] = 1.0; - addDoubleArrayOption("MESH_BOX_LENGTH", 3, Mesh_Box_Length, default_mesh_box_length); + mesh_box_length[0] = 1.0; mesh_box_length[1] = 1.0; mesh_box_length[2] = 1.0; + addDoubleArrayOption("MESH_BOX_LENGTH", 3, mesh_box_length); /* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: (0.0,0.0,0.0) ). */ - default_mesh_box_offset[0] = 0.0; default_mesh_box_offset[1] = 0.0; default_mesh_box_offset[2] = 0.0; - addDoubleArrayOption("MESH_BOX_OFFSET", 3, Mesh_Box_Offset, default_mesh_box_offset); + mesh_box_offset[0] = 0.0; mesh_box_offset[1] = 0.0; mesh_box_offset[2] = 0.0; + addDoubleArrayOption("MESH_BOX_OFFSET", 3, mesh_box_offset); /* DESCRIPTION: Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) */ addBoolOption("MULTIZONE_MESH", Multizone_Mesh, true); @@ -2022,23 +1997,22 @@ void CConfig::SetConfig_Options() { addStringListOption("MARKER_MOVING", nMarker_Moving, Marker_Moving); /* DESCRIPTION: Mach number (non-dimensional, based on the mesh velocity and freestream vals.) */ addDoubleOption("MACH_MOTION", Mach_Motion, 0.0); - default_vel_inf[0] = 0.0; default_vel_inf[1] = 0.0; default_vel_inf[2] = 0.0; /* DESCRIPTION: Coordinates of the rigid motion origin */ - addDoubleArrayOption("MOTION_ORIGIN", 3, Motion_Origin, default_vel_inf); + addDoubleArrayOption("MOTION_ORIGIN", 3, Motion_Origin); /* DESCRIPTION: Translational velocity vector (m/s) in the x, y, & z directions (RIGID_MOTION only) */ - addDoubleArrayOption("TRANSLATION_RATE", 3, Translation_Rate, default_vel_inf); + addDoubleArrayOption("TRANSLATION_RATE", 3, Translation_Rate); /* DESCRIPTION: Angular velocity vector (rad/s) about x, y, & z axes (RIGID_MOTION only) */ - addDoubleArrayOption("ROTATION_RATE", 3, Rotation_Rate, default_vel_inf); + addDoubleArrayOption("ROTATION_RATE", 3, Rotation_Rate); /* DESCRIPTION: Pitching angular freq. (rad/s) about x, y, & z axes (RIGID_MOTION only) */ - addDoubleArrayOption("PITCHING_OMEGA", 3, Pitching_Omega, default_vel_inf); + addDoubleArrayOption("PITCHING_OMEGA", 3, Pitching_Omega); /* DESCRIPTION: Pitching amplitude (degrees) about x, y, & z axes (RIGID_MOTION only) */ - addDoubleArrayOption("PITCHING_AMPL", 3, Pitching_Ampl, default_vel_inf); + addDoubleArrayOption("PITCHING_AMPL", 3, Pitching_Ampl); /* DESCRIPTION: Pitching phase offset (degrees) about x, y, & z axes (RIGID_MOTION only) */ - addDoubleArrayOption("PITCHING_PHASE", 3, Pitching_Phase, default_vel_inf); + addDoubleArrayOption("PITCHING_PHASE", 3, Pitching_Phase); /* DESCRIPTION: Plunging angular freq. (rad/s) in x, y, & z directions (RIGID_MOTION only) */ - addDoubleArrayOption("PLUNGING_OMEGA", 3, Plunging_Omega, default_vel_inf); + addDoubleArrayOption("PLUNGING_OMEGA", 3, Plunging_Omega); /* DESCRIPTION: Plunging amplitude (m) in x, y, & z directions (RIGID_MOTION only) */ - addDoubleArrayOption("PLUNGING_AMPL", 3, Plunging_Ampl, default_vel_inf); + addDoubleArrayOption("PLUNGING_AMPL", 3, Plunging_Ampl); /* DESCRIPTION: Coordinates of the rigid motion origin */ addDoubleListOption("SURFACE_MOTION_ORIGIN", nMarkerMotion_Origin, MarkerMotion_Origin); /* DESCRIPTION: Translational velocity vector (m/s) in the x, y, & z directions (DEFORMING only) */ @@ -2128,9 +2102,9 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Evaluate equivalent area on the Near-Field */ addBoolOption("EQUIV_AREA", EquivArea, false); - default_ea_lim[0] = 0.0; default_ea_lim[1] = 1.0; default_ea_lim[2] = 1.0; + ea_lim[0] = 0.0; ea_lim[1] = 1.0; ea_lim[2] = 1.0; /* DESCRIPTION: Integration limits of the equivalent area ( xmin, xmax, Dist_NearField ) */ - addDoubleArrayOption("EA_INT_LIMIT", 3, EA_IntLimit, default_ea_lim); + addDoubleArrayOption("EA_INT_LIMIT", 3, ea_lim); /* DESCRIPTION: Equivalent area scaling factor */ addDoubleOption("EA_SCALE_FACTOR", EA_ScaleFactor, 1.0); @@ -2176,10 +2150,10 @@ void CConfig::SetConfig_Options() { addEnumOption("DV_SENSITIVITY_FORMAT", Sensitivity_FileFormat, Sensitivity_Map, SU2_NATIVE); /* DESCRIPTION: Hold the grid fixed in a region */ addBoolOption("HOLD_GRID_FIXED", Hold_GridFixed, false); - default_grid_fix[0] = -1E15; default_grid_fix[1] = -1E15; default_grid_fix[2] = -1E15; - default_grid_fix[3] = 1E15; default_grid_fix[4] = 1E15; default_grid_fix[5] = 1E15; + grid_fix[0] = -1E15; grid_fix[1] = -1E15; grid_fix[2] = -1E15; + grid_fix[3] = 1E15; grid_fix[4] = 1E15; grid_fix[5] = 1E15; /* DESCRIPTION: Coordinates of the box where the grid will be deformed (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax) */ - addDoubleArrayOption("HOLD_GRID_FIXED_COORD", 6, Hold_GridFixed_Coord, default_grid_fix); + addDoubleArrayOption("HOLD_GRID_FIXED_COORD", 6, grid_fix); /*!\par CONFIG_CATEGORY: Deformable mesh \ingroup Config*/ /*--- option related to deformable meshes ---*/ @@ -2294,8 +2268,8 @@ void CConfig::SetConfig_Options() { /*!\brief REFERENCE_NODE_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_NODE_PENALTY", RefNode_Penalty, 1E3); - /*!\brief ALLOWED_VONMISSES_STRESS\n DESCRIPTION: Maximum allowed stress for structural optimization \ingroup Config*/ - addDoubleOption("ALLOWED_VONMISSES_STRESS", AllowedVMStress, 1.0); + /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization \ingroup Config*/ + addDoubleArrayOption("STRESS_PENALTY_PARAM", 2, StressPenaltyParam.data()); /*!\brief REGIME_TYPE \n DESCRIPTION: Geometric condition \n OPTIONS: see \link Struct_Map \endlink \ingroup Config*/ addEnumOption("GEOMETRIC_CONDITIONS", Kind_Struct_Solver, Struct_Map, SMALL_DEFORMATIONS); @@ -2345,9 +2319,9 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Maximum number of increments of the */ addUnsignedLongOption("NUMBER_INCREMENTS", IncLoad_Nincrements, 10); - default_inc_crit[0] = 0.0; default_inc_crit[1] = 0.0; default_inc_crit[2] = 0.0; + inc_crit[0] = 0.0; inc_crit[1] = 0.0; inc_crit[2] = 0.0; /* DESCRIPTION: Definition of the UTOL RTOL ETOL*/ - addDoubleArrayOption("INCREMENTAL_CRITERIA", 3, IncLoad_Criteria, default_inc_crit); + addDoubleArrayOption("INCREMENTAL_CRITERIA", 3, inc_crit); /* DESCRIPTION: Use of predictor */ addBoolOption("PREDICTOR", Predictor, false); @@ -2486,11 +2460,11 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Rotation of the volumetric heat source respect to Z axis */ addDoubleOption("HEAT_SOURCE_ROTATION_Z", Heat_Source_Rot_Z, 0.0); /* DESCRIPTION: Position of heat source center (Heat_Source_Center_X, Heat_Source_Center_Y, Heat_Source_Center_Z) */ - default_hs_center[0] = 0.0; default_hs_center[1] = 0.0; default_hs_center[2] = 0.0; - addDoubleArrayOption("HEAT_SOURCE_CENTER", 3, Heat_Source_Center, default_hs_center); + hs_center[0] = 0.0; hs_center[1] = 0.0; hs_center[2] = 0.0; + addDoubleArrayOption("HEAT_SOURCE_CENTER", 3, hs_center); /* DESCRIPTION: Vector of heat source radii (Heat_Source_Axes_A, Heat_Source_Axes_B, Heat_Source_Axes_C) */ - default_hs_axes[0] = 1.0; default_hs_axes[1] = 1.0; default_hs_axes[2] = 1.0; - addDoubleArrayOption("HEAT_SOURCE_AXES", 3, Heat_Source_Axes, default_hs_axes); + hs_axes[0] = 1.0; hs_axes[1] = 1.0; hs_axes[2] = 1.0; + addDoubleArrayOption("HEAT_SOURCE_AXES", 3, hs_axes); /*!\brief MARKER_EMISSIVITY DESCRIPTION: Wall emissivity of the marker for radiation purposes \n * Format: ( marker, emissivity of the marker, ... ) \ingroup Config */ @@ -2555,8 +2529,8 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_COORD_SYSTEM", FFD_CoordSystem, CoordSystem_Map, CARTESIAN); /* DESCRIPTION: Axis information for the spherical and cylindrical coord system */ - default_ffd_axis[0] = 0.0; default_ffd_axis[1] = 0.0; default_ffd_axis[2] =0.0; - addDoubleArrayOption("FFD_AXIS", 3, FFD_Axis, default_ffd_axis); + ffd_axis[0] = 0.0; ffd_axis[1] = 0.0; ffd_axis[2] =0.0; + addDoubleArrayOption("FFD_AXIS", 3, ffd_axis); /* DESCRIPTION: Number of total iterations in the FFD point inversion */ addUnsignedShortOption("FFD_ITERATIONS", nFFD_Iter, 500); @@ -2595,8 +2569,8 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_BLENDING", FFD_Blending, Blending_Map, BEZIER ); /* DESCRIPTION: Order of the BSplines for BSpline Blending function */ - default_ffd_coeff[0] = 2; default_ffd_coeff[1] = 2; default_ffd_coeff[2] = 2; - addDoubleArrayOption("FFD_BSPLINE_ORDER", 3, FFD_BSpline_Order, default_ffd_coeff); + ffd_coeff[0] = 2; ffd_coeff[1] = 2; ffd_coeff[2] = 2; + addDoubleArrayOption("FFD_BSPLINE_ORDER", 3, ffd_coeff); /*--- Options for the automatic differentiation methods ---*/ /*!\par CONFIG_CATEGORY: Automatic Differentation options\ingroup Config*/ @@ -3265,18 +3239,18 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Compute x-velocity with a safegaurd for 0.0. ---*/ su2double Vx = 1e-10; - if (Inc_Velocity_Init[0] != 0.0) { - Vx = Inc_Velocity_Init[0]; + if (vel_init[0] != 0.0) { + Vx = vel_init[0]; } /*--- Compute the angle-of-attack and sideslip. ---*/ su2double alpha = 0.0, beta = 0.0; if (val_nDim == 2) { - alpha = atan(Inc_Velocity_Init[1]/Vx)*180.0/PI_NUMBER; + alpha = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; } else { - alpha = atan(Inc_Velocity_Init[2]/Vx)*180.0/PI_NUMBER; - beta = atan(Inc_Velocity_Init[1]/Vx)*180.0/PI_NUMBER; + alpha = atan(vel_init[2]/Vx)*180.0/PI_NUMBER; + beta = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; } /*--- Set alpha and beta in the config class. ---*/ @@ -3796,28 +3770,28 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if(GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint){ FinalRotation_Rate_Z = Rotation_Rate[2]; if(abs(FinalRotation_Rate_Z) > 0.0){ - Rotation_Rate[2] = RampRotatingFrame_Coeff[0]; + Rotation_Rate[2] = rampRotFrame_coeff[0]; } } if(RampOutletPressure && !DiscreteAdjoint){ for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){ if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM ){ - FinalOutletPressure = Giles_Var1[iMarker]; - Giles_Var1[iMarker] = RampOutletPressure_Coeff[0]; + FinalOutletPressure = Giles_Var1[iMarker]; + Giles_Var1[iMarker] = rampOutPres_coeff[0]; } } for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++){ if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM){ - FinalOutletPressure = Riemann_Var1[iMarker]; - Riemann_Var1[iMarker] = RampOutletPressure_Coeff[0]; - } + FinalOutletPressure = Riemann_Var1[iMarker]; + Riemann_Var1[iMarker] = rampOutPres_coeff[0]; } } + } /*--- Check on extra Relaxation factor for Giles---*/ - if(ExtraRelFacGiles[1] > 0.5){ - ExtraRelFacGiles[1] = 0.5; + if(extrarelfac[1] > 0.5){ + extrarelfac[1] = 0.5; } /*--- Use the various rigid-motion input frequencies to determine the period to be used with harmonic balance cases. There are THREE types of motion to consider, namely: rotation, pitching, and plunging. @@ -4001,12 +3975,12 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_Solver == FEM_EULER) Kind_Turb_Model = NONE; - Kappa_2nd_Flow = Kappa_Flow[0]; - Kappa_4th_Flow = Kappa_Flow[1]; - Kappa_2nd_AdjFlow = Kappa_AdjFlow[0]; - Kappa_4th_AdjFlow = Kappa_AdjFlow[1]; - Kappa_2nd_Heat = Kappa_Heat[0]; - Kappa_4th_Heat = Kappa_Heat[1]; + Kappa_2nd_Flow = jst_coeff[0]; + Kappa_4th_Flow = jst_coeff[1]; + Kappa_2nd_AdjFlow = jst_adj_coeff[0]; + Kappa_4th_AdjFlow = jst_adj_coeff[1]; + Kappa_2nd_Heat = ad_coeff_heat[0]; + Kappa_4th_Heat = ad_coeff_heat[1]; /*--- Make the MG_PreSmooth, MG_PostSmooth, and MG_CorrecSmooth arrays consistent with nMGLevels ---*/ @@ -4173,8 +4147,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_ConvNumScheme_Flow = Kind_ConvNumScheme_AdjFlow; Kind_Centered_Flow = Kind_Centered_AdjFlow; Kind_Upwind_Flow = Kind_Upwind_AdjFlow; - Kappa_Flow[0] = Kappa_AdjFlow[0]; - Kappa_Flow[1] = Kappa_AdjFlow[1]; + Kappa_2nd_Flow = jst_adj_coeff[0]; + Kappa_4th_Flow = jst_adj_coeff[1]; } if (Update_AoA_Iter_Limit == 0 && Fixed_CL_Mode) { @@ -4332,8 +4306,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ for (unsigned short iSections = 0; iSections < nLocationStations; iSections++) { LocationStations[iSections] += EPS; } - Stations_Bounds[0] += EPS; - Stations_Bounds[1] += EPS; + geo_loc[0] += EPS; + geo_loc[1] += EPS; } /*--- Length based parameter for slope limiters uses a default value of @@ -4367,26 +4341,19 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Highlite_Area = Highlite_Area/144.0; SemiSpan = SemiSpan/12.0; - EA_IntLimit[0] = EA_IntLimit[0]/12.0; - EA_IntLimit[1] = EA_IntLimit[1]/12.0; - EA_IntLimit[2] = EA_IntLimit[2]/12.0; + ea_lim[0] /= 12.0; + ea_lim[1] /= 12.0; + ea_lim[2] /= 12.0; if (Geo_Description != NACELLE) { for (unsigned short iSections = 0; iSections < nLocationStations; iSections++) { LocationStations[iSections] = LocationStations[iSections]/12.0; } - Stations_Bounds[0] = Stations_Bounds[0]/12.0; - Stations_Bounds[1] = Stations_Bounds[1]/12.0; + geo_loc[0] /= 12.0; + geo_loc[1] /= 12.0; } - SubsonicEngine_Cyl[0] = SubsonicEngine_Cyl[0]/12.0; - SubsonicEngine_Cyl[1] = SubsonicEngine_Cyl[1]/12.0; - SubsonicEngine_Cyl[2] = SubsonicEngine_Cyl[2]/12.0; - SubsonicEngine_Cyl[3] = SubsonicEngine_Cyl[3]/12.0; - SubsonicEngine_Cyl[4] = SubsonicEngine_Cyl[4]/12.0; - SubsonicEngine_Cyl[5] = SubsonicEngine_Cyl[5]/12.0; - SubsonicEngine_Cyl[6] = SubsonicEngine_Cyl[6]/12.0; - + for (int i=0; i<7; ++i) eng_cyl[i] /= 12.0; } if ((Kind_Turb_Model != SA) && (Kind_Trans_Model == BC)){ @@ -5635,14 +5602,14 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } if (Fixed_CM_Mode) { cout << "Fixed CM mode, target value: " << Target_CM << "." << endl; - cout << "HTP rotation axis (X,Z): ("<< HTP_Axis[0] <<", "<< HTP_Axis[1] <<")."<< endl; + cout << "HTP rotation axis (X,Z): ("<< htp_axis[0] <<", "<< htp_axis[1] <<")."<< endl; } } if (EquivArea) { cout <<"The equivalent area is going to be evaluated on the near-field."<< endl; - cout <<"The lower integration limit is "<GetKind_GridMovement() == AEROELASTIC_RIGID_MOTION) { su2double Omega, dt, psi; dt = config->GetDelta_UnstTimeND(); - Omega = (config->GetRotation_Rate(3)/config->GetOmega_Ref()); + Omega = config->GetRotation_Rate(2)/config->GetOmega_Ref(); psi = Omega*(dt*TimeIter); /*--- Correct for the airfoil starting position (This is hardcoded in here) ---*/ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 83221d895ccc..fae1a2d6fda2 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5841,7 +5841,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, unsigned short iDim, iVar, jVar, kVar; unsigned long iVertex, iPoint, Point_Normal; - su2double P_Total, T_Total, P_static, T_static, Rho_static, *Mach, *Flow_Dir, Area, UnitNormal[3]; + const su2double *Flow_Dir, *Mach; + su2double P_Total, T_Total, P_static, T_static, Rho_static, Area, UnitNormal[MAXNDIM]; su2double *Velocity_b, Velocity2_b, Enthalpy_b, Energy_b, StaticEnergy_b, Density_b, Kappa_b, Chi_b, Pressure_b, Temperature_b; su2double *Velocity_e, Velocity2_e, VelMag_e, Enthalpy_e, Entropy_e, Energy_e = 0.0, StaticEnthalpy_e, StaticEnergy_e, Density_e = 0.0, Pressure_e; su2double *Velocity_i, Velocity2_i, Enthalpy_i, Energy_i, StaticEnergy_i, Density_i, Kappa_i, Chi_i, Pressure_i, SoundSpeed_i; @@ -6352,7 +6353,8 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain unsigned short iDim, iVar, jVar, kVar, iSpan; unsigned long iPoint, Point_Normal, oldVertex, iVertex; - su2double P_Total, T_Total, *Flow_Dir; + const su2double *Flow_Dir; + su2double P_Total, T_Total; su2double *Velocity_b, Velocity2_b, Enthalpy_b, Energy_b, StaticEnergy_b, Density_b, Kappa_b, Chi_b, Pressure_b, Temperature_b; su2double *Velocity_e, Velocity2_e, Enthalpy_e, Entropy_e, Energy_e = 0.0, StaticEnthalpy_e, StaticEnergy_e, Density_e = 0.0, Pressure_e; su2double *Velocity_i, Velocity2_i, Enthalpy_i, Energy_i, StaticEnergy_i, Density_i, Kappa_i, Chi_i, Pressure_i, SoundSpeed_i; @@ -7036,7 +7038,7 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu su2double relfacFouCfg = config->GetGiles_RelaxFactorFourier(Marker_Tag); su2double *Normal; su2double TwoPiThetaFreq_Pitch, pitch,theta; - const su2double *SpanWiseValues = nullptr; + const su2double *SpanWiseValues = nullptr, *FlowDir; su2double spanPercent, extrarelfacAvg = 0.0, deltaSpan = 0.0, relfacAvg, relfacFou, coeffrelfacAvg = 0.0; unsigned short Turbo_Flag; @@ -7053,7 +7055,7 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu S_boundary = new su2double[8]; su2double AvgMach , *cj, GilesBeta, *delta_c, **R_Matrix, *deltaprim, **R_c_inv,**R_c, alphaIn_BC, gammaIn_BC = 0, - P_Total, T_Total, *FlowDir, Enthalpy_BC, Entropy_BC, *R, *c_avg,*dcjs, Beta_inf2, c2js_Re, c3js_Re, cOutjs_Re, avgVel2 =0.0; + P_Total, T_Total, Enthalpy_BC, Entropy_BC, *R, *c_avg,*dcjs, Beta_inf2, c2js_Re, c3js_Re, cOutjs_Re, avgVel2 =0.0; long freq; @@ -8233,7 +8235,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con unsigned long iVertex, iPoint; su2double *V_inlet, *V_domain; - su2double Density, Pressure, Temperature, Energy, *Vel, Velocity2; + su2double Density, Energy, Velocity2; su2double Gas_Constant = config->GetGas_ConstantND(); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); @@ -8246,9 +8248,9 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con so all flow variables can be imposed at the inlet. First, retrieve the specified values for the primitive variables. ---*/ - Temperature = config->GetInlet_Temperature(Marker_Tag); - Pressure = config->GetInlet_Pressure(Marker_Tag); - Vel = config->GetInlet_Velocity(Marker_Tag); + auto Temperature = config->GetInlet_Temperature(Marker_Tag); + auto Pressure = config->GetInlet_Pressure(Marker_Tag); + auto Vel = config->GetInlet_Velocity(Marker_Tag); /*--- Non-dim. the inputs if necessary. ---*/ @@ -10202,7 +10204,7 @@ void CEulerSolver::SetFreeStream_TurboSolution(CConfig *config) { unsigned long iPoint; unsigned short iDim; unsigned short iZone = config->GetiZone(); - su2double *turboVelocity, *cartVelocity, *turboNormal; + su2double *turboVelocity, *cartVelocity; su2double Alpha = config->GetAoA()*PI_NUMBER/180.0; su2double Mach = config->GetMach(); @@ -10211,7 +10213,7 @@ void CEulerSolver::SetFreeStream_TurboSolution(CConfig *config) { turboVelocity = new su2double[nDim]; cartVelocity = new su2double[nDim]; - turboNormal = config->GetFreeStreamTurboNormal(); + auto turboNormal = config->GetFreeStreamTurboNormal(); GetFluidModel()->SetTDState_Prho(Pressure_Inf, Density_Inf); SoundSpeed = GetFluidModel()->GetSoundSpeed(); diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index d09225cf6850..c25fcd582ebd 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -1329,9 +1329,12 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const bool topology_mode = config->GetTopology_Optimization(); const auto simp_exponent = config->GetSIMP_Exponent(); + const auto stressParam = config->GetStressPenaltyParam(); + const su2double stress_scale = 1.0 / stressParam[0]; + const su2double ks_mult = stressParam[1]; + const unsigned short nStress = (nDim == 2) ? 3 : 6; - const su2double stressScale = 1.0 / config->GetAllowedVMStress(); su2double StressPenalty = 0.0; su2double MaxVonMises_Stress = 0.0; @@ -1412,7 +1415,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, auto elStress = numerics[NUM_TERM]->Compute_Averaged_NodalStress(element, config); - stressPen += pow(max(0.0, elStress*simp_penalty*stressScale - 1.0), 2); + stressPen += exp(ks_mult * elStress*simp_penalty*stress_scale); wasActive = AD::BeginPassive(); @@ -1469,6 +1472,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, /*--- Reduce the stress penalty over all ranks ---*/ SU2_MPI::Allreduce(&StressPenalty, &Total_OFStressPenalty, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + Total_OFStressPenalty = log(Total_OFStressPenalty)/ks_mult - 1.0; bool outputReactions = false; diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index d923e4fadf89..df70ceb8dc43 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -7721,7 +7721,7 @@ void CFEM_DG_EulerSolver::BoundaryStates_Riemann(CConfig *confi pressure and temperature as well as the flow direction. */ su2double P_Total = config->GetRiemann_Var1(Marker_Tag); su2double T_Total = config->GetRiemann_Var2(Marker_Tag); - su2double *Flow_Dir = config->GetRiemann_FlowDir(Marker_Tag); + auto Flow_Dir = config->GetRiemann_FlowDir(Marker_Tag); P_Total /= config->GetPressure_Ref(); T_Total /= config->GetTemperature_Ref(); @@ -7782,7 +7782,7 @@ void CFEM_DG_EulerSolver::BoundaryStates_Riemann(CConfig *confi temperature as well as the three components of the Mach number. */ su2double P_static = config->GetRiemann_Var1(Marker_Tag); su2double T_static = config->GetRiemann_Var2(Marker_Tag); - su2double *Mach = config->GetRiemann_FlowDir(Marker_Tag); + auto Mach = config->GetRiemann_FlowDir(Marker_Tag); P_static /= config->GetPressure_Ref(); T_static /= config->GetTemperature_Ref(); @@ -7833,7 +7833,7 @@ void CFEM_DG_EulerSolver::BoundaryStates_Riemann(CConfig *confi temperature as well as the three components of the Mach number. */ su2double P_static = config->GetRiemann_Var1(Marker_Tag); su2double Rho_static = config->GetRiemann_Var2(Marker_Tag); - su2double *Mach = config->GetRiemann_FlowDir(Marker_Tag); + auto Mach = config->GetRiemann_FlowDir(Marker_Tag); P_static /= config->GetPressure_Ref(); Rho_static /= config->GetDensity_Ref(); @@ -7883,7 +7883,7 @@ void CFEM_DG_EulerSolver::BoundaryStates_Riemann(CConfig *confi flow direction. Retrieve the non-dimensional data. */ su2double Density_e = config->GetRiemann_Var1(Marker_Tag); su2double VelMag_e = config->GetRiemann_Var2(Marker_Tag); - su2double *Flow_Dir = config->GetRiemann_FlowDir(Marker_Tag); + auto Flow_Dir = config->GetRiemann_FlowDir(Marker_Tag); Density_e /= config->GetDensity_Ref(); VelMag_e /= config->GetVelocity_Ref(); diff --git a/SU2_PY/SU2/io/historyMap.py b/SU2_PY/SU2/io/historyMap.py index 157218eaeaaf..f809b9a426dc 100644 --- a/SU2_PY/SU2/io/historyMap.py +++ b/SU2_PY/SU2/io/historyMap.py @@ -374,6 +374,10 @@ 'GROUP': 'D_ENGINE_OUTPUT', 'HEADER': 'd[SolidCDrag]', 'TYPE': 'D_COEFFICIENT'}, + 'D_STRESS_PENALTY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_STRUCT_COEFF', + 'HEADER': 'd[StressPen]', + 'TYPE': 'D_COEFFICIENT'}, 'D_SURFACE_MACH': {'DESCRIPTION': 'Derivative value', 'GROUP': 'D_FLOW_COEFF', 'HEADER': 'd[Avg_Mach]', @@ -868,6 +872,10 @@ 'GROUP': 'ENGINE_OUTPUT', 'HEADER': 'SolidCDrag', 'TYPE': 'COEFFICIENT'}, + 'STRESS_PENALTY': {'DESCRIPTION': '', + 'GROUP': 'STRUCT_COEFF', + 'HEADER': 'StressPen', + 'TYPE': 'COEFFICIENT'}, 'SURFACE_MACH': {'DESCRIPTION': 'Total average mach number on all markers set ' 'in MARKER_ANALYZE', 'GROUP': 'FLOW_COEFF', @@ -1114,6 +1122,11 @@ 'GROUP': 'TAVG_D_ENGINE_OUTPUT', 'HEADER': 'dtavg[SolidCDrag]', 'TYPE': 'TAVG_D_COEFFICIENT'}, + 'TAVG_D_STRESS_PENALTY': {'DESCRIPTION': 'weighted time average derivative ' + 'value', + 'GROUP': 'TAVG_D_STRUCT_COEFF', + 'HEADER': 'dtavg[StressPen]', + 'TYPE': 'TAVG_D_COEFFICIENT'}, 'TAVG_D_SURFACE_MACH': {'DESCRIPTION': 'weighted time average derivative ' 'value', 'GROUP': 'TAVG_D_FLOW_COEFF', @@ -1293,6 +1306,10 @@ 'GROUP': 'TAVG_ENGINE_OUTPUT', 'HEADER': 'tavg[SolidCDrag]', 'TYPE': 'TAVG_COEFFICIENT'}, + 'TAVG_STRESS_PENALTY': {'DESCRIPTION': 'weighted time average value', + 'GROUP': 'TAVG_STRUCT_COEFF', + 'HEADER': 'tavg[StressPen]', + 'TYPE': 'TAVG_COEFFICIENT'}, 'TAVG_SURFACE_MACH': {'DESCRIPTION': 'weighted time average value', 'GROUP': 'TAVG_FLOW_COEFF', 'HEADER': 'tavg[Avg_Mach]', diff --git a/TestCases/fea_topology/config.cfg b/TestCases/fea_topology/config.cfg index ec6229018ba0..94c1e956f3f8 100644 --- a/TestCases/fea_topology/config.cfg +++ b/TestCases/fea_topology/config.cfg @@ -50,12 +50,16 @@ TOPOL_OPTIM_OUTFILE= grad_ref_node.dat % - VOLUME_FRACTION: Volume average of rho, 1 means totally solid; % - TOPOL_DISCRETENESS: Volume average of 4*rho*(1-rho), % 0 means perfect solid-void topology. +% - STRESS_PENALTY: KS-aggregated maximum element-average VM stress, +% use it as a <= 0 constraint. % REFERENCE_NODE can be used in lieu of compliance for simple load cases. OBJECTIVE_FUNCTION= REFERENCE_NODE REFERENCE_NODE= 5225 REFERENCE_NODE_DISPLACEMENT= (0.0, 0.0) REFERENCE_NODE_PENALTY= 1.0 DESIGN_VARIABLE_FEA= YOUNG_MODULUS +% Parameters for the corresponding OF (allowed stress and KS multiplier). +STRESS_PENALTY_PARAM= (1.0, 10.0) % ITER=1 % From aa3fa3f05013bc6ae62dcab425239edd71dfc833 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 22 Jan 2021 18:29:22 +0000 Subject: [PATCH 137/326] remove more SU2_MSH --- Common/include/CConfig.hpp | 53 +-------------- Common/include/option_structure.hpp | 35 ---------- Common/src/CConfig.cpp | 100 ++-------------------------- SU2_CFD/src/output/CFlowOutput.cpp | 4 +- 4 files changed, 8 insertions(+), 184 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 0ea1ffc0c9e7..3985d25e88ab 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -109,6 +109,7 @@ 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. */ @@ -123,8 +124,6 @@ class CConfig { Low_Mach_Precon, /*!< \brief Flag to know if we are using a low Mach number preconditioner. */ Low_Mach_Corr, /*!< \brief Flag to know if we are using a low Mach number correction. */ GravityForce, /*!< \brief Flag to know if the gravity force is incuded in the formulation. */ - SmoothNumGrid, /*!< \brief Smooth the numerical grid. */ - AdaptBoundary, /*!< \brief Adapt the elements on the boundary. */ SubsonicEngine, /*!< \brief Engine intake subsonic region. */ Frozen_Visc_Cont, /*!< \brief Flag for cont. adjoint problem with/without frozen viscosity. */ Frozen_Visc_Disc, /*!< \brief Flag for disc. adjoint problem with/without frozen viscosity. */ @@ -167,10 +166,8 @@ class CConfig { unsigned short Continuous_Eqns; /*!< \brief Which equations to treat continuously (Hybrid adjoint)*/ unsigned short Discrete_Eqns; /*!< \brief Which equations to treat discretely (Hybrid adjoint). */ unsigned short *Design_Variable; /*!< \brief Kind of design variable. */ - unsigned short Kind_Adaptation; /*!< \brief Kind of numerical grid adaptation. */ unsigned short nTimeInstances; /*!< \brief Number of periodic time instances for harmonic balance. */ su2double HarmonicBalance_Period; /*!< \brief Period of oscillation to be used with harmonic balance computations. */ - su2double New_Elem_Adapt; /*!< \brief Elements to adapt in the numerical grid adaptation process. */ su2double Delta_UnstTime, /*!< \brief Time step for unsteady computations. */ Delta_UnstTimeND; /*!< \brief Time step for unsteady computations (non dimensional). */ su2double Delta_DynTime, /*!< \brief Time step for dynamic structural computations. */ @@ -712,9 +709,7 @@ class CConfig { *Marker_CfgFile_DV, /*!< \brief Global index for design variable markers using the config information. */ *Marker_CfgFile_PerBound; /*!< \brief Global index for periodic boundaries using the config information. */ string *PlaneTag; /*!< \brief Global index for the plane adaptation (upper, lower). */ - su2double DualVol_Power; /*!< \brief Power for the dual volume in the grid adaptation sensor. */ su2double *nBlades; /*!< \brief number of blades for turbomachinery computation. */ - unsigned short Analytical_Surface; /*!< \brief Information about the analytical definition of the surface for grid adaptation. */ unsigned short Geo_Description; /*!< \brief Description of the geometry. */ unsigned short Mesh_FileFormat; /*!< \brief Mesh input format. */ unsigned short Tab_FileFormat; /*!< \brief Format of the output files. */ @@ -1458,20 +1453,6 @@ class CConfig { */ const su2double *GetDistortionRack(void) const { return distortion; } - /*! - * \brief Get the power of the dual volume in the grid adaptation sensor. - * \return Power of the dual volume in the grid adaptation sensor. - */ - su2double GetDualVol_Power(void) const { return DualVol_Power; } - - /*! - * \brief Get Information about if there is an analytical definition of the surface for doing the - * grid adaptation. - * \return Definition of the surfaces. NONE implies that there isn't any analytical definition - * and it will use and interpolation. - */ - unsigned short GetAnalytical_Surface(void) const { return Analytical_Surface; } - /*! * \brief Get Description of the geometry to be analyzed */ @@ -4157,18 +4138,6 @@ class CConfig { */ unsigned short GetKind_SGS_Model(void) const { return Kind_SGS_Model; } - /*! - * \brief Get the kind of adaptation technique. - * \return Kind of adaptation technique. - */ - unsigned short GetKind_Adaptation(void) const { return Kind_Adaptation; } - - /*! - * \brief Get the number of new elements added in the adaptation process. - * \return percentage of new elements that are going to be added in the adaptation. - */ - su2double GetNew_Elem_Adapt(void) const { return New_Elem_Adapt; } - /*! * \brief Get the kind of time integration method. * \note This is the information that the code will use, the method will @@ -5794,29 +5763,11 @@ class CConfig { */ bool GetAxisymmetric(void) const { return Axisymmetric; } - /*! - * \brief Get information about the axisymmetric frame. - * \return TRUE if there is a rotational frame; otherwise FALSE. - */ - bool GetDebugMode(void); - - /*! - * \brief Get information about there is a smoothing of the grid coordinates. - * \return TRUE if there is smoothing of the grid coordinates; otherwise FALSE. - */ - bool GetAdaptBoundary(void) const { return AdaptBoundary; } - /*! * \brief Get information about there is a smoothing of the grid coordinates. * \return TRUE if there is smoothing of the grid coordinates; otherwise FALSE. */ - bool GetSmoothNumGrid(void) const { return SmoothNumGrid; } - - /*! - * \brief Set information about there is a smoothing of the grid coordinates. - * \param[in] val_smoothnumgrid - TRUE if there is smoothing of the grid coordinates; otherwise FALSE. - */ - void SetSmoothNumGrid(bool val_smoothnumgrid) { SmoothNumGrid = val_smoothnumgrid; } + unsigned short GetSmoothNumGrid(void) const { return SmoothNumGrid; } /*! * \brief Subtract one to the index of the finest grid (full multigrid strategy). diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 647c5f58b3fc..7c9b5df7a6a2 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -67,7 +67,6 @@ enum SU2_COMPONENT { SU2_CFD = 1, /*!< \brief Running the SU2_CFD software. */ SU2_DEF = 2, /*!< \brief Running the SU2_DEF software. */ SU2_DOT = 3, /*!< \brief Running the SU2_DOT software. */ - SU2_MSH = 4, /*!< \brief Running the SU2_MSH software. */ SU2_GEO = 5, /*!< \brief Running the SU2_GEO software. */ SU2_SOL = 6 /*!< \brief Running the SU2_SOL software. */ }; @@ -1619,40 +1618,6 @@ static const MapType Sens_Map = { MakePair("SENS_AOS", SENS_AOS) }; -/*! - * \brief Types of grid adaptation/refinement - */ -enum ENUM_ADAPT { - NO_ADAPT = 0, /*!< \brief No grid adaptation. */ - FULL = 1, /*!< \brief Do a complete grid refinement of all the computational grids. */ - FULL_FLOW = 2, /*!< \brief Do a complete grid refinement of the flow grid. */ - FULL_ADJOINT = 3, /*!< \brief Do a complete grid refinement of the adjoint grid. */ - GRAD_FLOW = 5, /*!< \brief Do a gradient based grid adaptation of the flow grid. */ - GRAD_ADJOINT = 6, /*!< \brief Do a gradient based grid adaptation of the adjoint grid. */ - GRAD_FLOW_ADJ = 7, /*!< \brief Do a gradient based grid adaptation of the flow and adjoint grid. */ - COMPUTABLE = 9, /*!< \brief Apply a computable error grid adaptation. */ - REMAINING = 10, /*!< \brief Apply a remaining error grid adaptation. */ - WAKE = 12, /*!< \brief Do a grid refinement on the wake. */ - SMOOTHING = 14, /*!< \brief Do a grid smoothing of the geometry. */ - SUPERSONIC_SHOCK = 15, /*!< \brief Do a grid smoothing. */ - PERIODIC = 17 /*!< \brief Add the periodic halo cells. */ -}; -static const MapType Adapt_Map = { - MakePair("NONE", NO_ADAPT) - MakePair("FULL", FULL) - MakePair("FULL_FLOW", FULL_FLOW) - MakePair("FULL_ADJOINT", FULL_ADJOINT) - MakePair("GRAD_FLOW", GRAD_FLOW) - MakePair("GRAD_ADJOINT", GRAD_ADJOINT) - MakePair("GRAD_FLOW_ADJ", GRAD_FLOW_ADJ) - MakePair("COMPUTABLE", COMPUTABLE) - MakePair("REMAINING", REMAINING) - MakePair("WAKE", WAKE) - MakePair("SMOOTHING", SMOOTHING) - MakePair("SUPERSONIC_SHOCK", SUPERSONIC_SHOCK) - MakePair("PERIODIC", PERIODIC) -}; - /*! * \brief Types of input file formats */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 405b6f6e26b6..5d28ae540a90 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1375,7 +1375,7 @@ void CConfig::SetConfig_Options() { addStringListOption("MARKER_INTERNAL", nMarker_Internal, Marker_Internal); /* DESCRIPTION: Custom boundary marker(s) */ addStringListOption("MARKER_CUSTOM", nMarker_Custom, Marker_Custom); - /* DESCRIPTION: Periodic boundary marker(s) for use with SU2_MSH + /* DESCRIPTION: Periodic boundary marker(s) Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) */ @@ -1393,10 +1393,7 @@ void CConfig::SetConfig_Options() { /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n Default: VARIABLES_JUMP \ingroup Config*/ addEnumOption("ACTDISK_TYPE", Kind_ActDisk, ActDisk_Map, VARIABLES_JUMP); - /*!\brief MARKER_ACTDISK\n DESCRIPTION: Periodic boundary marker(s) for use with SU2_MSH - Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, - rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, - rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) \ingroup Config*/ + /*!\brief MARKER_ACTDISK\n DESCRIPTION: \ingroup Config*/ addActDiskOption("MARKER_ACTDISK", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); @@ -2032,21 +2029,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Value to move motion origins (1 or 0) */ addUShortListOption("MOVE_MOTION_ORIGIN", nMoveMotion_Origin, MoveMotion_Origin); - /*!\par CONFIG_CATEGORY: Grid adaptation \ingroup Config*/ - /*--- Options related to grid adaptation ---*/ - - /* DESCRIPTION: Kind of grid adaptation */ - addEnumOption("KIND_ADAPT", Kind_Adaptation, Adapt_Map, NO_ADAPT); - /* DESCRIPTION: Percentage of new elements (% of the original number of elements) */ - addDoubleOption("NEW_ELEMS", New_Elem_Adapt, -1.0); - /* DESCRIPTION: Scale factor for the dual volume */ - addDoubleOption("DUALVOL_POWER", DualVol_Power, 0.5); - /* DESCRIPTION: Use analytical definition for surfaces */ - addEnumOption("ANALYTICAL_SURFDEF", Analytical_Surface, Geo_Analytic_Map, NO_GEO_ANALYTIC); /* DESCRIPTION: Before each computation, implicitly smooth the nodal coordinates */ - addBoolOption("SMOOTH_GEOMETRY", SmoothNumGrid, false); - /* DESCRIPTION: Adapt the boundary elements */ - addBoolOption("ADAPT_BOUNDARY", AdaptBoundary, true); + 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) ---*/ @@ -3038,7 +3022,6 @@ void CConfig::SetHeader(unsigned short val_software) const{ case SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break; case SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |" << endl; break; case SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |" << endl; break; - case SU2_MSH: cout << "| |___/\\___//___| Suite (Mesh Adaptation Code) |" << endl; break; case SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |" << endl; break; case SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |" << endl; break; } @@ -4758,16 +4741,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_ConductivityModel_Turb = NO_CONDUCTIVITY_TURB; } - /*--- Check for running SU2_MSH for periodic preprocessing, and throw - an error to report that this is no longer necessary. ---*/ - - if ((Kind_SU2 == SU2_MSH) && - (Kind_Adaptation == PERIODIC)) { - SU2_MPI::Error(string("For SU2 v7.0.0 and later, preprocessing of periodic grids by SU2_MSH\n") + - string("is no longer necessary. Please use the original mesh file (prior to SU2_MSH)\n") + - string("with the same MARKER_PERIODIC definition in the configuration file.") , CURRENT_FUNCTION); - } - /* Set a default for the size of the RECTANGLE / BOX grid sizes. */ if (nMesh_Box_Size == 0) { @@ -4980,8 +4953,7 @@ void CConfig::SetMarkers(unsigned short val_software) { int size = SINGLE_NODE; #ifdef HAVE_MPI - if (val_software != SU2_MSH) - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); #endif /*--- Compute the total number of markers in the config file ---*/ @@ -5785,23 +5757,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (val_software == SU2_MSH) { - switch (Kind_Adaptation) { - case FULL: case WAKE: case FULL_FLOW: case FULL_ADJOINT: case SMOOTHING: case SUPERSONIC_SHOCK: - break; - case GRAD_FLOW: - cout << "Read flow solution from: " << Solution_FileName << "." << endl; - break; - case GRAD_ADJOINT: - cout << "Read adjoint flow solution from: " << Solution_AdjFileName << "." << endl; - break; - case GRAD_FLOW_ADJ: case COMPUTABLE: case REMAINING: - cout << "Read flow solution from: " << Solution_FileName << "." << endl; - cout << "Read adjoint flow solution from: " << Solution_AdjFileName << "." << endl; - break; - } - } - if (val_software == SU2_DEF) { cout << endl <<"---------------- Grid deformation parameters ( Zone " << iZone << " ) ----------------" << endl; cout << "Grid deformation using a linear elasticity method." << endl; @@ -6580,37 +6535,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (val_software == SU2_MSH) { - cout << endl <<"----------------- Grid adaptation strategy ( Zone " << iZone << " ) -------------------" << endl; - - switch (Kind_Adaptation) { - case NONE: break; - case PERIODIC: cout << "Grid modification to run periodic bc problems." << endl; break; - case FULL: cout << "Grid adaptation using a complete refinement." << endl; break; - case WAKE: cout << "Grid adaptation of the wake." << endl; break; - case FULL_FLOW: cout << "Flow grid adaptation using a complete refinement." << endl; break; - case FULL_ADJOINT: cout << "Adjoint grid adaptation using a complete refinement." << endl; break; - case GRAD_FLOW: cout << "Grid adaptation using gradient based strategy (density)." << endl; break; - case GRAD_ADJOINT: cout << "Grid adaptation using gradient based strategy (adjoint density)." << endl; break; - case GRAD_FLOW_ADJ: cout << "Grid adaptation using gradient based strategy (density and adjoint density)." << endl; break; - case COMPUTABLE: cout << "Grid adaptation using computable correction."<< endl; break; - case REMAINING: cout << "Grid adaptation using remaining error."<< endl; break; - case SMOOTHING: cout << "Grid smoothing using an implicit method."<< endl; break; - case SUPERSONIC_SHOCK: cout << "Grid adaptation for a supersonic shock at Mach: " << Mach <<"."<< endl; break; - } - - switch (Kind_Adaptation) { - case GRAD_FLOW: case GRAD_ADJOINT: case GRAD_FLOW_ADJ: case COMPUTABLE: case REMAINING: - cout << "Power of the dual volume in the adaptation sensor: " << DualVol_Power << endl; - cout << "Percentage of new elements in the adaptation process: " << New_Elem_Adapt << "."<< endl; - break; - } - - if (Analytical_Surface != NONE) - cout << "Use analytical definition for including points in the surfaces." << endl; - - } - cout << endl <<"-------------------- Output Information ( Zone " << iZone << " ) ----------------------" << endl; if (val_software == SU2_CFD) { @@ -6679,10 +6603,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (val_software == SU2_MSH) { - cout << "Output mesh file name: " << Mesh_Out_FileName << ". " << endl; - } - if (val_software == SU2_DOT) { if (DiscreteAdjoint) { cout << "Output Volume Sensitivity file name: " << VolSens_FileName << ". " << endl; @@ -6691,18 +6611,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << "Output gradient file name: " << ObjFunc_Grad_FileName << ". " << endl; } - if (val_software == SU2_MSH) { - cout << "Output mesh file name: " << Mesh_Out_FileName << ". " << endl; - cout << "Restart flow file name: " << Restart_FileName << "." << endl; - if ((Kind_Adaptation == FULL_ADJOINT) || (Kind_Adaptation == GRAD_ADJOINT) || (Kind_Adaptation == GRAD_FLOW_ADJ) || - (Kind_Adaptation == COMPUTABLE) || (Kind_Adaptation == REMAINING)) { - if (Kind_ObjFunc[0] == DRAG_COEFFICIENT) cout << "Restart adjoint file name: " << Restart_AdjFileName << "." << endl; - if (Kind_ObjFunc[0] == EQUIVALENT_AREA) cout << "Restart adjoint file name: " << Restart_AdjFileName << "." << endl; - if (Kind_ObjFunc[0] == NEARFIELD_PRESSURE) cout << "Restart adjoint file name: " << Restart_AdjFileName << "." << endl; - if (Kind_ObjFunc[0] == LIFT_COEFFICIENT) cout << "Restart adjoint file name: " << Restart_AdjFileName << "." << endl; - } - } - cout << endl <<"------------- Config File Boundary Information ( Zone " << iZone << " ) ---------------" << endl; PrintingToolbox::CTablePrinter BoundaryTable(&std::cout); diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index e7c82a93efbb..f246dd84231e 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -559,14 +559,14 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi SetHistoryOutputValue("SURFACE_STATIC_PRESSURE", Tot_Surface_Pressure); SetHistoryOutputValue("AVG_DENSITY", Tot_Surface_Density); SetHistoryOutputValue("AVG_ENTHALPY", Tot_Surface_Enthalpy); - SetHistoryOutputValue("AVG_NORMALVEL", Tot_Surface_Enthalpy); + SetHistoryOutputValue("AVG_NORMALVEL", Tot_Surface_NormalVelocity); SetHistoryOutputValue("SURFACE_UNIFORMITY", Tot_Surface_StreamVelocity2); SetHistoryOutputValue("SURFACE_SECONDARY", Tot_Surface_TransvVelocity2); SetHistoryOutputValue("SURFACE_MOM_DISTORTION", Tot_Momentum_Distortion); SetHistoryOutputValue("SURFACE_SECOND_OVER_UNIFORM", Tot_SecondOverUniformity); SetHistoryOutputValue("SURFACE_TOTAL_TEMPERATURE", Tot_Surface_TotalTemperature); SetHistoryOutputValue("SURFACE_TOTAL_PRESSURE", Tot_Surface_TotalPressure); - SetHistoryOutputValue("SURFACE_PRESSURE_DROP", Tot_Surface_PressureDrop); + SetHistoryOutputValue("SURFACE_PRESSURE_DROP", Tot_Surface_PressureDrop); if ((rank == MASTER_NODE) && !config->GetDiscrete_Adjoint() && output) { From b7b731a8971dd940dc870f12e4468e037c708e46 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 22 Jan 2021 19:15:20 +0000 Subject: [PATCH 138/326] gauss average instead of nodal (same, but different) --- .../elasticity/CFEALinearElasticity.cpp | 16 ++++++---------- .../elasticity/CFEANonlinearElasticity.cpp | 18 +++++++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index 426200f4b598..199be05e382a 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -239,8 +239,7 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, unsigned short iNode, nNode; unsigned short iDim, bDim; - /*--- Auxiliary vector ---*/ - su2double Strain[DIM_STRAIN_3D], Stress[DIM_STRAIN_3D], avgStress[DIM_STRAIN_3D] = {0.0}; + su2double avgStress[DIM_STRAIN_3D] = {0.0}; /*--- Set element properties and recompute the constitutive matrix, this is needed for multiple material cases and for correct differentiation ---*/ @@ -282,9 +281,7 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, } } - for (iVar = 0; iVar < bDim; iVar++) { - Strain[iVar] = 0.0; - } + su2double Strain[DIM_STRAIN_3D] = {0.0}; for (iNode = 0; iNode < nNode; iNode++) { @@ -319,11 +316,13 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, /*--- Compute the Stress Vector as D*epsilon ---*/ + su2double Stress[DIM_STRAIN_3D] = {0.0}; + for (iVar = 0; iVar < bDim; iVar++) { - Stress[iVar] = 0.0; for (jVar = 0; jVar < bDim; jVar++) { Stress[iVar] += D_Mat[iVar][jVar]*Strain[jVar]; } + avgStress[iVar] += Stress[iVar] / nGauss; } for (iNode = 0; iNode < nNode; iNode++) { @@ -348,10 +347,7 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, } - for (unsigned short iStress = 0; iStress < bDim; ++iStress) - for (iNode = 0; iNode < nNode; iNode++) - avgStress[iStress] += element->Get_NodalStress(iNode, iStress) / nNode; - + if (nDim == 3) std::swap(avgStress[2], avgStress[3]); auto elStress = VonMisesStress(nDim, avgStress); /*--- We only differentiate w.r.t. an avg VM stress for the element as diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index 2dd97a983287..45f65f568fe8 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -747,6 +747,8 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen unsigned short iGauss, nGauss; unsigned short iDim, iNode, nNode; + su2double avgStress[DIM_STRAIN_3D] = {0.0}; + /*--- TODO: Initialize values for the material model considered ---*/ SetElement_Properties(element, config); if (maxwell_stress) SetElectric_Properties(element, config); @@ -848,6 +850,15 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen Compute_Stress_Tensor(element, config); if (maxwell_stress) Add_MaxwellStress(element, config); + avgStress[0] += Stress_Tensor[0][0] / nGauss; + avgStress[1] += Stress_Tensor[1][1] / nGauss; + avgStress[2] += Stress_Tensor[0][1] / nGauss; + if (nDim == 3) { + avgStress[3] += Stress_Tensor[2][2] / nGauss; + avgStress[4] += Stress_Tensor[0][2] / nGauss; + avgStress[5] += Stress_Tensor[1][2] / nGauss; + } + for (iNode = 0; iNode < nNode; iNode++) { /*--- Compute the nodal stress term for each gaussian point and for each node, ---*/ @@ -879,13 +890,6 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen } - su2double avgStress[DIM_STRAIN_3D] = {0.0}; - const auto nStress = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - - for (unsigned short iStress = 0; iStress < nStress; ++iStress) - for (iNode = 0; iNode < nNode; iNode++) - avgStress[iStress] += element->Get_NodalStress(iNode, iStress) / nNode; - auto elStress = VonMisesStress(nDim, avgStress); /*--- We only differentiate w.r.t. an avg VM stress for the element as From 9d077df69bef2cf468d285534603ade403d99856 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 22 Jan 2021 20:28:45 +0000 Subject: [PATCH 139/326] fix p1 case --- TestCases/radiation/p1model/configp1.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/TestCases/radiation/p1model/configp1.cfg b/TestCases/radiation/p1model/configp1.cfg index 1388199e00d2..b5a60a0ffccd 100644 --- a/TestCases/radiation/p1model/configp1.cfg +++ b/TestCases/radiation/p1model/configp1.cfg @@ -23,6 +23,7 @@ INC_DENSITY_MODEL= VARIABLE INC_ENERGY_EQUATION = YES INC_DENSITY_INIT= 0.00597782417156 INC_TEMPERATURE_INIT= 288.15 +INC_VELOCITY_INIT= (0, 0, 0) INC_NONDIM = DIMENSIONAL FLUID_MODEL= INC_IDEAL_GAS From d39ec8efd61f9a36d3b4f63723af63a3fbccf8e9 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 22 Jan 2021 22:08:05 +0000 Subject: [PATCH 140/326] remove deprecated options from testcases --- .../cont_adj_rans/naca0012/turb_nasa.cfg | 19 ------------------- .../naca0012/turb_nasa_binary.cfg | 18 ------------------ .../disc_adj_euler/arina2k/Arina2KRS.cfg | 17 ----------------- .../transonic_stator_2D/transonic_stator.cfg | 6 ------ .../poiseuille/lam_poiseuille.cfg | 3 --- .../poiseuille/profile_poiseuille.cfg | 3 --- .../centrifugal_blade/centrifugal_blade.cfg | 9 --------- .../centrifugal_stage/centrifugal_stage.cfg | 10 ---------- 8 files changed, 85 deletions(-) diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg index d0a39d3dc852..d9964fc5fb2b 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg @@ -257,25 +257,6 @@ CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence CONV_CAUCHY_EPS= 1E-6 -% - -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Percentage of new elements (% of the original number of elements) -NEW_ELEMS= 5 -% -% Kind of grid adaptation (NONE, FULL, FULL_FLOW, GRAD_FLOW, FULL_ADJOINT, -% GRAD_ADJOINT, GRAD_FLOW_ADJ, ROBUST, -% FULL_LINEAR, COMPUTABLE, COMPUTABLE_ROBUST, -% REMAINING, WAKE, SMOOTHING, SUPERSONIC_SHOCK, -% TWOPHASE) -KIND_ADAPT= FULL_FLOW -% -% Scale factor for the dual volume -DUALVOL_POWER= 0.5 -% -% Before each computation do an implicit smoothing of the nodes coord (NO, YES) -SMOOTH_GEOMETRY= NO % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg index 662e2cda6248..66be5e33e56a 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg @@ -259,24 +259,6 @@ CONV_CAUCHY_ELEMS= 100 CONV_CAUCHY_EPS= 1E-6 % -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Percentage of new elements (% of the original number of elements) -NEW_ELEMS= 5 -% -% Kind of grid adaptation (NONE, FULL, FULL_FLOW, GRAD_FLOW, FULL_ADJOINT, -% GRAD_ADJOINT, GRAD_FLOW_ADJ, ROBUST, -% FULL_LINEAR, COMPUTABLE, COMPUTABLE_ROBUST, -% REMAINING, WAKE, SMOOTHING, SUPERSONIC_SHOCK, -% TWOPHASE) -KIND_ADAPT= FULL_FLOW -% -% Scale factor for the dual volume -DUALVOL_POWER= 0.5 -% -% Before each computation do an implicit smoothing of the nodes coord (NO, YES) -SMOOTH_GEOMETRY= NO - % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file diff --git a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg index 085f32cd7872..501f16e9429b 100644 --- a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg +++ b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg @@ -376,23 +376,6 @@ GEO_PLOT_STATIONS= NO % Geometrical evaluation mode (FUNCTION, GRADIENT) GEO_MODE= FUNCTION -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Kind of grid adaptation (NONE, PERIODIC, FULL, FULL_FLOW, GRAD_FLOW, -% FULL_ADJOINT, GRAD_ADJOINT, GRAD_FLOW_ADJ, ROBUST, -% FULL_LINEAR, COMPUTABLE, COMPUTABLE_ROBUST, -% REMAINING, WAKE, SMOOTHING, SUPERSONIC_SHOCK) -KIND_ADAPT= FULL_FLOW -% -% Percentage of new elements (% of the original number of elements) -NEW_ELEMS= 5 -% -% Scale factor for the dual volume -DUALVOL_POWER= 0.5 -% -% Adapt the boundary elements (NO, YES) -ADAPT_BOUNDARY= YES - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, diff --git a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg index 6e9e98762bdc..e354059f006b 100644 --- a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -187,12 +187,6 @@ MARKER_PLOTTING= (airfoil) MARKER_MONITORING= (airfoil) % % -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Kind of grid adaptation (NONE, PERIODIC) -KIND_ADAPT= PERIODIC -% -% % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % % Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index 554104dd03ba..01d165056d02 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -130,9 +130,6 @@ MARKER_PLOTTING= ( lower ) % % Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( left, right ) -% -% Kind of adaptation (needed to create the initial periodic mesh) -KIND_ADAPT= PERIODIC % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg index e1704782600f..d91ca807083d 100644 --- a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg @@ -141,9 +141,6 @@ MARKER_PLOTTING= ( upper ) % % Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( left, right ) -% -% Kind of adaptation (needed to create the initial periodic mesh) -KIND_ADAPT= PERIODIC % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg index e33415dc7eca..caa0b59ec86d 100755 --- a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg +++ b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg @@ -157,15 +157,6 @@ MARKER_PLOTTING= ( wall1, wall2 ) MARKER_TURBO_PERFORMANCE= (inflow, outflow, BLADE) % % -% -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Kind of grid adaptation (NONE, PERIODIC) -KIND_ADAPT= PERIODIC -% -% -% -% % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Dynamic mesh simulation (NO, YES) diff --git a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg index 40d7b49f8a36..bb572ed5c13c 100755 --- a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg +++ b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg @@ -163,16 +163,6 @@ MARKER_MONITORING= ( wall1, wall2 ) MARKER_TURBO_PERFORMANCE= (inflow, outflow, STAGE, inflow, outmix, BLADE, inmix, outflow, BLADE) % % -% -% -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Kind of grid adaptation (NONE, PERIODIC) -KIND_ADAPT= PERIODIC -% -% -% -% % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Dynamic mesh simulation (NO, YES) From 3351a16d1138a1dbd2354f17d9cf969a27891cbd Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 00:51:57 +0000 Subject: [PATCH 141/326] avoid duplication of SetTime_Step across the 3 flow solvers --- SU2_CFD/include/solvers/CEulerSolver.hpp | 3 - .../include/solvers/CFVMFlowSolverBase.hpp | 260 +++++++++++++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CIncNSSolver.hpp | 14 - SU2_CFD/src/solvers/CEulerSolver.cpp | 268 ++--------------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 219 +++----------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 233 --------------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 269 +++--------------- 8 files changed, 356 insertions(+), 912 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 2c8efec9691c..1b2acaa17a73 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -116,9 +116,6 @@ class CEulerSolver : public CFVMFlowSolverBase { unsigned long ErrorCounter = 0; /*!< \brief Counter for number of un-physical states. */ - su2double Global_Delta_Time = 0.0, /*!< \brief Time-step for TIME_STEPPING time marching strategy. */ - Global_Delta_UnstTimeND = 0.0; /*!< \brief Unsteady time step for the dual time strategy. */ - /*--- Turbomachinery Solver Variables ---*/ su2double ***AverageFlux = nullptr, diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 75492c114085..da83d1aa741f 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -56,6 +56,9 @@ class CFVMFlowSolverBase : public CSolver { su2double StrainMag_Max; /*!< \brief Maximum Strain Rate magnitude. */ su2double Omega_Max; /*!< \brief Maximum Omega. */ + su2double Global_Delta_Time = 0.0, /*!< \brief Time-step for TIME_STEPPING time marching strategy. */ + Global_Delta_UnstTimeND = 0.0; /*!< \brief Unsteady time step for the dual time strategy. */ + /*! * \brief Auxilary types to store common aero coefficients (avoids repeating oneself so much). */ @@ -244,6 +247,263 @@ class CFVMFlowSolverBase : public CSolver { */ inline virtual void InstantiateEdgeNumerics(const CSolver* const* solvers, const CConfig* config) {} + /*! + * \brief Generic implementation to compute the time step based on CFL and conv/visc eigenvalues. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + * \param[in] Iteration - Value of the current iteration. + * \tparam SoundSpeedFunc - Function object to compute speed of sound + * \tparam LambdaViscFunc - Function object to compute the viscous lambda + * \note Both functors need to implement (nodes,iPoint,jPoint) for edges, and (nodes,iPoint) for vertices. + */ + template + FORCEINLINE void SetTime_Step_impl(const SoundSpeedFunc& soundSpeed, + const LambdaViscFunc& lambdaVisc, + CGeometry *geometry, + CSolver **solver_container, + CConfig *config, + unsigned short iMesh, + unsigned long Iteration) { + + const bool viscous = config->GetViscous(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool time_stepping = (config->GetTime_Marching() == TIME_STEPPING); + const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND); + const su2double K_v = 0.25; + + /*--- Init thread-shared variables to compute min/max values. + * Critical sections are used for this instead of reduction + * clauses for compatibility with OpenMP 2.0 (Windows...). ---*/ + + SU2_OMP_MASTER + { + Min_Delta_Time = 1e30; + Max_Delta_Time = 0.0; + Global_Delta_UnstTimeND = 1e30; + } + SU2_OMP_BARRIER + + su2double Local_Delta_Time, Local_Delta_Time_Visc; + unsigned short iDim; + + /*--- Loop domain points. ---*/ + + SU2_OMP_FOR_DYN(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPointDomain; ++iPoint) { + + /*--- Set maximum eigenvalues to zero. ---*/ + + nodes->SetMax_Lambda_Inv(iPoint,0.0); + + if (viscous) + nodes->SetMax_Lambda_Visc(iPoint,0.0); + + /*--- Loop over the neighbors of point i. ---*/ + + for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) + { + auto jPoint = geometry->nodes->GetPoint(iPoint,iNeigh); + + auto iEdge = geometry->nodes->GetEdge(iPoint,iNeigh); + auto Normal = geometry->edges->GetNormal(iEdge); + auto Area2 = GeometryToolbox::SquaredNorm(nDim, Normal); + + /*--- Mean Values ---*/ + + su2double Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); + su2double Mean_SoundSpeed = soundSpeed(*nodes, iPoint, jPoint) * sqrt(Area2); + + /*--- Adjustment for grid movement ---*/ + + if (dynamic_grid) { + const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); + const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); + + for (iDim = 0; iDim < nDim; iDim++) + Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; + } + + /*--- Inviscid contribution ---*/ + + su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed ; + nodes->AddMax_Lambda_Inv(iPoint,Lambda); + + /*--- Viscous contribution ---*/ + + if (!viscous) continue; + + Lambda = lambdaVisc(*nodes, iPoint, jPoint) * Area2; + nodes->AddMax_Lambda_Visc(iPoint, Lambda); + } + + } + + /*--- Loop boundary edges ---*/ + + for (unsigned short iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { + + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (auto iVertex = 0ul; iVertex < geometry->GetnVertex(iMarker); iVertex++) { + + /*--- Point identification, Normal vector and area ---*/ + + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (!geometry->nodes->GetDomain(iPoint)) continue; + + auto Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + auto Area2 = GeometryToolbox::SquaredNorm(nDim, Normal); + + /*--- Mean Values ---*/ + + su2double ProjVel = nodes->GetProjVel(iPoint,Normal); + su2double SoundSpeed = soundSpeed(*nodes, iPoint) * sqrt(Area2); + + /*--- Adjustment for grid movement ---*/ + + if (dynamic_grid) { + const su2double *GridVel = geometry->nodes->GetGridVel(iPoint); + + for (iDim = 0; iDim < nDim; iDim++) + ProjVel -= GridVel[iDim]*Normal[iDim]; + } + + /*--- Inviscid contribution ---*/ + + su2double Lambda = fabs(ProjVel) + SoundSpeed; + nodes->AddMax_Lambda_Inv(iPoint, Lambda); + + /*--- Viscous contribution ---*/ + + if (!viscous) continue; + + Lambda = lambdaVisc(*nodes,iPoint) * Area2; + nodes->AddMax_Lambda_Visc(iPoint, Lambda); + } + } + } + + /*--- Each element uses their own speed, steady state simulation. ---*/ + { + /*--- Thread-local variables for min/max reduction. ---*/ + su2double minDt = 1e30, maxDt = 0.0; + + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { + + su2double Vol = geometry->nodes->GetVolume(iPoint); + + if (Vol != 0.0) { + Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); + + if(viscous) { + Local_Delta_Time_Visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol/ nodes->GetMax_Lambda_Visc(iPoint); + Local_Delta_Time = min(Local_Delta_Time, Local_Delta_Time_Visc); + } + + minDt = min(minDt, Local_Delta_Time); + maxDt = max(maxDt, Local_Delta_Time); + + nodes->SetDelta_Time(iPoint, min(Local_Delta_Time, config->GetMax_DeltaTime())); + } + else { + nodes->SetDelta_Time(iPoint,0.0); + } + } + /*--- Min/max over threads. ---*/ + SU2_OMP_CRITICAL + { + Min_Delta_Time = min(Min_Delta_Time, minDt); + Max_Delta_Time = max(Max_Delta_Time, maxDt); + Global_Delta_Time = Min_Delta_Time; + } + SU2_OMP_BARRIER + } + + /*--- Compute the min/max dt (in parallel, now over mpi ranks). ---*/ + + SU2_OMP_MASTER + if (config->GetComm_Level() == COMM_FULL) { + su2double rbuf_time; + SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + Min_Delta_Time = rbuf_time; + + SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + Max_Delta_Time = rbuf_time; + } + SU2_OMP_BARRIER + + /*--- For exact time solution use the minimum delta time of the whole mesh. ---*/ + if (time_stepping) { + + /*--- If the unsteady CFL is set to zero, it uses the defined unsteady time step, + * otherwise it computes the time step based on the unsteady CFL. ---*/ + + SU2_OMP_MASTER + { + if (config->GetUnst_CFL() == 0.0) { + Global_Delta_Time = config->GetDelta_UnstTime(); + } + else { + Global_Delta_Time = Min_Delta_Time; + } + Max_Delta_Time = Global_Delta_Time; + + config->SetDelta_UnstTimeND(Global_Delta_Time); + } + SU2_OMP_BARRIER + + /*--- Sets the regular CFL equal to the unsteady CFL. ---*/ + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { + nodes->SetLocalCFL(iPoint, config->GetUnst_CFL()); + nodes->SetDelta_Time(iPoint, Global_Delta_Time); + } + + } + + /*--- Recompute the unsteady time step for the dual time strategy if the unsteady CFL is diferent from 0. ---*/ + + if ((dual_time) && (Iteration == 0) && (config->GetUnst_CFL() != 0.0) && (iMesh == MESH_0)) { + + /*--- Thread-local variable for reduction. ---*/ + su2double glbDtND = 1e30; + + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { + glbDtND = min(glbDtND, config->GetUnst_CFL()*Global_Delta_Time / nodes->GetLocalCFL(iPoint)); + } + SU2_OMP_CRITICAL + Global_Delta_UnstTimeND = min(Global_Delta_UnstTimeND, glbDtND); + SU2_OMP_BARRIER + + SU2_OMP_MASTER + { + SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + Global_Delta_UnstTimeND = glbDtND; + + config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); + } + SU2_OMP_BARRIER + } + + /*--- The pseudo local time (explicit integration) cannot be greater than the physical time ---*/ + + if (dual_time && !implicit) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { + Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); + nodes->SetDelta_Time(iPoint, Local_Delta_Time); + } + } + } + /*! * \brief Destructor. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 85cd5b7805dc..fa211cd6437d 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -91,7 +91,7 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetViscous(); - const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool time_stepping = (config->GetTime_Marching() == TIME_STEPPING); - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); - const su2double K_v = 0.25; - - /*--- Init thread-shared variables to compute min/max values. - * Critical sections are used for this instead of reduction - * clauses for compatibility with OpenMP 2.0 (Windows...). ---*/ - - SU2_OMP_MASTER - { - Min_Delta_Time = 1e30; - Max_Delta_Time = 0.0; - Global_Delta_UnstTimeND = 1e30; - } - SU2_OMP_BARRIER - - const su2double *Normal = nullptr; - su2double Area, Vol, Mean_SoundSpeed, Mean_ProjVel, Lambda, Local_Delta_Time, Local_Delta_Time_Visc; - su2double Mean_LaminarVisc, Mean_EddyVisc, Mean_Density, Lambda_1, Lambda_2; - unsigned long iEdge, iVertex, iPoint, jPoint; - unsigned short iDim, iMarker; - - /*--- Loop domain points. ---*/ - - SU2_OMP_FOR_DYN(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - /*--- Set maximum eigenvalues to zero. ---*/ - - nodes->SetMax_Lambda_Inv(iPoint,0.0); - - if (viscous) - nodes->SetMax_Lambda_Visc(iPoint,0.0); - - /*--- Loop over the neighbors of point i. ---*/ - - for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) - { - jPoint = geometry->nodes->GetPoint(iPoint,iNeigh); - - iEdge = geometry->nodes->GetEdge(iPoint,iNeigh); - Normal = geometry->edges->GetNormal(iEdge); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - Mean_SoundSpeed = 0.5 * (nodes->GetSoundSpeed(iPoint) + nodes->GetSoundSpeed(jPoint)) * Area; - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); - const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - - for (iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed ; - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - - /*--- Viscous contribution ---*/ - - if (!viscous) continue; - - Mean_LaminarVisc = 0.5*(nodes->GetLaminarViscosity(iPoint) + nodes->GetLaminarViscosity(jPoint)); - Mean_EddyVisc = 0.5*(nodes->GetEddyViscosity(iPoint) + nodes->GetEddyViscosity(jPoint)); - Mean_Density = 0.5*(nodes->GetDensity(iPoint) + nodes->GetDensity(jPoint)); - - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc + Mean_EddyVisc); - //TODO (REAL_GAS) removing Gamma it cannot work with FLUIDPROP - Lambda_2 = (1.0 + (Prandtl_Lam/Prandtl_Turb)*(Mean_EddyVisc/Mean_LaminarVisc))*(Gamma*Mean_LaminarVisc/Prandtl_Lam); - - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - nodes->AddMax_Lambda_Visc(iPoint, Lambda); - } - - } - - /*--- Loop boundary edges ---*/ - - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (!geometry->nodes->GetDomain(iPoint)) continue; - - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - Mean_SoundSpeed = nodes->GetSoundSpeed(iPoint) * Area; - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - const su2double *GridVel = geometry->nodes->GetGridVel(iPoint); - - for (iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= GridVel[iDim]*Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - - /*--- Viscous contribution ---*/ - - if (!viscous) continue; - - Mean_LaminarVisc = nodes->GetLaminarViscosity(iPoint); - Mean_EddyVisc = nodes->GetEddyViscosity(iPoint); - Mean_Density = nodes->GetDensity(iPoint); - - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc + Mean_EddyVisc); - Lambda_2 = (1.0 + (Prandtl_Lam/Prandtl_Turb)*(Mean_EddyVisc/Mean_LaminarVisc))*(Gamma*Mean_LaminarVisc/Prandtl_Lam); - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - - nodes->AddMax_Lambda_Visc(iPoint, Lambda); - - } + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return 0.5 * (nodes.GetSoundSpeed(iPoint) + nodes.GetSoundSpeed(jPoint)); } - } - - /*--- Each element uses their own speed, steady state simulation. ---*/ - { - /*--- Thread-local variables for min/max reduction. ---*/ - su2double minDt = 1e30, maxDt = 0.0; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - Vol = geometry->nodes->GetVolume(iPoint); - - if (Vol != 0.0) { - Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); - - if(viscous) { - Local_Delta_Time_Visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol/ nodes->GetMax_Lambda_Visc(iPoint); - Local_Delta_Time = min(Local_Delta_Time, Local_Delta_Time_Visc); - } - - minDt = min(minDt, Local_Delta_Time); - maxDt = max(maxDt, Local_Delta_Time); - nodes->SetDelta_Time(iPoint, min(Local_Delta_Time, config->GetMax_DeltaTime())); - } - else { - nodes->SetDelta_Time(iPoint,0.0); - } - } - /*--- Min/max over threads. ---*/ - SU2_OMP_CRITICAL - { - Min_Delta_Time = min(Min_Delta_Time, minDt); - Max_Delta_Time = max(Max_Delta_Time, maxDt); - Global_Delta_Time = Min_Delta_Time; + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetSoundSpeed(iPoint); } - SU2_OMP_BARRIER - } - - /*--- Compute the min/max dt (in parallel, now over mpi ranks). ---*/ - - SU2_OMP_MASTER - if (config->GetComm_Level() == COMM_FULL) { - su2double rbuf_time; - SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - Min_Delta_Time = rbuf_time; - - SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - Max_Delta_Time = rbuf_time; - } - SU2_OMP_BARRIER - /*--- For exact time solution use the minimum delta time of the whole mesh. ---*/ - if (time_stepping) { + } soundSpeed; - /*--- If the unsteady CFL is set to zero, it uses the defined unsteady time step, - * otherwise it computes the time step based on the unsteady CFL. ---*/ + /*--- Define an object to compute the viscous eigenvalue. ---*/ + struct LambdaVisc { + const su2double gamma, prandtlLam, prandtlTurb; - SU2_OMP_MASTER - { - if (config->GetUnst_CFL() == 0.0) { - Global_Delta_Time = config->GetDelta_UnstTime(); - } - else { - Global_Delta_Time = Min_Delta_Time; - } - Max_Delta_Time = Global_Delta_Time; + LambdaVisc(su2double g, su2double pl, su2double pt) : gamma(g), prandtlLam(pl), prandtlTurb(pt) {} - config->SetDelta_UnstTimeND(Global_Delta_Time); + FORCEINLINE su2double lambda(su2double laminarVisc, su2double eddyVisc, su2double density) const { + su2double Lambda_1 = (4.0/3.0)*(laminarVisc + eddyVisc); + /// TODO: (REAL_GAS) removing gamma as it cannot work with FLUIDPROP + su2double Lambda_2 = (1.0 + (prandtlLam/prandtlTurb)*(eddyVisc/laminarVisc))*(gamma*laminarVisc/prandtlLam); + return (Lambda_1 + Lambda_2) / density; } - SU2_OMP_BARRIER - - /*--- Sets the regular CFL equal to the unsteady CFL. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - nodes->SetLocalCFL(iPoint, config->GetUnst_CFL()); - nodes->SetDelta_Time(iPoint, Global_Delta_Time); + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + su2double laminarVisc = 0.5*(nodes.GetLaminarViscosity(iPoint) + nodes.GetLaminarViscosity(jPoint)); + su2double eddyVisc = 0.5*(nodes.GetEddyViscosity(iPoint) + nodes.GetEddyViscosity(jPoint)); + su2double density = 0.5*(nodes.GetDensity(iPoint) + nodes.GetDensity(jPoint)); + return lambda(laminarVisc, eddyVisc, density); } - } - - /*--- Recompute the unsteady time step for the dual time strategy if the unsteady CFL is diferent from 0. ---*/ - - if ((dual_time) && (Iteration == 0) && (config->GetUnst_CFL() != 0.0) && (iMesh == MESH_0)) { - - /*--- Thread-local variable for reduction. ---*/ - su2double glbDtND = 1e30; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - glbDtND = min(glbDtND, config->GetUnst_CFL()*Global_Delta_Time / nodes->GetLocalCFL(iPoint)); + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint) const { + su2double laminarVisc = nodes.GetLaminarViscosity(iPoint); + su2double eddyVisc = nodes.GetEddyViscosity(iPoint); + su2double density = nodes.GetDensity(iPoint); + return lambda(laminarVisc, eddyVisc, density); } - SU2_OMP_CRITICAL - Global_Delta_UnstTimeND = min(Global_Delta_UnstTimeND, glbDtND); - SU2_OMP_BARRIER - - SU2_OMP_MASTER - { - SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - Global_Delta_UnstTimeND = glbDtND; - config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); - } - SU2_OMP_BARRIER - } + } lambdaVisc(Gamma, Prandtl_Lam, Prandtl_Turb); - /*--- The pseudo local time (explicit integration) cannot be greater than the physical time ---*/ + /*--- Now instantiate the generic implementation with the two functors above. ---*/ - if (dual_time && !implicit) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); - nodes->SetDelta_Time(iPoint, Local_Delta_Time); - } - } + SetTime_Step_impl(soundSpeed, lambdaVisc, geometry, solver_container, config, iMesh, Iteration); } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index e3df3da16efb..ef29b6bf2faa 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1020,207 +1020,56 @@ unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container } void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh, unsigned long Iteration) { + unsigned short iMesh, unsigned long Iteration) { - su2double Area, Vol, Mean_SoundSpeed = 0.0, Mean_ProjVel = 0.0, - Mean_BetaInc2, Lambda, Local_Delta_Time, - Global_Delta_Time = 1E6, Global_Delta_UnstTimeND, ProjVel, ProjVel_i, ProjVel_j; - const su2double* Normal; - - unsigned long iEdge, iVertex, iPoint, jPoint; - unsigned short iDim, iMarker; - - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - - Min_Delta_Time = 1.E30; Max_Delta_Time = 0.0; - - /*--- Set maximum inviscid eigenvalue to zero, and compute sound speed ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) - nodes->SetMax_Lambda_Inv(iPoint,0.0); - - /*--- Loop interior edges ---*/ - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - Normal = geometry->edges->GetNormal(iEdge); - - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - Mean_BetaInc2 = 0.5 * (nodes->GetBetaInc2(iPoint) + nodes->GetBetaInc2(jPoint)); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); - su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - ProjVel_i = 0.0; ProjVel_j = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - ProjVel_i += GridVel_i[iDim]*Normal[iDim]; - ProjVel_j += GridVel_j[iDim]*Normal[iDim]; - } - Mean_ProjVel -= 0.5 * (ProjVel_i + ProjVel_j); + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return sqrt(0.5 * (nodes.GetBetaInc2(iPoint) + nodes.GetBetaInc2(jPoint))); } - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) nodes->AddMax_Lambda_Inv(iPoint,Lambda); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddMax_Lambda_Inv(jPoint,Lambda); - - } - - /*--- Loop boundary edges ---*/ - - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - Mean_BetaInc2 = nodes->GetBetaInc2(iPoint); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - su2double *GridVel = geometry->nodes->GetGridVel(iPoint); - ProjVel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - ProjVel += GridVel[iDim]*Normal[iDim]; - Mean_ProjVel -= ProjVel; - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) { - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - } - - } + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint) const { + return sqrt(nodes.GetBetaInc2(iPoint)); } - } - /*--- Local time-stepping: each element uses their own speed for steady state - simulations or for pseudo time steps in a dual time simulation. ---*/ + } soundSpeed; - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + /*--- Define an object to compute the viscous eigenvalue. ---*/ + struct LambdaVisc { + const bool energy; - Vol = geometry->nodes->GetVolume(iPoint); + LambdaVisc(bool e) : energy(e) {} - if (Vol != 0.0) { - Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); - Global_Delta_Time = min(Global_Delta_Time, Local_Delta_Time); - Min_Delta_Time = min(Min_Delta_Time, Local_Delta_Time); - Max_Delta_Time = max(Max_Delta_Time, Local_Delta_Time); - if (Local_Delta_Time > config->GetMax_DeltaTime()) - Local_Delta_Time = config->GetMax_DeltaTime(); - nodes->SetDelta_Time(iPoint,Local_Delta_Time); - } - else { - nodes->SetDelta_Time(iPoint,0.0); + FORCEINLINE su2double lambda(su2double lamVisc, su2double eddyVisc, su2double rho, su2double k, su2double cv) const { + su2double Lambda_1 = (4.0/3.0)*(lamVisc + eddyVisc); + su2double Lambda_2 = 0.0; + if (energy) Lambda_2 = k / cv; + return (Lambda_1 + Lambda_2) / rho; } - } - - /*--- Compute the max and the min dt (in parallel) ---*/ - - if (config->GetComm_Level() == COMM_FULL) { -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Min_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Min_Delta_Time = rbuf_time; - - sbuf_time = Max_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Max_Delta_Time = rbuf_time; -#endif - } - - /*--- For time-accurate simulations use the minimum delta time of the whole mesh (global) ---*/ - - if (time_stepping) { -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Global_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Global_Delta_Time = rbuf_time; -#endif - /*--- If the unsteady CFL is set to zero, it uses the defined - unsteady time step, otherwise it computes the time step based - on the unsteady CFL ---*/ - - if (config->GetUnst_CFL() == 0.0) { - Global_Delta_Time = config->GetDelta_UnstTime(); + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + su2double thermalCond = 0.5*(nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity(jPoint)); + su2double laminarVisc = 0.5*(nodes.GetLaminarViscosity(iPoint) + nodes.GetLaminarViscosity(jPoint)); + su2double eddyVisc = 0.5*(nodes.GetEddyViscosity(iPoint) + nodes.GetEddyViscosity(jPoint)); + su2double density = 0.5*(nodes.GetDensity(iPoint) + nodes.GetDensity(jPoint)); + su2double cv = 0.5*(nodes.GetSpecificHeatCv(iPoint) + nodes.GetSpecificHeatCv(jPoint)); + return lambda(laminarVisc, eddyVisc, density, thermalCond, cv); } - config->SetDelta_UnstTimeND(Global_Delta_Time); - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - - /*--- Sets the regular CFL equal to the unsteady CFL ---*/ - - nodes->SetLocalCFL(iPoint, config->GetUnst_CFL()); - nodes->SetDelta_Time(iPoint, Global_Delta_Time); - Min_Delta_Time = Global_Delta_Time; - Max_Delta_Time = Global_Delta_Time; + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint) const { + su2double thermalCond = nodes.GetThermalConductivity(iPoint); + su2double laminarVisc = nodes.GetLaminarViscosity(iPoint); + su2double eddyVisc = nodes.GetEddyViscosity(iPoint); + su2double density = nodes.GetDensity(iPoint); + su2double cv = nodes.GetSpecificHeatCv(iPoint); + return lambda(laminarVisc, eddyVisc, density, thermalCond, cv); } - } - /*--- Recompute the unsteady time step for the dual time strategy - if the unsteady CFL is diferent from 0 ---*/ + } lambdaVisc(config->GetEnergy_Equation()); - if ((dual_time) && (Iteration == 0) && (config->GetUnst_CFL() != 0.0) && (iMesh == MESH_0)) { + /*--- Now instantiate the generic implementation with the two functors above. ---*/ - Global_Delta_UnstTimeND = 1e30; - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - Global_Delta_UnstTimeND = min(Global_Delta_UnstTimeND,config->GetUnst_CFL()*Global_Delta_Time/nodes->GetLocalCFL(iPoint)); - } - -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Global_Delta_UnstTimeND; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Global_Delta_UnstTimeND = rbuf_time; -#endif - config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); - } - - /*--- The pseudo local time (explicit integration) cannot be greater than the physical time ---*/ - - if (dual_time) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - if (!implicit) { - Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); - nodes->SetDelta_Time(iPoint,Local_Delta_Time); - } - } + SetTime_Step_impl(soundSpeed, lambdaVisc, geometry, solver_container, config, iMesh, Iteration); } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 976da459e9e3..972c8d1c6c1f 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -203,239 +203,6 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, C } -void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) { - - su2double Mean_BetaInc2, Area, Vol, Mean_SoundSpeed = 0.0, Mean_ProjVel = 0.0, Lambda, Local_Delta_Time, Local_Delta_Time_Visc, - Global_Delta_Time = 1E6, Mean_LaminarVisc = 0.0, Mean_EddyVisc = 0.0, Mean_Density = 0.0, Mean_Thermal_Conductivity = 0.0, Mean_Cv = 0.0, Lambda_1, Lambda_2, K_v = 0.25, Global_Delta_UnstTimeND; - unsigned long iEdge, iVertex, iPoint = 0, jPoint = 0; - unsigned short iDim, iMarker; - su2double ProjVel, ProjVel_i, ProjVel_j; - const su2double* Normal; - - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool energy = config->GetEnergy_Equation(); - - Min_Delta_Time = 1.E30; Max_Delta_Time = 0.0; - - /*--- Set maximum inviscid eigenvalue to zero, and compute sound speed and viscosity ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - nodes->SetMax_Lambda_Inv(iPoint,0.0); - nodes->SetMax_Lambda_Visc(iPoint,0.0); - } - - /*--- Loop interior edges ---*/ - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - Normal = geometry->edges->GetNormal(iEdge); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - Mean_BetaInc2 = 0.5 * (nodes->GetBetaInc2(iPoint) + nodes->GetBetaInc2(jPoint)); - Mean_Density = 0.5 * (nodes->GetDensity(iPoint) + nodes->GetDensity(jPoint)); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); - su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - ProjVel_i = 0.0; ProjVel_j =0.0; - for (iDim = 0; iDim < nDim; iDim++) { - ProjVel_i += GridVel_i[iDim]*Normal[iDim]; - ProjVel_j += GridVel_j[iDim]*Normal[iDim]; - } - Mean_ProjVel -= 0.5 * (ProjVel_i + ProjVel_j); - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) nodes->AddMax_Lambda_Inv(iPoint,Lambda); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddMax_Lambda_Inv(jPoint,Lambda); - - /*--- Viscous contribution ---*/ - - Mean_LaminarVisc = 0.5*(nodes->GetLaminarViscosity(iPoint) + nodes->GetLaminarViscosity(jPoint)); - Mean_EddyVisc = 0.5*(nodes->GetEddyViscosity(iPoint) + nodes->GetEddyViscosity(jPoint)); - Mean_Density = 0.5*(nodes->GetDensity(iPoint) + nodes->GetDensity(jPoint)); - Mean_Thermal_Conductivity = 0.5*(nodes->GetThermalConductivity(iPoint) + nodes->GetThermalConductivity(jPoint)); - Mean_Cv = 0.5*(nodes->GetSpecificHeatCv(iPoint) + nodes->GetSpecificHeatCv(jPoint)); - - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc + Mean_EddyVisc); - Lambda_2 = 0.0; - if (energy) Lambda_2 = (1.0/Mean_Cv)*Mean_Thermal_Conductivity; - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - - if (geometry->nodes->GetDomain(iPoint)) nodes->AddMax_Lambda_Visc(iPoint,Lambda); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddMax_Lambda_Visc(jPoint,Lambda); - - } - - /*--- Loop boundary edges ---*/ - - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - Mean_BetaInc2 = nodes->GetBetaInc2(iPoint); - Mean_Density = nodes->GetDensity(iPoint); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - su2double *GridVel = geometry->nodes->GetGridVel(iPoint); - ProjVel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - ProjVel += GridVel[iDim]*Normal[iDim]; - Mean_ProjVel -= ProjVel; - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) { - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - } - - /*--- Viscous contribution ---*/ - - Mean_LaminarVisc = nodes->GetLaminarViscosity(iPoint); - Mean_EddyVisc = nodes->GetEddyViscosity(iPoint); - Mean_Density = nodes->GetDensity(iPoint); - Mean_Thermal_Conductivity = nodes->GetThermalConductivity(iPoint); - Mean_Cv = nodes->GetSpecificHeatCv(iPoint); - - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc + Mean_EddyVisc); - Lambda_2 = 0.0; - if (energy) Lambda_2 = (1.0/Mean_Cv)*Mean_Thermal_Conductivity; - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - - if (geometry->nodes->GetDomain(iPoint)) nodes->AddMax_Lambda_Visc(iPoint,Lambda); - - } - } - } - - /*--- Each element uses their own speed, steady state simulation ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - Vol = geometry->nodes->GetVolume(iPoint); - - if (Vol != 0.0) { - Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); - Local_Delta_Time_Visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol/ nodes->GetMax_Lambda_Visc(iPoint); - Local_Delta_Time = min(Local_Delta_Time, Local_Delta_Time_Visc); - Global_Delta_Time = min(Global_Delta_Time, Local_Delta_Time); - Min_Delta_Time = min(Min_Delta_Time, Local_Delta_Time); - Max_Delta_Time = max(Max_Delta_Time, Local_Delta_Time); - if (Local_Delta_Time > config->GetMax_DeltaTime()) - Local_Delta_Time = config->GetMax_DeltaTime(); - nodes->SetDelta_Time(iPoint,Local_Delta_Time); - } - else { - nodes->SetDelta_Time(iPoint,0.0); - } - - } - - /*--- Compute the max and the min dt (in parallel) ---*/ - if (config->GetComm_Level() == COMM_FULL) { -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Min_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Min_Delta_Time = rbuf_time; - - sbuf_time = Max_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Max_Delta_Time = rbuf_time; -#endif - } - - /*--- For exact time solution use the minimum delta time of the whole mesh ---*/ - if (config->GetTime_Marching() == TIME_STEPPING) { -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Global_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Global_Delta_Time = rbuf_time; -#endif - /*--- If the unsteady CFL is set to zero, it uses the defined - unsteady time step, otherwise it computes the time step based - on the unsteady CFL ---*/ - - if (config->GetUnst_CFL() == 0.0) { - Global_Delta_Time = config->GetDelta_UnstTime(); - } - config->SetDelta_UnstTimeND(Global_Delta_Time); - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - - /*--- Sets the regular CFL equal to the unsteady CFL ---*/ - - nodes->SetLocalCFL(iPoint, config->GetUnst_CFL()); - nodes->SetDelta_Time(iPoint, Global_Delta_Time); - Min_Delta_Time = Global_Delta_Time; - Max_Delta_Time = Global_Delta_Time; - - } - } - - /*--- Recompute the unsteady time step for the dual time strategy - if the unsteady CFL is diferent from 0 ---*/ - if ((dual_time) && (Iteration == 0) && (config->GetUnst_CFL() != 0.0) && (iMesh == MESH_0)) { - - Global_Delta_UnstTimeND = 1e30; - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - Global_Delta_UnstTimeND = min(Global_Delta_UnstTimeND,config->GetUnst_CFL()*Global_Delta_Time/nodes->GetLocalCFL(iPoint)); - } - -#ifdef HAVE_MPI - su2double rbuf_time, sbuf_time; - sbuf_time = Global_Delta_UnstTimeND; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - Global_Delta_UnstTimeND = rbuf_time; -#endif - config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); - } - - /*--- The pseudo local time (explicit integration) cannot be greater than the physical time ---*/ - if (dual_time) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - if (!implicit) { - Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); - nodes->SetDelta_Time(iPoint,Local_Delta_Time); - } - } - -} - void CIncNSSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) { diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 86aa426bef54..ee43b2e1fa06 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -432,256 +432,51 @@ unsigned long CNEMOEulerSolver::SetPrimitive_Variables(CSolver **solver_containe void CNEMOEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) { - const bool viscous = config->GetViscous(); - const bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - const bool time_stepping = (config->GetTime_Marching() == TIME_STEPPING); - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); - const su2double K_v = 0.25; - - /*--- Init thread-shared variables to compute min/max values. - * Critical sections are used for this instead of reduction - * clauses for compatibility with OpenMP 2.0 (Windows...). ---*/ - SU2_OMP_MASTER - { - Min_Delta_Time = 1e30; - Max_Delta_Time = 0.0; - Global_Delta_UnstTimeND = 1e30; - } - SU2_OMP_BARRIER - - const su2double *Normal = nullptr; - su2double Area, Vol, Mean_SoundSpeed, Mean_ProjVel, Lambda, Local_Delta_Time, Local_Delta_Time_Visc; - su2double Mean_LaminarVisc, Mean_EddyVisc, Mean_Density, Lambda_1, Lambda_2; - su2double Mean_ThermalCond, Mean_ThermalCond_ve, cv; - unsigned long iEdge, iVertex, iPoint, jPoint; - unsigned short iDim, iMarker; - - /*--- Loop domain points. ---*/ - SU2_OMP_FOR_DYN(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - /*--- Set maximum eigenvalue to zero. ---*/ - nodes->SetMax_Lambda_Inv(iPoint, 0.0); - - if (viscous) - nodes->SetMax_Lambda_Visc(iPoint,0.0); - - /*--- Loop over the neighbors of point i. ---*/ - for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) - { - jPoint = geometry->nodes->GetPoint(iPoint,iNeigh); - - iEdge = geometry->nodes->GetEdge(iPoint,iNeigh); - Normal = geometry->edges->GetNormal(iEdge); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint, Normal) + nodes->GetProjVel(jPoint,Normal)); - Mean_SoundSpeed = 0.5 * (nodes->GetSoundSpeed(iPoint) + nodes->GetSoundSpeed(jPoint)) * Area; - - /*--- Adjustment for grid movement ---*/ - if (dynamic_grid) { - const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); - const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - - for (iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - - /*--- Viscous contribution ---*/ - if (!viscous) continue; - - /*--- Calculate mean viscous quantities ---*/ - Mean_LaminarVisc = 0.5*(nodes->GetLaminarViscosity(iPoint) + - nodes->GetLaminarViscosity(jPoint)); - Mean_EddyVisc = 0.5*(nodes->GetEddyViscosity(iPoint) + - nodes->GetEddyViscosity(jPoint)); - Mean_ThermalCond = 0.5*(nodes->GetThermalConductivity(iPoint) + - nodes->GetThermalConductivity(jPoint)); - Mean_ThermalCond_ve = 0.5*(nodes->GetThermalConductivity_ve(iPoint) + - nodes->GetThermalConductivity_ve(jPoint)); - Mean_Density = 0.5*(nodes->GetDensity(iPoint) + - nodes->GetDensity(jPoint)); - cv = 0.5*(nodes->GetRhoCv_tr(iPoint) + nodes->GetRhoCv_ve(iPoint) + - nodes->GetRhoCv_tr(jPoint) + nodes->GetRhoCv_ve(jPoint) )/ Mean_Density; - - /*--- Determine the viscous spectral radius and apply it to the control volume ---*/ - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc + Mean_EddyVisc); - Lambda_2 = (Mean_ThermalCond+Mean_ThermalCond_ve)/cv; - - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - nodes->AddMax_Lambda_Visc(iPoint, Lambda); - } - - } - - /*--- Loop boundary edges ---*/ - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (!geometry->nodes->GetDomain(iPoint)) continue; - - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - Mean_SoundSpeed = nodes->GetSoundSpeed(iPoint) * Area; - - /*--- Adjustment for grid movement ---*/ - if (dynamic_grid) { - const su2double *GridVel = geometry->nodes->GetGridVel(iPoint); - - for (iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= GridVel[iDim]*Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - nodes->AddMax_Lambda_Inv(iPoint,Lambda); - - /*--- Viscous contribution ---*/ - if (!viscous) continue; - - /*--- Calculate viscous mean quantities ---*/ - Mean_LaminarVisc = nodes->GetLaminarViscosity(iPoint); - Mean_EddyVisc = nodes->GetEddyViscosity(iPoint); - Mean_ThermalCond = nodes->GetThermalConductivity(iPoint); - Mean_ThermalCond_ve = nodes->GetThermalConductivity_ve(iPoint); - Mean_Density = nodes->GetDensity(iPoint); - cv = (nodes->GetRhoCv_tr(iPoint) + - nodes->GetRhoCv_ve(iPoint)) / Mean_Density; - - Lambda_1 = (4.0/3.0)*(Mean_LaminarVisc+Mean_EddyVisc); - Lambda_2 = (Mean_ThermalCond+Mean_ThermalCond_ve)/cv; - Lambda = (Lambda_1 + Lambda_2)*Area*Area/Mean_Density; - nodes->AddMax_Lambda_Visc(iPoint,Lambda); - - } + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return 0.5 * (nodes.GetSoundSpeed(iPoint) + nodes.GetSoundSpeed(jPoint)); } - } - - /*--- Each element uses their own speed, steady state simulation. ---*/ - { - /*--- Thread-local variables for min/max reduction. ---*/ - su2double minDt = 1e30, maxDt = 0.0; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - Vol = geometry->nodes->GetVolume(iPoint); - - if (Vol != 0.0) { - Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); - - if(viscous) { - Local_Delta_Time_Visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol/ nodes->GetMax_Lambda_Visc(iPoint); - Local_Delta_Time = min(Local_Delta_Time, Local_Delta_Time_Visc); - } - minDt = min(minDt, Local_Delta_Time); - maxDt = max(maxDt, Local_Delta_Time); - - nodes->SetDelta_Time(iPoint, min(Local_Delta_Time, config->GetMax_DeltaTime())); - } - else { - nodes->SetDelta_Time(iPoint,0.0); - } - } - /*--- Min/max over threads. ---*/ - SU2_OMP_CRITICAL - { - Min_Delta_Time = min(Min_Delta_Time, minDt); - Max_Delta_Time = max(Max_Delta_Time, maxDt); - Global_Delta_Time = Min_Delta_Time; + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetSoundSpeed(iPoint); } - SU2_OMP_BARRIER - } - - /*--- Compute the min/max dt (in parallel, now over mpi ranks). ---*/ - SU2_OMP_MASTER - if (config->GetComm_Level() == COMM_FULL) { - su2double rbuf_time; - SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - Min_Delta_Time = rbuf_time; - SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - Max_Delta_Time = rbuf_time; - } - SU2_OMP_BARRIER - - /*--- For exact time solution use the minimum delta time of the whole mesh. ---*/ - if (time_stepping) { + } soundSpeed; - /*--- If the unsteady CFL is set to zero, it uses the defined unsteady time step, - * otherwise it computes the time step based on the unsteady CFL. ---*/ - SU2_OMP_MASTER - { - if (config->GetUnst_CFL() == 0.0) { - Global_Delta_Time = config->GetDelta_UnstTime(); - } - else { - Global_Delta_Time = Min_Delta_Time; - } - Max_Delta_Time = Global_Delta_Time; - - config->SetDelta_UnstTimeND(Global_Delta_Time); + /*--- Define an object to compute the viscous eigenvalue. ---*/ + struct LambdaVisc { + FORCEINLINE su2double lambda(su2double lamVisc, su2double eddyVisc, su2double rho, su2double k, su2double cv) const { + /*--- Determine the viscous spectral radius and apply it to the control volume ---*/ + su2double Lambda_1 = (4.0/3.0)*(lamVisc + eddyVisc); + return (Lambda_1 + k/cv)/rho; } - SU2_OMP_BARRIER - /*--- Sets the regular CFL equal to the unsteady CFL. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - nodes->SetLocalCFL(iPoint, config->GetUnst_CFL()); - nodes->SetDelta_Time(iPoint, Global_Delta_Time); + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + su2double lamVisc = 0.5*(nodes.GetLaminarViscosity(iPoint) + nodes.GetLaminarViscosity(jPoint)); + su2double eddyVisc = 0.5*(nodes.GetEddyViscosity(iPoint) + nodes.GetEddyViscosity(jPoint)); + su2double thermalCond = 0.5*(nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity(jPoint) + + nodes.GetThermalConductivity_ve(iPoint) + nodes.GetThermalConductivity_ve(jPoint)); + su2double density = 0.5*(nodes.GetDensity(iPoint) + nodes.GetDensity(jPoint)); + su2double cv = 0.5*(nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint) + + nodes.GetRhoCv_tr(jPoint) + nodes.GetRhoCv_ve(jPoint))/ density; + return lambda(lamVisc, eddyVisc, density, thermalCond, cv); } - } - - /*--- Recompute the unsteady time step for the dual time strategy if the unsteady CFL is diferent from 0. ---*/ - if ((dual_time) && (Iteration == 0) && (config->GetUnst_CFL() != 0.0) && (iMesh == MESH_0)) { - - /*--- Thread-local variable for reduction. ---*/ - su2double glbDtND = 1e30; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - glbDtND = min(glbDtND, config->GetUnst_CFL()*Global_Delta_Time / nodes->GetLocalCFL(iPoint)); + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint) const { + su2double lamVisc = nodes.GetLaminarViscosity(iPoint); + su2double eddyVisc = nodes.GetEddyViscosity(iPoint); + su2double thermalCond = nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity_ve(iPoint); + su2double density = nodes.GetDensity(iPoint); + su2double cv = (nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint))/ density; + return lambda(lamVisc, eddyVisc, density, thermalCond, cv); } - SU2_OMP_CRITICAL - Global_Delta_UnstTimeND = min(Global_Delta_UnstTimeND, glbDtND); - SU2_OMP_BARRIER - SU2_OMP_MASTER - { - SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - Global_Delta_UnstTimeND = glbDtND; + } lambdaVisc; - config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); - } - SU2_OMP_BARRIER - } + /*--- Now instantiate the generic implementation with the two functors above. ---*/ - /*--- The pseudo local time (explicit integration) cannot be greater than the physical time ---*/ - if (dual_time && !implicit) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); - nodes->SetDelta_Time(iPoint, Local_Delta_Time); - } - } + SetTime_Step_impl(soundSpeed, lambdaVisc, geometry, solver_container, config, iMesh, Iteration); } From 9f24707522f14e45b201b339ea4be70269083184 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 09:56:38 +0000 Subject: [PATCH 142/326] cleanup --- .../include/solvers/CFVMFlowSolverBase.hpp | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index da83d1aa741f..0627451392c2 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -286,9 +286,6 @@ class CFVMFlowSolverBase : public CSolver { } SU2_OMP_BARRIER - su2double Local_Delta_Time, Local_Delta_Time_Visc; - unsigned short iDim; - /*--- Loop domain points. ---*/ SU2_OMP_FOR_DYN(omp_chunk_size) @@ -322,13 +319,13 @@ class CFVMFlowSolverBase : public CSolver { const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - for (iDim = 0; iDim < nDim; iDim++) + for (unsigned short iDim = 0; iDim < nDim; iDim++) Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; } /*--- Inviscid contribution ---*/ - su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed ; + su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; nodes->AddMax_Lambda_Inv(iPoint,Lambda); /*--- Viscous contribution ---*/ @@ -367,10 +364,7 @@ class CFVMFlowSolverBase : public CSolver { /*--- Adjustment for grid movement ---*/ if (dynamic_grid) { - const su2double *GridVel = geometry->nodes->GetGridVel(iPoint); - - for (iDim = 0; iDim < nDim; iDim++) - ProjVel -= GridVel[iDim]*Normal[iDim]; + ProjVel -= GeometryToolbox::DotProduct(nDim, Normal, geometry->nodes->GetGridVel(iPoint)); } /*--- Inviscid contribution ---*/ @@ -399,11 +393,11 @@ class CFVMFlowSolverBase : public CSolver { su2double Vol = geometry->nodes->GetVolume(iPoint); if (Vol != 0.0) { - Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); + su2double Local_Delta_Time = nodes->GetLocalCFL(iPoint)*Vol / nodes->GetMax_Lambda_Inv(iPoint); if(viscous) { - Local_Delta_Time_Visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol/ nodes->GetMax_Lambda_Visc(iPoint); - Local_Delta_Time = min(Local_Delta_Time, Local_Delta_Time_Visc); + su2double dt_visc = nodes->GetLocalCFL(iPoint)*K_v*Vol*Vol / nodes->GetMax_Lambda_Visc(iPoint); + Local_Delta_Time = min(Local_Delta_Time, dt_visc); } minDt = min(minDt, Local_Delta_Time); @@ -498,8 +492,8 @@ class CFVMFlowSolverBase : public CSolver { if (dual_time && !implicit) { SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { - Local_Delta_Time = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); - nodes->SetDelta_Time(iPoint, Local_Delta_Time); + su2double dt = min((2.0/3.0)*config->GetDelta_UnstTimeND(), nodes->GetDelta_Time(iPoint)); + nodes->SetDelta_Time(iPoint, dt); } } } From d8ef98c32718eae31bec2a72814bb91090786419 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 10:35:38 +0000 Subject: [PATCH 143/326] SetMax_Eigenvalue --- .../include/solvers/CFVMFlowSolverBase.hpp | 101 ++++++++++++++++- SU2_CFD/src/solvers/CEulerSolver.cpp | 92 ++------------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 106 ++---------------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 58 ++-------- 4 files changed, 127 insertions(+), 230 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 0627451392c2..3cc9016ef5f9 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -254,8 +254,8 @@ class CFVMFlowSolverBase : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] iMesh - Index of the mesh in multigrid computations. * \param[in] Iteration - Value of the current iteration. - * \tparam SoundSpeedFunc - Function object to compute speed of sound - * \tparam LambdaViscFunc - Function object to compute the viscous lambda + * \tparam SoundSpeedFunc - Function object to compute speed of sound. + * \tparam LambdaViscFunc - Function object to compute the viscous lambda. * \note Both functors need to implement (nodes,iPoint,jPoint) for edges, and (nodes,iPoint) for vertices. */ template @@ -498,6 +498,103 @@ class CFVMFlowSolverBase : public CSolver { } } + /*! + * \brief Compute the max eigenvalue, gemeric implementation. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \tparam SoundSpeedFunc - Function object to compute speed of sound. + * \note Functor needs to implement (nodes,iPoint,jPoint) for edges, and (nodes,iPoint) for vertices. + */ + template + FORCEINLINE void SetMax_Eigenvalue_impl(const SoundSpeedFunc& soundSpeed, CGeometry *geometry, CConfig *config) { + + /*--- Loop domain points. ---*/ + + SU2_OMP_FOR_DYN(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { + + /*--- Set eigenvalues to zero. ---*/ + nodes->SetLambda(iPoint,0.0); + + /*--- Loop over the neighbors of point i. ---*/ + for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) + { + auto jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); + + auto iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); + auto Normal = geometry->edges->GetNormal(iEdge); + su2double Area = GeometryToolbox::Norm(nDim, Normal); + + /*--- Mean Values ---*/ + + su2double Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); + su2double Mean_SoundSpeed = soundSpeed(*nodes, iPoint, jPoint) * Area; + + /*--- Adjustment for grid movement ---*/ + + if (dynamic_grid) { + const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); + const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); + + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; + } + + /*--- Inviscid contribution ---*/ + + nodes->AddLambda(iPoint, fabs(Mean_ProjVel) + Mean_SoundSpeed); + } + } + + /*--- Loop boundary edges ---*/ + + for (unsigned short iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { + + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (unsigned long iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { + + /*--- Point identification, Normal vector and area ---*/ + + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (!geometry->nodes->GetDomain(iPoint)) continue; + + auto Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + su2double Area = GeometryToolbox::Norm(nDim, Normal); + + /*--- Mean Values ---*/ + + su2double Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); + su2double Mean_SoundSpeed = soundSpeed(*nodes, iPoint) * Area; + + /*--- Adjustment for grid movement ---*/ + + if (dynamic_grid) { + Mean_ProjVel -= GeometryToolbox::DotProduct(nDim, Normal, geometry->nodes->GetGridVel(iPoint)); + } + + /*--- Inviscid contribution ---*/ + + nodes->AddLambda(iPoint, fabs(Mean_ProjVel) + Mean_SoundSpeed); + } + } + } + + /*--- Correct the eigenvalue values across any periodic boundaries. ---*/ + + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { + InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); + CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); + } + + /*--- MPI parallelization ---*/ + + InitiateComms(geometry, config, MAX_EIGENVALUE); + CompleteComms(geometry, config, MAX_EIGENVALUE); + } + /*! * \brief Destructor. */ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 98dfdf6e0cae..a33afa8c116e 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2958,95 +2958,21 @@ void CEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_contain void CEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { - /*--- Loop domain points. ---*/ - - SU2_OMP_FOR_DYN(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - /*--- Set eigenvalues to zero. ---*/ - nodes->SetLambda(iPoint,0.0); - - /*--- Loop over the neighbors of point i. ---*/ - for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) - { - auto jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); - - auto iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); - auto Normal = geometry->edges->GetNormal(iEdge); - su2double Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - su2double Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - su2double Mean_SoundSpeed = 0.5 * (nodes->GetSoundSpeed(iPoint) + nodes->GetSoundSpeed(jPoint)) * Area; - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - const su2double *GridVel_i = geometry->nodes->GetGridVel(iPoint); - const su2double *GridVel_j = geometry->nodes->GetGridVel(jPoint); - - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= 0.5 * (GridVel_i[iDim] + GridVel_j[iDim]) * Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - - su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed ; - nodes->AddLambda(iPoint, Lambda); + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return 0.5 * (nodes.GetSoundSpeed(iPoint) + nodes.GetSoundSpeed(jPoint)); } - } - - /*--- Loop boundary edges ---*/ - - for (unsigned short iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (unsigned long iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - - auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - auto Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - su2double Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - su2double Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - su2double Mean_SoundSpeed = nodes->GetSoundSpeed(iPoint) * Area; - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - auto GridVel = geometry->nodes->GetGridVel(iPoint); - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Mean_ProjVel -= GridVel[iDim]*Normal[iDim]; - } - - /*--- Inviscid contribution ---*/ - - su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) { - nodes->AddLambda(iPoint,Lambda); - } - } + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetSoundSpeed(iPoint); } - } - /*--- Correct the eigenvalue values across any periodic boundaries. ---*/ - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); - } + } soundSpeed; - /*--- MPI parallelization ---*/ + /*--- Instantiate generic implementation. ---*/ - InitiateComms(geometry, config, MAX_EIGENVALUE); - CompleteComms(geometry, config, MAX_EIGENVALUE); + SetMax_Eigenvalue_impl(soundSpeed, geometry, config); } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index ef29b6bf2faa..59091d3c8e62 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1575,109 +1575,21 @@ void CIncEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_cont void CIncEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { - su2double Area, Mean_SoundSpeed = 0.0, Mean_ProjVel = 0.0, - Mean_BetaInc2, Lambda, ProjVel, ProjVel_i, ProjVel_j, *GridVel, *GridVel_i, *GridVel_j; - const su2double* Normal; - - unsigned long iEdge, iVertex, iPoint, jPoint; - unsigned short iDim, iMarker; - - /*--- Set maximum inviscid eigenvalue to zero, and compute sound speed ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - nodes->SetLambda(iPoint,0.0); - } - - /*--- Loop interior edges ---*/ - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - Normal = geometry->edges->GetNormal(iEdge); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - Mean_BetaInc2 = 0.5 * (nodes->GetBetaInc2(iPoint) + nodes->GetBetaInc2(jPoint)); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - GridVel_i = geometry->nodes->GetGridVel(iPoint); - GridVel_j = geometry->nodes->GetGridVel(jPoint); - ProjVel_i = 0.0; ProjVel_j =0.0; - for (iDim = 0; iDim < nDim; iDim++) { - ProjVel_i += GridVel_i[iDim]*Normal[iDim]; - ProjVel_j += GridVel_j[iDim]*Normal[iDim]; - } - Mean_ProjVel -= 0.5 * (ProjVel_i + ProjVel_j); + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return sqrt(0.5 * (nodes.GetBetaInc2(iPoint) + nodes.GetBetaInc2(jPoint))); } - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) nodes->AddLambda(iPoint,Lambda); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddLambda(jPoint,Lambda); - - } - - /*--- Loop boundary edges ---*/ - - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - - Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - Mean_BetaInc2 = nodes->GetBetaInc2(iPoint); - Mean_SoundSpeed = sqrt(Mean_BetaInc2*Area*Area); - - /*--- Adjustment for grid movement ---*/ - - if (dynamic_grid) { - GridVel = geometry->nodes->GetGridVel(iPoint); - ProjVel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - ProjVel += GridVel[iDim]*Normal[iDim]; - Mean_ProjVel -= ProjVel; - } - - /*--- Inviscid contribution ---*/ - - Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) { - nodes->AddLambda(iPoint,Lambda); - } - - } + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint) const { + return sqrt(nodes.GetBetaInc2(iPoint)); } - } - /*--- Correct the eigenvalue values across any periodic boundaries. ---*/ - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_MAX_EIG); - } + } soundSpeed; - /*--- MPI parallelization ---*/ + /*--- Instantiate generic implementation. ---*/ - InitiateComms(geometry, config, MAX_EIGENVALUE); - CompleteComms(geometry, config, MAX_EIGENVALUE); + SetMax_Eigenvalue_impl(soundSpeed, geometry, config); } diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index ee43b2e1fa06..d0cfe25f9e47 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -482,59 +482,21 @@ void CNEMOEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai void CNEMOEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { - /*--- Loop domain points. ---*/ - for ( unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - /*--- Set inviscid eigenvalues to zero. ---*/ - nodes->SetLambda(iPoint, 0.0); - - /*--- Loop over the neighbors of point i. ---*/ - for (unsigned short iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) - { - auto jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); - - auto iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); - auto Normal = geometry->edges->GetNormal(iEdge); - su2double Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Mean Values ---*/ - su2double Mean_ProjVel = 0.5 * (nodes->GetProjVel(iPoint,Normal) + nodes->GetProjVel(jPoint,Normal)); - su2double Mean_SoundSpeed = 0.5 * (nodes->GetSoundSpeed(iPoint) + nodes->GetSoundSpeed(jPoint)) * Area; - - /*--- Inviscid contribution ---*/ - su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - nodes->AddLambda(iPoint,Lambda); + /*--- Define an object to compute the speed of sound. ---*/ + struct SoundSpeed { + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { + return 0.5 * (nodes.GetSoundSpeed(iPoint) + nodes.GetSoundSpeed(jPoint)); } - } - /*--- Loop boundary edges ---*/ - for (unsigned short iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - - for (unsigned long iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Point identification, Normal vector and area ---*/ - auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - auto Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - su2double Area = GeometryToolbox::Norm(nDim, Normal); + FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetSoundSpeed(iPoint); + } - /*--- Mean Values ---*/ - su2double Mean_ProjVel = nodes->GetProjVel(iPoint,Normal); - su2double Mean_SoundSpeed = nodes->GetSoundSpeed(iPoint) * Area; + } soundSpeed; - /*--- Inviscid contribution ---*/ - su2double Lambda = fabs(Mean_ProjVel) + Mean_SoundSpeed; - if (geometry->nodes->GetDomain(iPoint)) { - nodes->AddLambda(iPoint,Lambda); - } - } - } - } + /*--- Instantiate generic implementation. ---*/ - /*--- Call the MPI routine ---*/ - InitiateComms(geometry, config, MAX_EIGENVALUE); - CompleteComms(geometry, config, MAX_EIGENVALUE); + SetMax_Eigenvalue_impl(soundSpeed, geometry, config); } From 95490f3471458283d804566dc5782af57936071b Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 11:03:41 +0000 Subject: [PATCH 144/326] SetCentered_Dissipation_Sensor --- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.hpp | 71 ++++++++++++++- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 6 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 63 ++------------ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 87 +++---------------- 5 files changed, 92 insertions(+), 137 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 1b2acaa17a73..9da2b823e569 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -236,7 +236,7 @@ class CEulerSolver : public CFVMFlowSolverBase { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetMax_Eigenvalue(CGeometry *geometry, CConfig *config); + void SetMax_Eigenvalue(CGeometry *geometry, const CConfig *config); /*! * \brief Compute the undivided laplacian for the solution. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 3cc9016ef5f9..6c2ea36af1ac 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -506,7 +506,7 @@ class CFVMFlowSolverBase : public CSolver { * \note Functor needs to implement (nodes,iPoint,jPoint) for edges, and (nodes,iPoint) for vertices. */ template - FORCEINLINE void SetMax_Eigenvalue_impl(const SoundSpeedFunc& soundSpeed, CGeometry *geometry, CConfig *config) { + FORCEINLINE void SetMax_Eigenvalue_impl(const SoundSpeedFunc& soundSpeed, CGeometry *geometry, const CConfig *config) { /*--- Loop domain points. ---*/ @@ -595,6 +595,75 @@ class CFVMFlowSolverBase : public CSolver { CompleteComms(geometry, config, MAX_EIGENVALUE); } + /*! + * \brief Compute the dissipation sensor for centered schemes. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \tparam SensVarFunc - Function object implementing (nodes, iPoint) to return the sensor variable, e.g. pressure. + */ + template + FORCEINLINE void SetCentered_Dissipation_Sensor_impl(const SensVarFunc& sensVar, + CGeometry *geometry, const CConfig *config) { + + /*--- We can access memory more efficiently if there are no periodic boundaries. ---*/ + + const bool isPeriodic = (config->GetnMarker_Periodic() > 0); + + /*--- Loop domain points. ---*/ + + SU2_OMP_FOR_DYN(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { + + const bool boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); + const su2double sensVar_i = sensVar(*nodes, iPoint); + + /*--- Initialize. ---*/ + iPoint_UndLapl[iPoint] = 0.0; + jPoint_UndLapl[iPoint] = 0.0; + + /*--- Loop over the neighbors of point i. ---*/ + for (auto jPoint : geometry->nodes->GetPoints(iPoint)) + { + bool boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); + + /*--- If iPoint is boundary it only takes contributions from other boundary points. ---*/ + if (boundary_i && !boundary_j) continue; + + su2double sensVar_j = sensVar(*nodes, jPoint); + + /*--- Dissipation sensor, add variable difference and variable sum. ---*/ + iPoint_UndLapl[iPoint] += sensVar_j - sensVar_i; + jPoint_UndLapl[iPoint] += sensVar_j + sensVar_i; + } + + if (!isPeriodic) { + /*--- Every neighbor is accounted for, sensor can be computed. ---*/ + nodes->SetSensor(iPoint, fabs(iPoint_UndLapl[iPoint]) / jPoint_UndLapl[iPoint]); + } + } + + if (isPeriodic) { + /*--- Correct the sensor values across any periodic boundaries. ---*/ + + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { + InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); + CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); + } + + /*--- Set final pressure switch for each point ---*/ + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) + nodes->SetSensor(iPoint, fabs(iPoint_UndLapl[iPoint]) / jPoint_UndLapl[iPoint]); + } + + /*--- MPI parallelization ---*/ + + InitiateComms(geometry, config, SENSOR); + CompleteComms(geometry, config, SENSOR); + + } + /*! * \brief Destructor. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index fa211cd6437d..5c3d36cb91ca 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -197,21 +197,21 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetnMarker_Periodic() > 0); - - /*--- Loop domain points. ---*/ - - SU2_OMP_FOR_DYN(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - const bool boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); - const su2double Pressure_i = nodes->GetPressure(iPoint); - - /*--- Initialize. ---*/ - iPoint_UndLapl[iPoint] = 0.0; - jPoint_UndLapl[iPoint] = 0.0; - - /*--- Loop over the neighbors of point i. ---*/ - for (auto jPoint : geometry->nodes->GetPoints(iPoint)) - { - bool boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); - - /*--- If iPoint is boundary it only takes contributions from other boundary points. ---*/ - if (boundary_i && !boundary_j) continue; - - su2double Pressure_j = nodes->GetPressure(jPoint); - - /*--- Dissipation sensor, add pressure difference and pressure sum. ---*/ - iPoint_UndLapl[iPoint] += Pressure_j - Pressure_i; - jPoint_UndLapl[iPoint] += Pressure_j + Pressure_i; - } - - if (!isPeriodic) { - nodes->SetSensor(iPoint, fabs(iPoint_UndLapl[iPoint]) / jPoint_UndLapl[iPoint]); - } - } - - if (isPeriodic) { - /*--- Correct the sensor values across any periodic boundaries. ---*/ - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); + /*--- Define an object for the sensor variable, pressure. ---*/ + struct SensVar { + FORCEINLINE su2double operator() (const CEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetPressure(iPoint); } + } sensVar; - /*--- Set final pressure switch for each point ---*/ - - SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) - nodes->SetSensor(iPoint, fabs(iPoint_UndLapl[iPoint]) / jPoint_UndLapl[iPoint]); - } - - /*--- MPI parallelization ---*/ - - InitiateComms(geometry, config, SENSOR); - CompleteComms(geometry, config, SENSOR); - + /*--- Instantiate generic implementation. ---*/ + SetCentered_Dissipation_Sensor_impl(sensVar, geometry, config); } void CEulerSolver::SetUpwind_Ducros_Sensor(CGeometry *geometry, CConfig *config){ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 59091d3c8e62..271a09f8cf45 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1573,7 +1573,7 @@ void CIncEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_cont } -void CIncEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { +void CIncEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, const CConfig *config) { /*--- Define an object to compute the speed of sound. ---*/ struct SoundSpeed { @@ -1593,7 +1593,7 @@ void CIncEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { } -void CIncEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, CConfig *config) { +void CIncEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, const CConfig *config) { unsigned long iPoint, jPoint, iEdge; su2double *Diff; @@ -1652,84 +1652,17 @@ void CIncEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, CConfig *confi } -void CIncEulerSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config) { - - unsigned long iEdge, iPoint, jPoint; - su2double Pressure_i = 0.0, Pressure_j = 0.0; - bool boundary_i, boundary_j; - - /*--- Reset variables to store the undivided pressure ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - iPoint_UndLapl[iPoint] = 0.0; - jPoint_UndLapl[iPoint] = 0.0; - } - - /*--- Evaluate the pressure sensor ---*/ - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - /*--- Get the pressure, or density for incompressible solvers ---*/ - - Pressure_i = nodes->GetDensity(iPoint); - Pressure_j = nodes->GetDensity(jPoint); - - boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); - boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); - - /*--- Both points inside the domain, or both on the boundary ---*/ - - if ((!boundary_i && !boundary_j) || (boundary_i && boundary_j)) { - - if (geometry->nodes->GetDomain(iPoint)) { - iPoint_UndLapl[iPoint] += (Pressure_j - Pressure_i); - jPoint_UndLapl[iPoint] += (Pressure_i + Pressure_j); - } - - if (geometry->nodes->GetDomain(jPoint)) { - iPoint_UndLapl[jPoint] += (Pressure_i - Pressure_j); - jPoint_UndLapl[jPoint] += (Pressure_i + Pressure_j); - } +void CIncEulerSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, const CConfig *config) { + /*--- Define an object for the sensor variable, density. ---*/ + struct SensVar { + FORCEINLINE su2double operator() (const CIncEulerVariable& nodes, unsigned long iPoint) const { + return nodes.GetDensity(iPoint); } + } sensVar; - /*--- iPoint inside the domain, jPoint on the boundary ---*/ - - if (!boundary_i && boundary_j) - if (geometry->nodes->GetDomain(iPoint)) { - iPoint_UndLapl[iPoint] += (Pressure_j - Pressure_i); - jPoint_UndLapl[iPoint] += (Pressure_i + Pressure_j); - } - - /*--- jPoint inside the domain, iPoint on the boundary ---*/ - - if (boundary_i && !boundary_j) - if (geometry->nodes->GetDomain(jPoint)) { - iPoint_UndLapl[jPoint] += (Pressure_i - Pressure_j); - jPoint_UndLapl[jPoint] += (Pressure_i + Pressure_j); - } - - } - - /*--- Correct the sensor values across any periodic boundaries. ---*/ - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_SENSOR); - } - - /*--- Set pressure switch for each point ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) - nodes->SetSensor(iPoint,fabs(iPoint_UndLapl[iPoint]) / jPoint_UndLapl[iPoint]); - - /*--- MPI parallelization ---*/ - - InitiateComms(geometry, config, SENSOR); - CompleteComms(geometry, config, SENSOR); + /*--- Instantiate generic implementation. ---*/ + SetCentered_Dissipation_Sensor_impl(sensVar, geometry, config); } From 51883b8ba567a90b121344aa09ad18c568aa2a25 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 12:25:35 +0000 Subject: [PATCH 145/326] explicit iterations --- SU2_CFD/include/solvers/CEulerSolver.hpp | 7 - .../include/solvers/CFVMFlowSolverBase.hpp | 137 +++++++++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 108 +++++----- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 184 +++++++++--------- SU2_CFD/include/solvers/CSolver.hpp | 7 - SU2_CFD/src/solvers/CEulerSolver.cpp | 114 ----------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 124 +++--------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 84 +------- 8 files changed, 329 insertions(+), 436 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 9da2b823e569..34328be42b17 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -157,12 +157,6 @@ class CEulerSolver : public CFVMFlowSolverBase { /*--- End of Turbomachinery Solver Variables ---*/ - /*! - * \brief Generic implementation of explicit iterations (RK, Classic RK and EULER). - */ - template - void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep); - /*! * \brief Preprocessing actions common to the Euler and NS solvers. * \param[in] geometry - Geometrical definition of the problem. @@ -457,7 +451,6 @@ class CEulerSolver : public CFVMFlowSolverBase { */ void SetPreconditioner(const CConfig *config, unsigned long iPoint, su2double delta, su2double** preconditioner) const; - using CSolver::SetPreconditioner; /*--- Silence warning. ---*/ /*! * \brief Parallelization of Undivided Laplacian. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 6c2ea36af1ac..a7744b3d8f06 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -664,6 +664,143 @@ class CFVMFlowSolverBase : public CSolver { } + /*! + * \brief Generic implementation of explicit iterations with a preconditioner. + * \note The preconditioner is a functor implementing the methods: + * - compute(config, iPoint): Should prepare the preconditioner for iPoint. + * - apply(iVar, residual[], resTruncError[]): Apply it to compute the iVar update. + * See Explicit_Iteration for the general form of the preconditioner. + */ + template + void Explicit_Iteration_impl(ResidualPrecond& preconditioner, CGeometry *geometry, + CSolver **solver_container, CConfig *config, unsigned short iRKStep) { + + static_assert(IntegrationType == CLASSICAL_RK4_EXPLICIT || + IntegrationType == RUNGE_KUTTA_EXPLICIT || + IntegrationType == EULER_EXPLICIT, ""); + + const bool adjoint = config->GetContinuous_Adjoint(); + + const su2double RK_AlphaCoeff = config->Get_Alpha_RKStep(iRKStep); + + /*--- Hard-coded classical RK4 coefficients. Will be added to config. ---*/ + const su2double RK_FuncCoeff[] = {1.0/6.0, 1.0/3.0, 1.0/3.0, 1.0/6.0}; + const su2double RK_TimeCoeff[] = {0.5, 0.5, 1.0, 1.0}; + + /*--- Set shared residual variables to 0 and declare + * local ones for current thread to work on. ---*/ + + SU2_OMP_MASTER + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + SetRes_RMS(iVar, 0.0); + SetRes_Max(iVar, 0.0, 0); + } + SU2_OMP_BARRIER + + su2double resMax[MAXNVAR] = {0.0}, resRMS[MAXNVAR] = {0.0}; + const su2double* coordMax[MAXNVAR] = {nullptr}; + unsigned long idxMax[MAXNVAR] = {0}; + + /*--- Update the solution and residuals ---*/ + + if (!adjoint) { + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + + su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); + su2double Delta = nodes->GetDelta_Time(iPoint) / Vol; + + const su2double* Res_TruncError = nodes->GetResTruncError(iPoint); + const su2double* Residual = LinSysRes.GetBlock(iPoint); + + preconditioner.compute(config, iPoint); + + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + + su2double Res = preconditioner.apply(iVar, Residual, Res_TruncError); + + /*--- "Static" switch which should be optimized at compile time. ---*/ + switch(IntegrationType) { + + case EULER_EXPLICIT: + nodes->AddSolution(iPoint,iVar, -Res*Delta); + break; + + case RUNGE_KUTTA_EXPLICIT: + nodes->AddSolution(iPoint, iVar, -Res*Delta*RK_AlphaCoeff); + break; + + case CLASSICAL_RK4_EXPLICIT: + { + su2double tmp_time = -1.0*RK_TimeCoeff[iRKStep]*Delta; + su2double tmp_func = -1.0*RK_FuncCoeff[iRKStep]*Delta; + + if (iRKStep < 3) { + /* Base Solution Update */ + nodes->AddSolution(iPoint,iVar, tmp_time*Res); + + /* New Solution Update */ + nodes->AddSolution_New(iPoint,iVar, tmp_func*Res); + } else { + nodes->SetSolution(iPoint, iVar, nodes->GetSolution_New(iPoint, iVar) + tmp_func*Res); + } + } + break; + } + + /*--- Update residual information for current thread. ---*/ + resRMS[iVar] += Res*Res; + if (fabs(Res) > resMax[iVar]) { + resMax[iVar] = fabs(Res); + idxMax[iVar] = iPoint; + coordMax[iVar] = geometry->nodes->GetCoord(iPoint); + } + } + } + /*--- Reduce residual information over all threads in this rank. ---*/ + SU2_OMP_CRITICAL + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + AddRes_RMS(iVar, resRMS[iVar]); + AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); + } + SU2_OMP_BARRIER + } + + /*--- MPI solution ---*/ + + InitiateComms(geometry, config, SOLUTION); + CompleteComms(geometry, config, SOLUTION); + + if (!adjoint) { + SU2_OMP_MASTER { + /*--- Compute the root mean square residual ---*/ + + SetResidual_RMS(geometry, config); + + /*--- For verification cases, compute the global error metrics. ---*/ + + ComputeVerificationError(geometry, config); + } + SU2_OMP_BARRIER + } + + } + + /*! + * \brief Generic implementation of explicit iterations without preconditioner. + */ + template + FORCEINLINE void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep) { + struct Identity { + FORCEINLINE void compute(const CConfig*, unsigned long) {} + FORCEINLINE su2double apply(unsigned short iVar, const su2double* res, const su2double* resTrunc) { + return res[iVar] + resTrunc[iVar]; + } + } precond; + + Explicit_Iteration_impl(precond, geometry, solver_container, config, iRKStep); + } + /*! * \brief Destructor. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 5c3d36cb91ca..2a7283828748 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -46,6 +46,44 @@ class CIncEulerSolver : public CFVMFlowSolverBase a,std::vector b); + /*! + * \brief Generic implementation of explicit iterations with preconditioner. + */ + template + void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep); + /*! * \brief Update the solution using a Runge-Kutta scheme. * \param[in] geometry - Geometrical definition of the problem. @@ -289,6 +288,18 @@ class CIncEulerSolver : public CFVMFlowSolverBase -void CEulerSolver::Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iRKStep) { - - static_assert(IntegrationType == CLASSICAL_RK4_EXPLICIT || - IntegrationType == RUNGE_KUTTA_EXPLICIT || - IntegrationType == EULER_EXPLICIT, ""); - - const bool adjoint = config->GetContinuous_Adjoint(); - - const su2double RK_AlphaCoeff = config->Get_Alpha_RKStep(iRKStep); - - /*--- Hard-coded classical RK4 coefficients. Will be added to config. ---*/ - const su2double RK_FuncCoeff[] = {1.0/6.0, 1.0/3.0, 1.0/3.0, 1.0/6.0}; - const su2double RK_TimeCoeff[] = {0.5, 0.5, 1.0, 1.0}; - - /*--- Set shared residual variables to 0 and declare - * local ones for current thread to work on. ---*/ - - SU2_OMP_MASTER - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - SU2_OMP_BARRIER - - su2double resMax[MAXNVAR] = {0.0}, resRMS[MAXNVAR] = {0.0}; - const su2double* coordMax[MAXNVAR] = {nullptr}; - unsigned long idxMax[MAXNVAR] = {0}; - - /*--- Update the solution and residuals ---*/ - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - - su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); - su2double Delta = nodes->GetDelta_Time(iPoint) / Vol; - - const su2double* Res_TruncError = nodes->GetResTruncError(iPoint); - const su2double* Residual = LinSysRes.GetBlock(iPoint); - - if (!adjoint) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - - su2double Res = Residual[iVar] + Res_TruncError[iVar]; - - /*--- "Static" switch which should be optimized at compile time. ---*/ - switch(IntegrationType) { - - case EULER_EXPLICIT: - nodes->AddSolution(iPoint,iVar, -Res*Delta); - break; - - case RUNGE_KUTTA_EXPLICIT: - nodes->AddSolution(iPoint, iVar, -Res*Delta*RK_AlphaCoeff); - break; - - case CLASSICAL_RK4_EXPLICIT: - { - su2double tmp_time = -1.0*RK_TimeCoeff[iRKStep]*Delta; - su2double tmp_func = -1.0*RK_FuncCoeff[iRKStep]*Delta; - - if (iRKStep < 3) { - /* Base Solution Update */ - nodes->AddSolution(iPoint,iVar, tmp_time*Res); - - /* New Solution Update */ - nodes->AddSolution_New(iPoint,iVar, tmp_func*Res); - } else { - nodes->SetSolution(iPoint, iVar, nodes->GetSolution_New(iPoint, iVar) + tmp_func*Res); - } - } - break; - } - - /*--- Update residual information for current thread. ---*/ - resRMS[iVar] += Res*Res; - if (fabs(Res) > resMax[iVar]) { - resMax[iVar] = fabs(Res); - idxMax[iVar] = iPoint; - coordMax[iVar] = geometry->nodes->GetCoord(iPoint); - } - } - } - } - if (!adjoint) { - /*--- Reduce residual information over all threads in this rank. ---*/ - SU2_OMP_CRITICAL - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - AddRes_RMS(iVar, resRMS[iVar]); - AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); - } - } - SU2_OMP_BARRIER - - /*--- MPI solution ---*/ - - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - - SU2_OMP_MASTER - { - /*--- Compute the root mean square residual ---*/ - - SetResidual_RMS(geometry, config); - - /*--- For verification cases, compute the global error metrics. ---*/ - - ComputeVerificationError(geometry, config); - } - SU2_OMP_BARRIER - -} - void CEulerSolver::ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 271a09f8cf45..ffc8c8ca885d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -992,9 +992,6 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai } -void CIncEulerSolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) { } - unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { unsigned long iPoint, nonPhysicalPoints = 0; @@ -1666,109 +1663,48 @@ void CIncEulerSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, const } -void CIncEulerSolver::ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iRKStep) { - - su2double *Residual, *Res_TruncError, Vol, Delta, Res; - unsigned short iVar, jVar; - unsigned long iPoint; - - su2double RK_AlphaCoeff = config->Get_Alpha_RKStep(iRKStep); - bool adjoint = config->GetContinuous_Adjoint(); - - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Update the solution ---*/ +template +FORCEINLINE void CIncEulerSolver::Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep) { + struct Precond { + CIncEulerSolver* solver; + const su2double* const* matrix; + unsigned short nVar; - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - Vol = (geometry->nodes->GetVolume(iPoint) + - geometry->nodes->GetPeriodicVolume(iPoint)); - Delta = nodes->GetDelta_Time(iPoint) / Vol; + Precond(CIncEulerSolver* s, const su2double* const* m, unsigned short n) : + solver(s), matrix(m), nVar(n) {} - Res_TruncError = nodes->GetResTruncError(iPoint); - Residual = LinSysRes.GetBlock(iPoint); - - if (!adjoint) { - SetPreconditioner(config, iPoint); - for (iVar = 0; iVar < nVar; iVar ++ ) { - Res = 0.0; - for (jVar = 0; jVar < nVar; jVar ++ ) - Res += Preconditioner[iVar][jVar]*(Residual[jVar] + Res_TruncError[jVar]); - nodes->AddSolution(iPoint,iVar, -Res*Delta*RK_AlphaCoeff); - AddRes_RMS(iVar, Res*Res); - AddRes_Max(iVar, fabs(Res), geometry->nodes->GetGlobalIndex(iPoint), geometry->nodes->GetCoord(iPoint)); - } + FORCEINLINE void compute(const CConfig* config, unsigned long iPoint) { + /// TODO: This is not thread-safe, this function needs to return by value. + solver->SetPreconditioner(config, iPoint); } - } - - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); + FORCEINLINE su2double apply(unsigned short iVar, const su2double* res, const su2double* resTrunc) { + su2double resPrec = 0.0; + for (unsigned short jVar = 0; jVar < nVar; ++jVar) + resPrec += matrix[iVar][jVar] * (res[jVar] + resTrunc[jVar]); + return resPrec; + } + } precond(this, Preconditioner, nVar); - /*--- Compute the root mean square residual ---*/ + Explicit_Iteration_impl(precond, geometry, solver_container, config, iRKStep); +} - SetResidual_RMS(geometry, config); +void CIncEulerSolver::ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep) { - /*--- For verification cases, compute the global error metrics. ---*/ + Explicit_Iteration(geometry, solver_container, config, iRKStep); +} - ComputeVerificationError(geometry, config); +void CIncEulerSolver::ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep) { + Explicit_Iteration(geometry, solver_container, config, iRKStep); } void CIncEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - su2double *local_Residual, *local_Res_TruncError, Vol, Delta, Res; - unsigned short iVar, jVar; - unsigned long iPoint; - - bool adjoint = config->GetContinuous_Adjoint(); - - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Update the solution ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - Vol = (geometry->nodes->GetVolume(iPoint) + - geometry->nodes->GetPeriodicVolume(iPoint)); - Delta = nodes->GetDelta_Time(iPoint) / Vol; - - local_Res_TruncError = nodes->GetResTruncError(iPoint); - local_Residual = LinSysRes.GetBlock(iPoint); - - - if (!adjoint) { - SetPreconditioner(config, iPoint); - for (iVar = 0; iVar < nVar; iVar ++ ) { - Res = 0.0; - for (jVar = 0; jVar < nVar; jVar ++ ) - Res += Preconditioner[iVar][jVar]*(local_Residual[jVar] + local_Res_TruncError[jVar]); - nodes->AddSolution(iPoint,iVar, -Res*Delta); - AddRes_RMS(iVar, Res*Res); - AddRes_Max(iVar, fabs(Res), geometry->nodes->GetGlobalIndex(iPoint), geometry->nodes->GetCoord(iPoint)); - } - } - } - - /*--- MPI solution ---*/ - - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - - /*--- Compute the root mean square residual ---*/ - - SetResidual_RMS(geometry, config); - - /*--- For verification cases, compute the global error metrics. ---*/ - - ComputeVerificationError(geometry, config); - + Explicit_Iteration(geometry, solver_container, config, 0); } void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { @@ -1927,7 +1863,7 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co } -void CIncEulerSolver::SetPreconditioner(CConfig *config, unsigned long iPoint) { +void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint) { unsigned short iDim, jDim; diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index d0cfe25f9e47..a86c60d2fadf 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1057,87 +1057,21 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con } } -void CNEMOEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - - su2double *local_Residual, *local_Res_TruncError, Vol, Delta, Res; - unsigned short iVar; - unsigned long iPoint; - - bool adjoint = config->GetContinuous_Adjoint(); - - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Update the solution ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - Vol = (geometry->nodes->GetVolume(iPoint) + - geometry->nodes->GetPeriodicVolume(iPoint)); - - Delta = nodes->GetDelta_Time(iPoint) / Vol; - - local_Res_TruncError = nodes->GetResTruncError(iPoint); - local_Residual = LinSysRes.GetBlock(iPoint); - - if (!adjoint) { - for (iVar = 0; iVar < nVar; iVar++) { - - Res = local_Residual[iVar] + local_Res_TruncError[iVar]; - nodes->AddSolution(iPoint, iVar, -Res*Delta); - AddRes_RMS(iVar, Res*Res); - AddRes_Max(iVar, fabs(Res), geometry->nodes->GetGlobalIndex(iPoint), geometry->nodes->GetCoord(iPoint)); - - } - } - } - - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - - /*--- Compute the root mean square residual ---*/ - SetResidual_RMS(geometry, config); +void CNEMOEulerSolver::ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep) { + Explicit_Iteration(geometry, solver_container, config, iRKStep); } -void CNEMOEulerSolver::ExplicitRK_Iteration(CGeometry *geometry,CSolver **solver_container, CConfig *config, unsigned short iRKStep) { - - su2double *Residual, *Res_TruncError, Vol, Delta, Res; - unsigned short iVar; - unsigned long iPoint; - - su2double RK_AlphaCoeff = config->Get_Alpha_RKStep(iRKStep); +void CNEMOEulerSolver::ClassicalRK4_Iteration(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep) { - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Update the solution ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - Vol = geometry-> nodes->GetVolume(iPoint); - Delta = nodes->GetDelta_Time(iPoint) / Vol; - - Res_TruncError = nodes->GetResTruncError(iPoint); - Residual = LinSysRes.GetBlock(iPoint); - - for (iVar = 0; iVar < nVar; iVar++) { - Res = Residual[iVar] + Res_TruncError[iVar]; - nodes->AddSolution(iPoint,iVar, -Res*Delta*RK_AlphaCoeff); - AddRes_RMS(iVar, Res*Res); - AddRes_Max(iVar, fabs(Res), geometry-> nodes->GetGlobalIndex(iPoint),geometry->nodes->GetCoord(iPoint)); - } - } - - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); + Explicit_Iteration(geometry, solver_container, config, iRKStep); +} - /*--- Compute the root mean square residual ---*/ - SetResidual_RMS(geometry, config); +void CNEMOEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { + Explicit_Iteration(geometry, solver_container, config, 0); } void CNEMOEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { From 5cb9f710ba35f12f32e407537a42ca47fb4d3c0e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 12:38:29 +0000 Subject: [PATCH 146/326] update channel2D --- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 286a4cb1105e..5a01f8177fd6 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -987,7 +987,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.398053, 0.352779, 0.405462] + channel_2D.test_vals = [2.000000, 0.000000, 0.397970, 0.352779, 0.405462] channel_2D.su2_exec = "parallel_computation.py -f" channel_2D.timeout = 100 channel_2D.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 6604a107f87c..2a2f8e9f0cd8 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1144,7 +1144,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.397985, 0.352786, 0.405475] #last 4 columns + channel_2D.test_vals = [2.000000, 0.000000, 0.398017, 0.352786, 0.405475] #last 4 columns channel_2D.su2_exec = "SU2_CFD" channel_2D.timeout = 100 channel_2D.tol = 0.00001 From 4fddf413bd717eb8202b9f603fcb7c7bd9bf0786 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 15:00:09 +0000 Subject: [PATCH 147/326] refactor preprocessing of incompressible solvers --- SU2_CFD/include/solvers/CEulerSolver.hpp | 5 +- .../include/solvers/CFVMFlowSolverBase.hpp | 2 + SU2_CFD/include/solvers/CIncEulerSolver.hpp | 15 +- SU2_CFD/include/solvers/CIncNSSolver.hpp | 4 +- SU2_CFD/include/solvers/CNSSolver.hpp | 3 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 4 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 110 +++++++------ SU2_CFD/src/solvers/CIncNSSolver.cpp | 147 ++++++++---------- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 9 files changed, 143 insertions(+), 149 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 34328be42b17..44f5b94f22ca 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -114,8 +114,6 @@ class CEulerSolver : public CFVMFlowSolverBase { vector FluidModel; /*!< \brief fluid model used in the solver. */ - unsigned long ErrorCounter = 0; /*!< \brief Counter for number of un-physical states. */ - /*--- Turbomachinery Solver Variables ---*/ su2double ***AverageFlux = nullptr, @@ -257,11 +255,10 @@ class CEulerSolver : public CFVMFlowSolverBase { * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. - * \param[in] Output - boolean to determine whether to print output. * \return - The number of non-physical points. */ virtual unsigned long SetPrimitive_Variables(CSolver **solver_container, - CConfig *config, bool Output); + const CConfig *config); /*! * \brief Set gradients of coefficients for fixed CL mode diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index a7744b3d8f06..99a29b671f41 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -59,6 +59,8 @@ class CFVMFlowSolverBase : public CSolver { su2double Global_Delta_Time = 0.0, /*!< \brief Time-step for TIME_STEPPING time marching strategy. */ Global_Delta_UnstTimeND = 0.0; /*!< \brief Unsteady time step for the dual time strategy. */ + unsigned long ErrorCounter = 0; /*!< \brief Counter for number of un-physical states. */ + /*! * \brief Auxilary types to store common aero coefficients (avoids repeating oneself so much). */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 2a7283828748..49e9e64c29b1 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -46,6 +46,18 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetComm_Level() == COMM_FULL)) { SU2_OMP_BARRIER @@ -2305,7 +2305,7 @@ void CEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } } -unsigned long CEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { +unsigned long CEulerSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { /*--- Number of non-physical points, local to the thread, needs * further reduction if function is called in parallel ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index ffc8c8ca885d..ad37b4dd648d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -919,50 +919,39 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve } } -void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { +void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, + unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - unsigned long ErrorCounter = 0; - - unsigned long InnerIter = config->GetInnerIter(); - bool cont_adjoint = config->GetContinuous_Adjoint(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool muscl = (config->GetMUSCL_Flow() || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == ROE)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); - bool center_jst = center && (config->GetKind_Centered_Flow() == JST); - bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; - bool outlet = ((config->GetnMarker_Outlet() != 0)); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); + const bool center_jst = (config->GetKind_Centered_Flow() == JST) && (iMesh == MESH_0); + const bool outlet = (config->GetnMarker_Outlet() != 0); /*--- Set the primitive variables ---*/ - ErrorCounter = SetPrimitive_Variables(solver_container, config, Output); + SU2_OMP_MASTER + ErrorCounter = 0; + SU2_OMP_BARRIER - /*--- Upwind second order reconstruction ---*/ - - if ((muscl && !center) && (iMesh == MESH_0) && !Output) { - - /*--- Gradient computation for MUSCL reconstruction. ---*/ + SU2_OMP_ATOMIC + ErrorCounter += SetPrimitive_Variables(solver_container, config); - if (config->GetKind_Gradient_Method_Recon() == GREEN_GAUSS) - SetPrimitive_Gradient_GG(geometry, config, true); - if (config->GetKind_Gradient_Method_Recon() == LEAST_SQUARES) - SetPrimitive_Gradient_LS(geometry, config, true); - if (config->GetKind_Gradient_Method_Recon() == WEIGHTED_LEAST_SQUARES) - SetPrimitive_Gradient_LS(geometry, config, true); - - /*--- Limiter computation ---*/ - - if ((limiter) && (iMesh == MESH_0) && !Output && !van_albada) { - SetPrimitive_Limiter(geometry, config); + if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { + SU2_OMP_BARRIER + SU2_OMP_MASTER + { + unsigned long tmp = ErrorCounter; + SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + config->SetNonphysical_Points(ErrorCounter); } - + SU2_OMP_BARRIER } /*--- Artificial dissipation ---*/ if (center && !Output) { SetMax_Eigenvalue(geometry, config); - if ((center_jst) && (iMesh == MESH_0)) { + if (center_jst) { SetCentered_Dissipation_Sensor(geometry, config); SetUndivided_Laplacian(geometry, config); } @@ -976,41 +965,64 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- Initialize the Jacobian matrices ---*/ + /*--- Initialize the Jacobian matrix and residual, not needed for the reducer strategy + * as we set blocks (including diagonal ones) and completely overwrite. ---*/ - if (implicit && !Output) Jacobian.SetValZero(); + if(!ReducerStrategy && !Output) { + LinSysRes.SetValZero(); + if (implicit) Jacobian.SetValZero(); + else {SU2_OMP_BARRIER} // because of "nowait" in LinSysRes + } +} - /*--- Error message ---*/ +void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, + unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - if (config->GetComm_Level() == COMM_FULL) { -#ifdef HAVE_MPI - unsigned long MyErrorCounter = ErrorCounter; ErrorCounter = 0; - SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); -#endif - if (iMesh == MESH_0) config->SetNonphysical_Points(ErrorCounter); - } + const auto InnerIter = config->GetInnerIter(); + const bool muscl = config->GetMUSCL_Flow() && (iMesh == MESH_0); + const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); + + /*--- Common preprocessing steps. ---*/ + + CommonPreprocessing(geometry, solver_container, config, iMesh, iRKStep, RunTime_EqSystem, Output); + + /*--- Upwind second order reconstruction ---*/ + + if (!Output && muscl && !center) { + + /*--- Gradient computation for MUSCL reconstruction. ---*/ + switch (config->GetKind_Gradient_Method_Recon()) { + case GREEN_GAUSS: + SetPrimitive_Gradient_GG(geometry, config, true); break; + case LEAST_SQUARES: + case WEIGHTED_LEAST_SQUARES: + SetPrimitive_Gradient_LS(geometry, config, true); break; + default: break; + } + + /*--- Limiter computation ---*/ + + if (limiter && !van_albada) SetPrimitive_Limiter(geometry, config); + } } -unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { +unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { unsigned long iPoint, nonPhysicalPoints = 0; - bool physical = true; + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPoint; iPoint ++) { /*--- Incompressible flow, primitive variables ---*/ - physical = nodes->SetPrimVar(iPoint,FluidModel); + auto physical = nodes->SetPrimVar(iPoint,FluidModel); /* Check for non-realizable states for reporting. */ if (!physical) nonPhysicalPoints++; - - /*--- Initialize the convective, source and viscous residual vector ---*/ - - if (!Output) LinSysRes.SetBlock_Zero(iPoint); - } return nonPhysicalPoints; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 972c8d1c6c1f..d2e58c66d8b6 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -54,35 +54,30 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short } } -void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - - unsigned long iPoint, ErrorCounter = 0; - su2double StrainMag = 0.0, Omega = 0.0, *Vorticity; - - unsigned long InnerIter = config->GetInnerIter(); - bool cont_adjoint = config->GetContinuous_Adjoint(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); - bool center_jst = center && config->GetKind_Centered_Flow() == JST; - bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter())); - bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; - bool outlet = ((config->GetnMarker_Outlet() != 0)); - - /*--- Set the primitive variables ---*/ - - ErrorCounter = SetPrimitive_Variables(solver_container, config, Output); - - /*--- Compute gradient for MUSCL reconstruction. ---*/ - - if (config->GetReconstructionGradientRequired() && (iMesh == MESH_0)) { - if (config->GetKind_Gradient_Method_Recon() == GREEN_GAUSS) - SetPrimitive_Gradient_GG(geometry, config, true); - if (config->GetKind_Gradient_Method_Recon() == LEAST_SQUARES) - SetPrimitive_Gradient_LS(geometry, config, true); - if (config->GetKind_Gradient_Method_Recon() == WEIGHTED_LEAST_SQUARES) - SetPrimitive_Gradient_LS(geometry, config, true); +void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, + unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { + + const auto InnerIter = config->GetInnerIter(); + const bool muscl = config->GetMUSCL_Flow() && (iMesh == MESH_0); + const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); + + /*--- Common preprocessing steps (implemented by CEulerSolver) ---*/ + + CommonPreprocessing(geometry, solver_container, config, iMesh, iRKStep, RunTime_EqSystem, Output); + + /*--- Compute gradient for MUSCL reconstruction ---*/ + + if (config->GetReconstructionGradientRequired() && muscl && !center) { + switch (config->GetKind_Gradient_Method_Recon()) { + case GREEN_GAUSS: + SetPrimitive_Gradient_GG(geometry, config, true); break; + case LEAST_SQUARES: + case WEIGHTED_LEAST_SQUARES: + SetPrimitive_Gradient_LS(geometry, config, true); break; + default: break; + } } /*--- Compute gradient of the primitive variables ---*/ @@ -90,84 +85,68 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (config->GetKind_Gradient_Method() == GREEN_GAUSS) { SetPrimitive_Gradient_GG(geometry, config); } - if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { + else if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { SetPrimitive_Gradient_LS(geometry, config); } - /*--- Compute the limiter in case we need it in the turbulence model - or to limit the viscous terms (check this logic with JST and 2nd order turbulence model) ---*/ - - if ((iMesh == MESH_0) && (limiter_flow || limiter_turb || limiter_adjflow) - && !Output && !van_albada) { SetPrimitive_Limiter(geometry, config); } + /*--- Compute the limiters ---*/ - /*--- Artificial dissipation for centered schemes. ---*/ - - if (center && !Output) { - SetMax_Eigenvalue(geometry, config); - if ((center_jst) && (iMesh == MESH_0)) { - SetCentered_Dissipation_Sensor(geometry, config); - SetUndivided_Laplacian(geometry, config); - } + if (muscl && !center && limiter && !van_albada && !Output) { + SetPrimitive_Limiter(geometry, config); } - /*--- Update the beta value based on the maximum velocity / viscosity. ---*/ - - SetBeta_Parameter(geometry, solver_container, config, iMesh); - - /*--- Compute properties needed for mass flow BCs. ---*/ - - if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); - /*--- Evaluate the vorticity and strain rate magnitude ---*/ - nodes->SetVorticity_StrainMag(); - - StrainMag_Max = 0.0; Omega_Max = 0.0; - for (iPoint = 0; iPoint < nPoint; iPoint++) { - - StrainMag = nodes->GetStrainMag(iPoint); - Vorticity = nodes->GetVorticity(iPoint); - Omega = sqrt(Vorticity[0]*Vorticity[0]+ Vorticity[1]*Vorticity[1]+ Vorticity[2]*Vorticity[2]); - - StrainMag_Max = max(StrainMag_Max, StrainMag); - Omega_Max = max(Omega_Max, Omega); - + SU2_OMP_MASTER + { + StrainMag_Max = 0.0; + Omega_Max = 0.0; } + SU2_OMP_BARRIER - /*--- Initialize the Jacobian matrices ---*/ - - if (implicit && !Output) Jacobian.SetValZero(); - - /*--- Error message ---*/ + nodes->SetVorticity_StrainMag(); - if (config->GetComm_Level() == COMM_FULL) { + /*--- Min and Max are not really differentiable ---*/ + const bool wasActive = AD::BeginPassive(); -#ifdef HAVE_MPI - unsigned long MyErrorCounter = ErrorCounter; ErrorCounter = 0; - su2double MyOmega_Max = Omega_Max; Omega_Max = 0.0; - su2double MyStrainMag_Max = StrainMag_Max; StrainMag_Max = 0.0; + su2double strainMax = 0.0, omegaMax = 0.0; - SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); -#endif + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { + strainMax = max(strainMax, nodes->GetStrainMag(iPoint)); + omegaMax = max(omegaMax, GeometryToolbox::Norm(3, nodes->GetVorticity(iPoint))); + } + SU2_OMP_CRITICAL { + StrainMag_Max = max(StrainMag_Max, strainMax); + Omega_Max = max(Omega_Max, omegaMax); + } - if (iMesh == MESH_0) - config->SetNonphysical_Points(ErrorCounter); + if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { + SU2_OMP_BARRIER + SU2_OMP_MASTER + { + su2double MyOmega_Max = Omega_Max; + su2double MyStrainMag_Max = StrainMag_Max; + SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + } + SU2_OMP_BARRIER } + AD::EndPassive(wasActive); + } -unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { +unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { unsigned long iPoint, nonPhysicalPoints = 0; su2double eddy_visc = 0.0, turb_ke = 0.0, DES_LengthScale = 0.0; unsigned short turb_model = config->GetKind_Turb_Model(); - bool physical = true; bool tkeNeeded = ((turb_model == SST) || (turb_model == SST_SUST)); + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPoint; iPoint++) { /*--- Retrieve the value of the kinetic energy (if needed) ---*/ @@ -183,7 +162,7 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, C /*--- Incompressible flow, primitive variables --- */ - physical = static_cast(nodes)->SetPrimVar(iPoint,eddy_visc, turb_ke, FluidModel); + bool physical = static_cast(nodes)->SetPrimVar(iPoint,eddy_visc, turb_ke, FluidModel); /* Check for non-realizable states for reporting. */ @@ -193,10 +172,6 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, C nodes->SetDES_LengthScale(iPoint,DES_LengthScale); - /*--- Initialize the convective, source and viscous residual vector ---*/ - - if (!Output) LinSysRes.SetBlock_Zero(iPoint); - } return nonPhysicalPoints; diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 9ea15c36e10a..7a1173f09fe8 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -197,7 +197,7 @@ void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, C } -unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { +unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { /*--- Number of non-physical points, local to the thread, needs * further reduction if function is called in parallel ---*/ From f522924758b48b977fbcc11d0b7e310cb13f05de Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 15:37:45 +0000 Subject: [PATCH 148/326] vorticity and strain mag, cleanup IncEuler boundaries --- SU2_CFD/include/solvers/CEulerSolver.hpp | 14 +- .../include/solvers/CFEM_DG_EulerSolver.hpp | 1 - .../include/solvers/CFVMFlowSolverBase.hpp | 44 ++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 54 +- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CSolver.hpp | 31 - SU2_CFD/src/solvers/CIncEulerSolver.cpp | 632 ++++++++---------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 41 +- SU2_CFD/src/solvers/CNSSolver.cpp | 41 +- 9 files changed, 375 insertions(+), 485 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 44f5b94f22ca..83e423e2c6ea 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -273,6 +273,13 @@ class CEulerSolver : public CFVMFlowSolverBase { */ void InstantiateEdgeNumerics(const CSolver* const* solvers, const CConfig* config) final; + /*! + * \brief Set the solver nondimensionalization. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + */ + void SetNondimensionalization(CConfig *config, unsigned short iMesh); + public: /*! * \brief Constructor of the class. @@ -293,13 +300,6 @@ class CEulerSolver : public CFVMFlowSolverBase { */ ~CEulerSolver(void) override; - /*! - * \brief Set the solver nondimensionalization. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - Index of the mesh in multigrid computations. - */ - void SetNondimensionalization(CConfig *config, unsigned short iMesh) final; - /*! * \brief Compute the pressure at the infinity. * \return Value of the pressure at the infinity. diff --git a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp index aa41b64a18f9..bff89172fe9d 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp @@ -306,7 +306,6 @@ class CFEM_DG_EulerSolver : public CSolver { void SetNondimensionalization(CConfig *config, unsigned short iMesh, const bool writeOutput); - using CSolver::SetNondimensionalization; /*! * \brief Get a pointer to the vector of the solution degrees of freedom. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 99a29b671f41..e26655d209cf 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -803,6 +803,50 @@ class CFVMFlowSolverBase : public CSolver { Explicit_Iteration_impl(precond, geometry, solver_container, config, iRKStep); } + /*! + * \brief Evaluate the vorticity and strain rate magnitude. + */ + inline void ComputeVorticityAndStrainMag(const CConfig& config, unsigned short iMesh) { + + SU2_OMP_MASTER { + StrainMag_Max = 0.0; + Omega_Max = 0.0; + } + SU2_OMP_BARRIER + + nodes->SetVorticity_StrainMag(); + + /*--- Min and Max are not really differentiable ---*/ + const bool wasActive = AD::BeginPassive(); + + su2double strainMax = 0.0, omegaMax = 0.0; + + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { + strainMax = max(strainMax, nodes->GetStrainMag(iPoint)); + omegaMax = max(omegaMax, GeometryToolbox::Norm(3, nodes->GetVorticity(iPoint))); + } + SU2_OMP_CRITICAL { + StrainMag_Max = max(StrainMag_Max, strainMax); + Omega_Max = max(Omega_Max, omegaMax); + } + + if ((iMesh == MESH_0) && (config.GetComm_Level() == COMM_FULL)) { + SU2_OMP_BARRIER + SU2_OMP_MASTER + { + su2double MyOmega_Max = Omega_Max; + su2double MyStrainMag_Max = StrainMag_Max; + + SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + } + SU2_OMP_BARRIER + } + + AD::EndPassive(wasActive); + } + /*! * \brief Destructor. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 49e9e64c29b1..ac3af84a40e9 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -95,6 +95,33 @@ class CIncEulerSolver : public CFVMFlowSolverBaseTRUE means that it is an adjoint solver. @@ -2228,18 +2221,6 @@ class CSolver { */ inline virtual su2double GetInflow_MassFlow(unsigned short val_marker) const { return 0; } - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - * \param[in] Output - boolean to determine whether to print output. - */ - inline virtual void GetOutlet_Properties(CGeometry *geometry, - CConfig *config, - unsigned short iMesh, - bool Output) { } - /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. @@ -4307,18 +4288,6 @@ class CSolver { */ inline virtual void SetFreeStream_TurboSolution(CConfig *config) { } - /*! - * \brief A virtual member. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - */ - inline virtual void SetBeta_Parameter(CGeometry *geometry, - CSolver **solver_container, - CConfig *config, - unsigned short iMesh) { } - /*! * \brief A virtual member. * \param[in] geometry - Geometrical definition. diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index ad37b4dd648d..367e265032cc 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1832,7 +1832,7 @@ void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **sol } void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh) { + CConfig *config, unsigned short iMesh) { su2double epsilon2 = config->GetBeta_Factor(); su2double epsilon2_default = 4.1; @@ -1856,10 +1856,8 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co /*--- Communicate the max globally to give a conservative estimate. ---*/ -#ifdef HAVE_MPI su2double myMaxVel2 = maxVel2; maxVel2 = 0.0; SU2_MPI::Allreduce(&myMaxVel2, &maxVel2, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); -#endif Beta = max(1e-10,maxVel2); config->SetMax_Vel2(Beta); @@ -1979,132 +1977,123 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain unsigned short iDim; unsigned long iVertex, iPoint, Point_Normal; - su2double *V_infty, *V_domain; - - bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT; - bool viscous = config->GetViscous(); + const bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT; + const bool viscous = config->GetViscous(); - su2double *Normal = new su2double[nDim]; + su2double Normal[MAXNDIM] = {0.0}; /*--- Loop over all the vertices on this boundary marker ---*/ for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); - /*--- Allocate the value at the infinity ---*/ - - V_infty = GetCharacPrimVar(val_marker, iVertex); - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Index of the closest interior node ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + /*--- Allocate the value at the infinity ---*/ - /*--- Normal vector for this vertex (negate for outward convention) ---*/ + auto V_infty = GetCharacPrimVar(val_marker, iVertex); - geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; - conv_numerics->SetNormal(Normal); + /*--- Index of the closest interior node ---*/ - /*--- Retrieve solution at the farfield boundary node ---*/ + Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - V_domain = nodes->GetPrimitive(iPoint); + /*--- Normal vector for this vertex (negate for outward convention) ---*/ - /*--- Recompute and store the velocity in the primitive variable vector. ---*/ + geometry->vertex[val_marker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + conv_numerics->SetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) - V_infty[iDim+1] = GetVelocity_Inf(iDim); + /*--- Retrieve solution at the farfield boundary node ---*/ - /*--- Far-field pressure set to static pressure (0.0). ---*/ + auto V_domain = nodes->GetPrimitive(iPoint); - V_infty[0] = GetPressure_Inf(); + /*--- Recompute and store the velocity in the primitive variable vector. ---*/ - /*--- Dirichlet condition for temperature at far-field (if energy is active). ---*/ + for (iDim = 0; iDim < nDim; iDim++) + V_infty[iDim+1] = GetVelocity_Inf(iDim); - V_infty[nDim+1] = GetTemperature_Inf(); + /*--- Far-field pressure set to static pressure (0.0). ---*/ - /*--- Store the density. ---*/ + V_infty[0] = GetPressure_Inf(); - V_infty[nDim+2] = GetDensity_Inf(); + /*--- Dirichlet condition for temperature at far-field (if energy is active). ---*/ - /*--- Beta coefficient stored at the node ---*/ + V_infty[nDim+1] = GetTemperature_Inf(); - V_infty[nDim+3] = nodes->GetBetaInc2(iPoint); + /*--- Store the density. ---*/ - /*--- Cp is needed for Temperature equation. ---*/ + V_infty[nDim+2] = GetDensity_Inf(); - V_infty[nDim+7] = nodes->GetSpecificHeatCp(iPoint); + /*--- Beta coefficient stored at the node ---*/ - /*--- Set various quantities in the numerics class ---*/ + V_infty[nDim+3] = nodes->GetBetaInc2(iPoint); - conv_numerics->SetPrimitive(V_domain, V_infty); + /*--- Cp is needed for Temperature equation. ---*/ - if (dynamic_grid) - conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), - geometry->nodes->GetGridVel(iPoint)); + V_infty[nDim+7] = nodes->GetSpecificHeatCp(iPoint); - /*--- Compute the convective residual using an upwind scheme ---*/ + /*--- Set various quantities in the numerics class ---*/ - auto residual = conv_numerics->ComputeResidual(config); + conv_numerics->SetPrimitive(V_domain, V_infty); - /*--- Update residual value ---*/ + if (dynamic_grid) + conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), + geometry->nodes->GetGridVel(iPoint)); - LinSysRes.AddBlock(iPoint, residual); + /*--- Compute the convective residual using an upwind scheme ---*/ - /*--- Convective Jacobian contribution for implicit integration ---*/ + auto residual = conv_numerics->ComputeResidual(config); - if (implicit) - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + /*--- Update residual value ---*/ - /*--- Viscous residual contribution ---*/ + LinSysRes.AddBlock(iPoint, residual); - if (viscous) { + /*--- Convective Jacobian contribution for implicit integration ---*/ - /*--- Set transport properties at infinity. ---*/ + if (implicit) + Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - V_infty[nDim+4] = nodes->GetLaminarViscosity(iPoint); - V_infty[nDim+5] = nodes->GetEddyViscosity(iPoint); - V_infty[nDim+6] = nodes->GetThermalConductivity(iPoint); + /*--- Viscous residual contribution ---*/ - /*--- Set the normal vector and the coordinates ---*/ + if (!viscous) continue; - visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + /*--- Set transport properties at infinity. ---*/ - /*--- Primitive variables, and gradient ---*/ + V_infty[nDim+4] = nodes->GetLaminarViscosity(iPoint); + V_infty[nDim+5] = nodes->GetEddyViscosity(iPoint); + V_infty[nDim+6] = nodes->GetThermalConductivity(iPoint); - visc_numerics->SetPrimitive(V_domain, V_infty); - visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - nodes->GetGradient_Primitive(iPoint)); + /*--- Set the normal vector and the coordinates ---*/ - /*--- Turbulent kinetic energy ---*/ + visc_numerics->SetNormal(Normal); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), + geometry->nodes->GetCoord(Point_Normal)); - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) - visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), - solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); + /*--- Primitive variables, and gradient ---*/ - /*--- Compute and update viscous residual ---*/ + visc_numerics->SetPrimitive(V_domain, V_infty); + visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), + nodes->GetGradient_Primitive(iPoint)); - auto residual = visc_numerics->ComputeResidual(config); - LinSysRes.SubtractBlock(iPoint, residual); + /*--- Turbulent kinetic energy ---*/ - /*--- Viscous Jacobian contribution for implicit integration ---*/ + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), + solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); - if (implicit) - Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + /*--- Compute and update viscous residual ---*/ - } + auto residual_v = visc_numerics->ComputeResidual(config); + LinSysRes.SubtractBlock(iPoint, residual_v); - } - } + /*--- Viscous Jacobian contribution for implicit integration ---*/ - /*--- Free locally allocated memory ---*/ + if (implicit) + Jacobian.SubtractBlock2Diag(iPoint, residual_v.jacobian_i); - delete [] Normal; + } } @@ -2115,248 +2104,234 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, unsigned long Point_Normal; su2double *Flow_Dir, Flow_Dir_Mag, Vel_Mag, Area, P_total, P_domain, Vn; su2double *V_inlet, *V_domain; - su2double UnitFlowDir[3] = {0.0,0.0,0.0}; - su2double dV[3] = {0.0,0.0,0.0}; + su2double UnitFlowDir[MAXNDIM] = {0.0}, dV[MAXNDIM] = {0.0}; su2double Damping = config->GetInc_Inlet_Damping(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool viscous = config->GetViscous(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool viscous = config->GetViscous(); - string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + string Marker_Tag = config->GetMarker_All_TagBound(val_marker); unsigned short Kind_Inlet = config->GetKind_Inc_Inlet(Marker_Tag); - su2double *Normal = new su2double[nDim]; + su2double Normal[MAXNDIM] = {0.0}; /*--- Loop over all the vertices on this boundary marker ---*/ for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - - /*--- Allocate the value at the inlet ---*/ - - V_inlet = GetCharacPrimVar(val_marker, iVertex); - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + if (!geometry->nodes->GetDomain(iPoint)) continue; - /*--- Index of the closest interior node ---*/ + /*--- Allocate the value at the inlet ---*/ - Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + V_inlet = GetCharacPrimVar(val_marker, iVertex); - /*--- Normal vector for this vertex (negate for outward convention) ---*/ + /*--- Index of the closest interior node ---*/ - geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; - conv_numerics->SetNormal(Normal); + Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - Area = GeometryToolbox::Norm(nDim, Normal); + /*--- Normal vector for this vertex (negate for outward convention) ---*/ - /*--- Both types of inlets may use the prescribed flow direction. - Ensure that the flow direction is a unit vector. ---*/ + geometry->vertex[val_marker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + conv_numerics->SetNormal(Normal); - Flow_Dir = Inlet_FlowDir[val_marker][iVertex]; - Flow_Dir_Mag = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Flow_Dir_Mag += Flow_Dir[iDim]*Flow_Dir[iDim]; - Flow_Dir_Mag = sqrt(Flow_Dir_Mag); + Area = GeometryToolbox::Norm(nDim, Normal); - /*--- Store the unit flow direction vector. ---*/ + /*--- Both types of inlets may use the prescribed flow direction. + Ensure that the flow direction is a unit vector. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag; + Flow_Dir = Inlet_FlowDir[val_marker][iVertex]; + Flow_Dir_Mag = GeometryToolbox::Norm(nDim, Flow_Dir); - /*--- Retrieve solution at this boundary node. ---*/ + /*--- Store the unit flow direction vector. ---*/ - V_domain = nodes->GetPrimitive(iPoint); + for (iDim = 0; iDim < nDim; iDim++) + UnitFlowDir[iDim] = Flow_Dir[iDim]/Flow_Dir_Mag; - /*--- Neumann condition for dynamic pressure ---*/ + /*--- Retrieve solution at this boundary node. ---*/ - V_inlet[0] = nodes->GetPressure(iPoint); + V_domain = nodes->GetPrimitive(iPoint); - /*--- The velocity is either prescribed or computed from total pressure. ---*/ + /*--- Neumann condition for dynamic pressure ---*/ - switch (Kind_Inlet) { + V_inlet[0] = nodes->GetPressure(iPoint); - /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ + /*--- The velocity is either prescribed or computed from total pressure. ---*/ - case VELOCITY_INLET: + switch (Kind_Inlet) { - /*--- Retrieve the specified velocity and temperature for the inlet. ---*/ + /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ - Vel_Mag = Inlet_Ptotal[val_marker][iVertex]/config->GetVelocity_Ref(); + case VELOCITY_INLET: - /*--- Store the velocity in the primitive variable vector. ---*/ + /*--- Retrieve the specified velocity and temperature for the inlet. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - V_inlet[iDim+1] = Vel_Mag*UnitFlowDir[iDim]; + Vel_Mag = Inlet_Ptotal[val_marker][iVertex]/config->GetVelocity_Ref(); - /*--- Dirichlet condition for temperature (if energy is active) ---*/ + /*--- Store the velocity in the primitive variable vector. ---*/ - V_inlet[nDim+1] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref(); + for (iDim = 0; iDim < nDim; iDim++) + V_inlet[iDim+1] = Vel_Mag*UnitFlowDir[iDim]; - break; + /*--- Dirichlet condition for temperature (if energy is active) ---*/ - /*--- Stagnation pressure has been specified at the inlet. ---*/ + V_inlet[nDim+1] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref(); - case PRESSURE_INLET: + break; - /*--- Retrieve the specified total pressure for the inlet. ---*/ + /*--- Stagnation pressure has been specified at the inlet. ---*/ - P_total = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref(); + case PRESSURE_INLET: - /*--- Store the current static pressure for clarity. ---*/ + /*--- Retrieve the specified total pressure for the inlet. ---*/ - P_domain = nodes->GetPressure(iPoint); + P_total = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref(); - /*--- Check for back flow through the inlet. ---*/ + /*--- Store the current static pressure for clarity. ---*/ - Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Vn += V_domain[iDim+1]*(-1.0*Normal[iDim]/Area); - } + P_domain = nodes->GetPressure(iPoint); - /*--- If the local static pressure is larger than the specified - total pressure or the velocity is directed upstream, we have a - back flow situation. The specified total pressure should be used - as a static pressure condition and the velocity from the domain - is used for the BC. ---*/ + /*--- Check for back flow through the inlet. ---*/ - if ((P_domain > P_total) || (Vn < 0.0)) { + Vn = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Vn += V_domain[iDim+1]*(-1.0*Normal[iDim]/Area); + } - /*--- Back flow: use the prescribed P_total as static pressure. ---*/ + /*--- If the local static pressure is larger than the specified + total pressure or the velocity is directed upstream, we have a + back flow situation. The specified total pressure should be used + as a static pressure condition and the velocity from the domain + is used for the BC. ---*/ - V_inlet[0] = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref(); + if ((P_domain > P_total) || (Vn < 0.0)) { - /*--- Neumann condition for velocity. ---*/ + /*--- Back flow: use the prescribed P_total as static pressure. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - V_inlet[iDim+1] = V_domain[iDim+1]; + V_inlet[0] = Inlet_Ptotal[val_marker][iVertex]/config->GetPressure_Ref(); - /*--- Neumann condition for the temperature. ---*/ + /*--- Neumann condition for velocity. ---*/ - V_inlet[nDim+1] = nodes->GetTemperature(iPoint); + for (iDim = 0; iDim < nDim; iDim++) + V_inlet[iDim+1] = V_domain[iDim+1]; - } else { + /*--- Neumann condition for the temperature. ---*/ - /*--- Update the velocity magnitude using the total pressure. ---*/ + V_inlet[nDim+1] = nodes->GetTemperature(iPoint); - Vel_Mag = sqrt((P_total - P_domain)/(0.5*nodes->GetDensity(iPoint))); + } else { - /*--- If requested, use the local boundary normal (negative), - instead of the prescribed flow direction in the config. ---*/ + /*--- Update the velocity magnitude using the total pressure. ---*/ - if (config->GetInc_Inlet_UseNormal()) { - for (iDim = 0; iDim < nDim; iDim++) - UnitFlowDir[iDim] = -Normal[iDim]/Area; - } + Vel_Mag = sqrt((P_total - P_domain)/(0.5*nodes->GetDensity(iPoint))); - /*--- Compute the delta change in velocity in each direction. ---*/ + /*--- If requested, use the local boundary normal (negative), + instead of the prescribed flow direction in the config. ---*/ + if (config->GetInc_Inlet_UseNormal()) { for (iDim = 0; iDim < nDim; iDim++) - dV[iDim] = Vel_Mag*UnitFlowDir[iDim] - V_domain[iDim+1]; + UnitFlowDir[iDim] = -Normal[iDim]/Area; + } - /*--- Update the velocity in the primitive variable vector. - Note we use damping here to improve stability/convergence. ---*/ + /*--- Compute the delta change in velocity in each direction. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - V_inlet[iDim+1] = V_domain[iDim+1] + Damping*dV[iDim]; + for (iDim = 0; iDim < nDim; iDim++) + dV[iDim] = Vel_Mag*UnitFlowDir[iDim] - V_domain[iDim+1]; - /*--- Dirichlet condition for temperature (if energy is active) ---*/ + /*--- Update the velocity in the primitive variable vector. + Note we use damping here to improve stability/convergence. ---*/ - V_inlet[nDim+1] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref(); + for (iDim = 0; iDim < nDim; iDim++) + V_inlet[iDim+1] = V_domain[iDim+1] + Damping*dV[iDim]; - } + /*--- Dirichlet condition for temperature (if energy is active) ---*/ - break; + V_inlet[nDim+1] = Inlet_Ttotal[val_marker][iVertex]/config->GetTemperature_Ref(); - } + } - /*--- Access density at the node. This is either constant by - construction, or will be set fixed implicitly by the temperature - and equation of state. ---*/ + break; - V_inlet[nDim+2] = nodes->GetDensity(iPoint); + } - /*--- Beta coefficient from the config file ---*/ + /*--- Access density at the node. This is either constant by + construction, or will be set fixed implicitly by the temperature + and equation of state. ---*/ - V_inlet[nDim+3] = nodes->GetBetaInc2(iPoint); + V_inlet[nDim+2] = nodes->GetDensity(iPoint); - /*--- Cp is needed for Temperature equation. ---*/ + /*--- Beta coefficient from the config file ---*/ - V_inlet[nDim+7] = nodes->GetSpecificHeatCp(iPoint); + V_inlet[nDim+3] = nodes->GetBetaInc2(iPoint); - /*--- Set various quantities in the solver class ---*/ + /*--- Cp is needed for Temperature equation. ---*/ - conv_numerics->SetPrimitive(V_domain, V_inlet); + V_inlet[nDim+7] = nodes->GetSpecificHeatCp(iPoint); - if (dynamic_grid) - conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), - geometry->nodes->GetGridVel(iPoint)); + /*--- Set various quantities in the solver class ---*/ - /*--- Compute the residual using an upwind scheme ---*/ + conv_numerics->SetPrimitive(V_domain, V_inlet); - auto residual = conv_numerics->ComputeResidual(config); + if (dynamic_grid) + conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), + geometry->nodes->GetGridVel(iPoint)); - /*--- Update residual value ---*/ + /*--- Compute the residual using an upwind scheme ---*/ - LinSysRes.AddBlock(iPoint, residual); + auto residual = conv_numerics->ComputeResidual(config); - /*--- Jacobian contribution for implicit integration ---*/ + /*--- Update residual value ---*/ - if (implicit) - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + LinSysRes.AddBlock(iPoint, residual); - /*--- Viscous contribution, commented out because serious convergence problems ---*/ + /*--- Jacobian contribution for implicit integration ---*/ - if (viscous) { + if (implicit) + Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - /*--- Set transport properties at the inlet ---*/ + /*--- Viscous contribution, commented out because serious convergence problems ---*/ - V_inlet[nDim+4] = nodes->GetLaminarViscosity(iPoint); - V_inlet[nDim+5] = nodes->GetEddyViscosity(iPoint); - V_inlet[nDim+6] = nodes->GetThermalConductivity(iPoint); + if (!viscous) continue; - /*--- Set the normal vector and the coordinates ---*/ + /*--- Set transport properties at the inlet ---*/ - visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + V_inlet[nDim+4] = nodes->GetLaminarViscosity(iPoint); + V_inlet[nDim+5] = nodes->GetEddyViscosity(iPoint); + V_inlet[nDim+6] = nodes->GetThermalConductivity(iPoint); - /*--- Primitive variables, and gradient ---*/ + /*--- Set the normal vector and the coordinates ---*/ - visc_numerics->SetPrimitive(V_domain, V_inlet); - visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - nodes->GetGradient_Primitive(iPoint)); + visc_numerics->SetNormal(Normal); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), + geometry->nodes->GetCoord(Point_Normal)); - /*--- Turbulent kinetic energy ---*/ + /*--- Primitive variables, and gradient ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) - visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), - solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); + visc_numerics->SetPrimitive(V_domain, V_inlet); + visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), + nodes->GetGradient_Primitive(iPoint)); - /*--- Compute and update residual ---*/ + /*--- Turbulent kinetic energy ---*/ - auto residual = visc_numerics->ComputeResidual(config); + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), + solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); - LinSysRes.SubtractBlock(iPoint, residual); + /*--- Compute and update residual ---*/ - /*--- Jacobian contribution for implicit integration ---*/ + auto residual_v = visc_numerics->ComputeResidual(config); - if (implicit) - Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + LinSysRes.SubtractBlock(iPoint, residual_v); - } + /*--- Jacobian contribution for implicit integration ---*/ - } + if (implicit) + Jacobian.SubtractBlock2Diag(iPoint, residual_v.jacobian_i); } - - /*--- Free locally allocated memory ---*/ - - delete [] Normal; - } void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, @@ -2367,197 +2342,190 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, su2double mDot_Target, mDot_Old, dP, Density_Avg, Area_Outlet; su2double Damping = config->GetInc_Outlet_Damping(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool viscous = config->GetViscous(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool viscous = config->GetViscous(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - su2double *Normal = new su2double[nDim]; + su2double Normal[MAXNDIM] = {0.0}; unsigned short Kind_Outlet = config->GetKind_Inc_Outlet(Marker_Tag); /*--- Loop over all the vertices on this boundary marker ---*/ for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - - /*--- Allocate the value at the outlet ---*/ - - V_outlet = GetCharacPrimVar(val_marker, iVertex); - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + if (!geometry->nodes->GetDomain(iPoint)) continue; - /*--- Index of the closest interior node ---*/ + /*--- Allocate the value at the outlet ---*/ - Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + V_outlet = GetCharacPrimVar(val_marker, iVertex); - /*--- Normal vector for this vertex (negate for outward convention) ---*/ + /*--- Index of the closest interior node ---*/ - geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; - conv_numerics->SetNormal(Normal); + Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - /*--- Current solution at this boundary node ---*/ + /*--- Normal vector for this vertex (negate for outward convention) ---*/ - V_domain = nodes->GetPrimitive(iPoint); + geometry->vertex[val_marker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + conv_numerics->SetNormal(Normal); - /*--- Store the current static pressure for clarity. ---*/ + /*--- Current solution at this boundary node ---*/ - P_domain = nodes->GetPressure(iPoint); + V_domain = nodes->GetPrimitive(iPoint); - /*--- Compute a boundary value for the pressure depending on whether - we are prescribing a back pressure or a mass flow target. ---*/ + /*--- Store the current static pressure for clarity. ---*/ - switch (Kind_Outlet) { + P_domain = nodes->GetPressure(iPoint); - /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ + /*--- Compute a boundary value for the pressure depending on whether + we are prescribing a back pressure or a mass flow target. ---*/ - case PRESSURE_OUTLET: + switch (Kind_Outlet) { - /*--- Retrieve the specified back pressure for this outlet. ---*/ + /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ - P_Outlet = config->GetOutlet_Pressure(Marker_Tag)/config->GetPressure_Ref(); + case PRESSURE_OUTLET: - /*--- The pressure is prescribed at the outlet. ---*/ + /*--- Retrieve the specified back pressure for this outlet. ---*/ - V_outlet[0] = P_Outlet; + P_Outlet = config->GetOutlet_Pressure(Marker_Tag)/config->GetPressure_Ref(); - /*--- Neumann condition for the velocity. ---*/ + /*--- The pressure is prescribed at the outlet. ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - V_outlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); - } + V_outlet[0] = P_Outlet; - break; + /*--- Neumann condition for the velocity. ---*/ - /*--- A mass flow target has been specified for the outlet. ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + V_outlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); + } - case MASS_FLOW_OUTLET: + break; - /*--- Retrieve the specified target mass flow at the outlet. ---*/ + /*--- A mass flow target has been specified for the outlet. ---*/ - mDot_Target = config->GetOutlet_Pressure(Marker_Tag)/(config->GetDensity_Ref() * config->GetVelocity_Ref()); + case MASS_FLOW_OUTLET: - /*--- Retrieve the old mass flow, density, and area of the outlet, - which has been computed in a preprocessing step. These values - were stored in non-dim. form in the config container. ---*/ + /*--- Retrieve the specified target mass flow at the outlet. ---*/ - mDot_Old = config->GetOutlet_MassFlow(Marker_Tag); - Density_Avg = config->GetOutlet_Density(Marker_Tag); - Area_Outlet = config->GetOutlet_Area(Marker_Tag); + mDot_Target = config->GetOutlet_Pressure(Marker_Tag)/(config->GetDensity_Ref() * config->GetVelocity_Ref()); - /*--- Compute the pressure increment based on the difference - between the current and target mass flow. Note that increasing - pressure decreases flow speed. ---*/ + /*--- Retrieve the old mass flow, density, and area of the outlet, + which has been computed in a preprocessing step. These values + were stored in non-dim. form in the config container. ---*/ - dP = 0.5*Density_Avg*(mDot_Old*mDot_Old - mDot_Target*mDot_Target)/((Density_Avg*Area_Outlet)*(Density_Avg*Area_Outlet)); + mDot_Old = config->GetOutlet_MassFlow(Marker_Tag); + Density_Avg = config->GetOutlet_Density(Marker_Tag); + Area_Outlet = config->GetOutlet_Area(Marker_Tag); - /*--- Update the new outlet pressure. Note that we use damping - here to improve stability/convergence. ---*/ + /*--- Compute the pressure increment based on the difference + between the current and target mass flow. Note that increasing + pressure decreases flow speed. ---*/ - P_Outlet = P_domain + Damping*dP; + dP = 0.5*Density_Avg*(mDot_Old*mDot_Old - mDot_Target*mDot_Target)/((Density_Avg*Area_Outlet)*(Density_Avg*Area_Outlet)); - /*--- The pressure is prescribed at the outlet. ---*/ + /*--- Update the new outlet pressure. Note that we use damping + here to improve stability/convergence. ---*/ - V_outlet[0] = P_Outlet; + P_Outlet = P_domain + Damping*dP; - /*--- Neumann condition for the velocity ---*/ + /*--- The pressure is prescribed at the outlet. ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - V_outlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); - } + V_outlet[0] = P_Outlet; - break; + /*--- Neumann condition for the velocity ---*/ - } + for (iDim = 0; iDim < nDim; iDim++) { + V_outlet[iDim+1] = nodes->GetVelocity(iPoint,iDim); + } - /*--- Neumann condition for the temperature. ---*/ + break; - V_outlet[nDim+1] = nodes->GetTemperature(iPoint); + } - /*--- Access density at the interior node. This is either constant by - construction, or will be set fixed implicitly by the temperature - and equation of state. ---*/ + /*--- Neumann condition for the temperature. ---*/ - V_outlet[nDim+2] = nodes->GetDensity(iPoint); + V_outlet[nDim+1] = nodes->GetTemperature(iPoint); - /*--- Beta coefficient from the config file ---*/ + /*--- Access density at the interior node. This is either constant by + construction, or will be set fixed implicitly by the temperature + and equation of state. ---*/ - V_outlet[nDim+3] = nodes->GetBetaInc2(iPoint); + V_outlet[nDim+2] = nodes->GetDensity(iPoint); - /*--- Cp is needed for Temperature equation. ---*/ + /*--- Beta coefficient from the config file ---*/ - V_outlet[nDim+7] = nodes->GetSpecificHeatCp(iPoint); + V_outlet[nDim+3] = nodes->GetBetaInc2(iPoint); - /*--- Set various quantities in the solver class ---*/ + /*--- Cp is needed for Temperature equation. ---*/ - conv_numerics->SetPrimitive(V_domain, V_outlet); + V_outlet[nDim+7] = nodes->GetSpecificHeatCp(iPoint); - if (dynamic_grid) - conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), - geometry->nodes->GetGridVel(iPoint)); + /*--- Set various quantities in the solver class ---*/ - /*--- Compute the residual using an upwind scheme ---*/ + conv_numerics->SetPrimitive(V_domain, V_outlet); - auto residual = conv_numerics->ComputeResidual(config); + if (dynamic_grid) + conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), + geometry->nodes->GetGridVel(iPoint)); - /*--- Update residual value ---*/ + /*--- Compute the residual using an upwind scheme ---*/ - LinSysRes.AddBlock(iPoint, residual); + auto residual = conv_numerics->ComputeResidual(config); - /*--- Jacobian contribution for implicit integration ---*/ + /*--- Update residual value ---*/ - if (implicit) { - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - } + LinSysRes.AddBlock(iPoint, residual); - /*--- Viscous contribution, commented out because serious convergence problems ---*/ + /*--- Jacobian contribution for implicit integration ---*/ - if (viscous) { + if (implicit) { + Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + } - /*--- Set transport properties at the outlet. ---*/ + /*--- Viscous contribution, commented out because serious convergence problems ---*/ - V_outlet[nDim+4] = nodes->GetLaminarViscosity(iPoint); - V_outlet[nDim+5] = nodes->GetEddyViscosity(iPoint); - V_outlet[nDim+6] = nodes->GetThermalConductivity(iPoint); + if (!viscous) continue; - /*--- Set the normal vector and the coordinates ---*/ + /*--- Set transport properties at the outlet. ---*/ - visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + V_outlet[nDim+4] = nodes->GetLaminarViscosity(iPoint); + V_outlet[nDim+5] = nodes->GetEddyViscosity(iPoint); + V_outlet[nDim+6] = nodes->GetThermalConductivity(iPoint); - /*--- Primitive variables, and gradient ---*/ + /*--- Set the normal vector and the coordinates ---*/ - visc_numerics->SetPrimitive(V_domain, V_outlet); - visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - nodes->GetGradient_Primitive(iPoint)); + visc_numerics->SetNormal(Normal); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), + geometry->nodes->GetCoord(Point_Normal)); - /*--- Turbulent kinetic energy ---*/ + /*--- Primitive variables, and gradient ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) - visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), - solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); + visc_numerics->SetPrimitive(V_domain, V_outlet); + visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), + nodes->GetGradient_Primitive(iPoint)); - /*--- Compute and update residual ---*/ + /*--- Turbulent kinetic energy ---*/ - auto residual = visc_numerics->ComputeResidual(config); + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), + solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); - LinSysRes.SubtractBlock(iPoint, residual); + /*--- Compute and update residual ---*/ - /*--- Jacobian contribution for implicit integration ---*/ - if (implicit) - Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + auto residual_v = visc_numerics->ComputeResidual(config); - } + LinSysRes.SubtractBlock(iPoint, residual_v); - } - } + /*--- Jacobian contribution for implicit integration ---*/ + if (implicit) + Jacobian.SubtractBlock2Diag(iPoint, residual_v.jacobian_i); - /*--- Free locally allocated memory ---*/ - delete [] Normal; + } } @@ -3014,22 +2982,10 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, /*--- All the ranks to compute the total value ---*/ -#ifdef HAVE_MPI - SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); -#else - - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { - Outlet_MassFlow_Total[iMarker_Outlet] = Outlet_MassFlow_Local[iMarker_Outlet]; - Outlet_Density_Total[iMarker_Outlet] = Outlet_Density_Local[iMarker_Outlet]; - Outlet_Area_Total[iMarker_Outlet] = Outlet_Area_Local[iMarker_Outlet]; - } - -#endif - for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { if (Outlet_Area_Total[iMarker_Outlet] != 0.0) { Outlet_Density_Total[iMarker_Outlet] /= Outlet_Area_Total[iMarker_Outlet]; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index d2e58c66d8b6..8dfd61749fa3 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -95,46 +95,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container SetPrimitive_Limiter(geometry, config); } - /*--- Evaluate the vorticity and strain rate magnitude ---*/ - - SU2_OMP_MASTER - { - StrainMag_Max = 0.0; - Omega_Max = 0.0; - } - SU2_OMP_BARRIER - - nodes->SetVorticity_StrainMag(); - - /*--- Min and Max are not really differentiable ---*/ - const bool wasActive = AD::BeginPassive(); - - su2double strainMax = 0.0, omegaMax = 0.0; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - strainMax = max(strainMax, nodes->GetStrainMag(iPoint)); - omegaMax = max(omegaMax, GeometryToolbox::Norm(3, nodes->GetVorticity(iPoint))); - } - SU2_OMP_CRITICAL { - StrainMag_Max = max(StrainMag_Max, strainMax); - Omega_Max = max(Omega_Max, omegaMax); - } - - if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { - SU2_OMP_BARRIER - SU2_OMP_MASTER - { - su2double MyOmega_Max = Omega_Max; - su2double MyStrainMag_Max = StrainMag_Max; - - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - } - SU2_OMP_BARRIER - } - - AD::EndPassive(wasActive); + ComputeVorticityAndStrainMag(*config, iMesh); } diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 7a1173f09fe8..8b36400de1ff 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -148,46 +148,7 @@ void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, C SetPrimitive_Limiter(geometry, config); } - /*--- Evaluate the vorticity and strain rate magnitude ---*/ - - SU2_OMP_MASTER - { - StrainMag_Max = 0.0; - Omega_Max = 0.0; - } - SU2_OMP_BARRIER - - nodes->SetVorticity_StrainMag(); - - /*--- Min and Max are not really differentiable ---*/ - const bool wasActive = AD::BeginPassive(); - - su2double strainMax = 0.0, omegaMax = 0.0; - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - strainMax = max(strainMax, nodes->GetStrainMag(iPoint)); - omegaMax = max(omegaMax, GeometryToolbox::Norm(3, nodes->GetVorticity(iPoint))); - } - SU2_OMP_CRITICAL { - StrainMag_Max = max(StrainMag_Max, strainMax); - Omega_Max = max(Omega_Max, omegaMax); - } - - if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { - SU2_OMP_BARRIER - SU2_OMP_MASTER - { - su2double MyOmega_Max = Omega_Max; - su2double MyStrainMag_Max = StrainMag_Max; - - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - } - SU2_OMP_BARRIER - } - - AD::EndPassive(wasActive); + ComputeVorticityAndStrainMag(*config, iMesh); /*--- Compute the TauWall from the wall functions ---*/ From b33d44f8f07ac143b4f701855dff216b4a4e8aa6 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 16:42:03 +0000 Subject: [PATCH 149/326] cleanup CIncNS boundaries not to use the TerribleLegacyVariables --- SU2_CFD/include/solvers/CIncNSSolver.hpp | 9 + SU2_CFD/src/solvers/CIncNSSolver.cpp | 429 ++++++++--------------- 2 files changed, 151 insertions(+), 287 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 64090342a180..4c7388f5c51f 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -36,6 +36,15 @@ * \author F. Palacios, T. Economon, T. Albring */ class CIncNSSolver final : public CIncEulerSolver { + + /*! + * \brief Generic implementation of the isothermal and heatflux walls. + */ + void BC_Wall_Generic(const CGeometry *geometry, + const CConfig *config, + unsigned short val_marker, + unsigned short kind_boundary); + public: /*! * \brief Constructor of the class. diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 8dfd61749fa3..0e8ccfe87095 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -191,373 +191,228 @@ void CIncNSSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_contai } -void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { +void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *config, + unsigned short val_marker, unsigned short kind_boundary) { - unsigned short iDim, iVar, jVar;// Wall_Function; - unsigned long iVertex, iPoint, total_index; - - su2double *GridVel, *Normal, Area, Wall_HeatFlux; - - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool energy = config->GetEnergy_Equation(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool energy = config->GetEnergy_Equation(); /*--- Identify the boundary by string name ---*/ - string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - - /*--- Get the specified wall heat flux from config ---*/ - - Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); - -// /*--- Get wall function treatment from config. ---*/ -// -// Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); -// if (Wall_Function != NO_WALL_FUNCTION) { -// SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); -// } - - /*--- Loop over all of the vertices on this boundary marker ---*/ - - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); - - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Compute dual-grid area and boundary normal ---*/ - - Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Initialize the convective & viscous residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Res_Conv[iVar] = 0.0; - Res_Visc[iVar] = 0.0; - if (implicit) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - } - } - - /*--- Store the corrected velocity at the wall which will - be zero (v = 0), unless there are moving walls (v = u_wall)---*/ - - if (dynamic_grid) { - GridVel = geometry->nodes->GetGridVel(iPoint); - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = GridVel[iDim]; - } else { - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = 0.0; - } - - /*--- Impose the value of the velocity as a strong boundary - condition (Dirichlet). Fix the velocity and remove any - contribution to the residual at this node. ---*/ - - nodes->SetVelocity_Old(iPoint,Vector); + const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - for (iDim = 0; iDim < nDim; iDim++) - LinSysRes(iPoint, iDim+1) = 0.0; - nodes->SetVel_ResTruncError_Zero(iPoint); - - if (energy) { - - /*--- Apply a weak boundary condition for the energy equation. - Compute the residual due to the prescribed heat flux. ---*/ - - Res_Visc[nDim+1] = Wall_HeatFlux*Area; - - /*--- Viscous contribution to the residual at the wall ---*/ - - LinSysRes.SubtractBlock(iPoint, Res_Visc); - - } - - /*--- Enforce the no-slip boundary condition in a strong way by - modifying the velocity-rows of the Jacobian (1 on the diagonal). ---*/ - - if (implicit) { - for (iVar = 1; iVar <= nDim; iVar++) { - total_index = iPoint*nVar+iVar; - Jacobian.DeleteValsRowi(total_index); - } - } - - } - } -} - -void CIncNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { - - unsigned short iDim, iVar, jVar, Wall_Function; - unsigned long iVertex, iPoint, Point_Normal, total_index; - - su2double *GridVel; - su2double *Normal, *Coord_i, *Coord_j, Area, dist_ij; - su2double Twall, dTdn; - su2double thermal_conductivity; - - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool energy = config->GetEnergy_Equation(); - - /*--- Identify the boundary by string name ---*/ + /*--- Get the specified wall heat flux or temperature from config ---*/ - string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + su2double Wall_HeatFlux = 0.0, Twall = 0.0; - /*--- Retrieve the specified wall temperature ---*/ - - Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + if (kind_boundary == HEAT_FLUX) + Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + else if (kind_boundary == ISOTHERMAL) + Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + else + SU2_MPI::Error("Unknown type of boundary condition", CURRENT_FUNCTION); /*--- Get wall function treatment from config. ---*/ - Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); - if (Wall_Function != NO_WALL_FUNCTION) { - SU2_MPI::Error("Wall function treatment not implemented yet.", CURRENT_FUNCTION); - } + const auto Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); + if (Wall_Function != NO_WALL_FUNCTION) + SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); /*--- Loop over all of the vertices on this boundary marker ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { + const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Initialize the convective & viscous residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Res_Conv[iVar] = 0.0; - Res_Visc[iVar] = 0.0; - if (implicit) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - } - } - - /*--- Store the corrected velocity at the wall which will - be zero (v = 0), unless there are moving walls (v = u_wall)---*/ - - if (dynamic_grid) { - GridVel = geometry->nodes->GetGridVel(iPoint); - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = GridVel[iDim]; - } else { - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = 0.0; - } - - /*--- Impose the value of the velocity as a strong boundary - condition (Dirichlet). Fix the velocity and remove any - contribution to the residual at this node. ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - nodes->SetVelocity_Old(iPoint,Vector); + /*--- Compute dual-grid area and boundary normal ---*/ - for (iDim = 0; iDim < nDim; iDim++) - LinSysRes(iPoint, iDim+1) = 0.0; - nodes->SetVel_ResTruncError_Zero(iPoint); + const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - if (energy) { + const su2double Area = GeometryToolbox::Norm(nDim, Normal); - /*--- Compute dual grid area and boundary normal ---*/ + /*--- Impose the value of the velocity as a strong boundary + condition (Dirichlet). Fix the velocity and remove any + contribution to the residual at this node. ---*/ - Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Compute closest normal neighbor ---*/ + if (dynamic_grid) { + nodes->SetVelocity_Old(iPoint, geometry->nodes->GetGridVel(iPoint)); + } else { + su2double zero[MAXNDIM] = {0.0}; + nodes->SetVelocity_Old(iPoint, zero); + } - Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + LinSysRes(iPoint, iDim+1) = 0.0; + nodes->SetVel_ResTruncError_Zero(iPoint); - /*--- Get coordinates of i & nearest normal and compute distance ---*/ + /*--- Enforce the no-slip boundary condition in a strong way by + modifying the velocity-rows of the Jacobian (1 on the diagonal). ---*/ - Coord_i = geometry->nodes->GetCoord(iPoint); - Coord_j = geometry->nodes->GetCoord(Point_Normal); - dist_ij = 0; - for (iDim = 0; iDim < nDim; iDim++) - dist_ij += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); - dist_ij = sqrt(dist_ij); + if (implicit) { + for (unsigned short iVar = 1; iVar <= nDim; iVar++) + Jacobian.DeleteValsRowi(iPoint*nVar+iVar); + } - /*--- Compute the normal gradient in temperature using Twall ---*/ + if (!energy) continue; - dTdn = -(nodes->GetTemperature(Point_Normal) - Twall)/dist_ij; + if (kind_boundary == HEAT_FLUX) { - /*--- Get thermal conductivity ---*/ + /*--- Apply a weak boundary condition for the energy equation. + Compute the residual due to the prescribed heat flux. ---*/ - thermal_conductivity = nodes->GetThermalConductivity(iPoint); + LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; + } + else { // ISOTHERMAL - /*--- Apply a weak boundary condition for the energy equation. - Compute the residual due to the prescribed heat flux. ---*/ + auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - Res_Visc[nDim+1] = thermal_conductivity*dTdn*Area; + /*--- Get coordinates of i & nearest normal and compute distance ---*/ - /*--- Jacobian contribution for temperature equation. ---*/ + auto Coord_i = geometry->nodes->GetCoord(iPoint); + auto Coord_j = geometry->nodes->GetCoord(Point_Normal); + su2double Edge_Vector[MAXNDIM]; + GeometryToolbox::Distance(nDim, Coord_j, Coord_i, Edge_Vector); + su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); + su2double dist_ij = sqrt(dist_ij_2); - if (implicit) { - su2double Edge_Vector[3]; - su2double dist_ij_2 = 0, proj_vector_ij = 0; - for (iDim = 0; iDim < nDim; iDim++) { - Edge_Vector[iDim] = Coord_j[iDim]-Coord_i[iDim]; - dist_ij_2 += Edge_Vector[iDim]*Edge_Vector[iDim]; - proj_vector_ij += Edge_Vector[iDim]*Normal[iDim]; - } - if (dist_ij_2 == 0.0) proj_vector_ij = 0.0; - else proj_vector_ij = proj_vector_ij/dist_ij_2; + /*--- Compute the normal gradient in temperature using Twall ---*/ - Jacobian_i[nDim+1][nDim+1] = -thermal_conductivity*proj_vector_ij; + su2double dTdn = -(nodes->GetTemperature(Point_Normal) - Twall)/dist_ij; - Jacobian.SubtractBlock2Diag(iPoint, Jacobian_i); - } + /*--- Get thermal conductivity ---*/ - /*--- Viscous contribution to the residual at the wall ---*/ + su2double thermal_conductivity = nodes->GetThermalConductivity(iPoint); - LinSysRes.SubtractBlock(iPoint, Res_Visc); + /*--- Apply a weak boundary condition for the energy equation. + Compute the residual due to the prescribed heat flux. ---*/ - } + LinSysRes(iPoint, nDim+1) -= thermal_conductivity*dTdn*Area; - /*--- Enforce the no-slip boundary condition in a strong way by - modifying the velocity-rows of the Jacobian (1 on the diagonal). ---*/ + /*--- Jacobian contribution for temperature equation. ---*/ if (implicit) { - for (iVar = 1; iVar <= nDim; iVar++) { - total_index = iPoint*nVar+iVar; - Jacobian.DeleteValsRowi(total_index); - } + su2double proj_vector_ij = 0.0; + if (dist_ij_2 > 0.0) + proj_vector_ij = GeometryToolbox::DotProduct(nDim, Edge_Vector, Normal) / dist_ij_2; + + auto Blk_i = Jacobian.GetBlock(iPoint, iPoint); +#ifdef CODI_FORWARD_TYPE + Blk_i[nVar*nVar-1] += thermal_conductivity*proj_vector_ij; +#else + Blk_i[nVar*nVar-1] += SU2_TYPE::GetValue(thermal_conductivity*proj_vector_ij); +#endif } - } } } +void CIncNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver**, CNumerics*, + CNumerics*, CConfig *config, unsigned short val_marker) { -void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CConfig *config, unsigned short val_marker) { + BC_Wall_Generic(geometry, config, val_marker, HEAT_FLUX); +} - unsigned short iVar, jVar, iDim, Wall_Function; - unsigned long iVertex, iPoint, total_index, Point_Normal; +void CIncNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver**, CNumerics*, + CNumerics*, CConfig *config, unsigned short val_marker) { - su2double *Coord_i, *Coord_j, dist_ij; - su2double *GridVel, There, Tconjugate, Twall= 0.0, Temperature_Ref, thermal_conductivity, HF_FactorHere, HF_FactorConjugate; + BC_Wall_Generic(geometry, config, val_marker, ISOTHERMAL); +} - Temperature_Ref = config->GetTemperature_Ref(); +void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, + CConfig *config, unsigned short val_marker) { - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool energy = config->GetEnergy_Equation(); + const su2double Temperature_Ref = config->GetTemperature_Ref(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool energy = config->GetEnergy_Equation(); /*--- Identify the boundary ---*/ - string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); /*--- Retrieve the specified wall function treatment.---*/ - Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); - if(Wall_Function != NO_WALL_FUNCTION) { - SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); + const auto Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); + if (Wall_Function != NO_WALL_FUNCTION) { + SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); } /*--- Loop over boundary points ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { - if (geometry->nodes->GetDomain(iPoint)) { + auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); - /*--- Initialize the convective & viscous residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Res_Conv[iVar] = 0.0; - Res_Visc[iVar] = 0.0; - if (implicit) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - } - } - - /*--- Store the corrected velocity at the wall which will - be zero (v = 0), unless there are moving walls (v = u_wall)---*/ - - if (dynamic_grid) { - GridVel = geometry->nodes->GetGridVel(iPoint); - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = GridVel[iDim]; - } else { - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = 0.0; - } + if (!geometry->nodes->GetDomain(iPoint)) continue; - /*--- Impose the value of the velocity as a strong boundary - condition (Dirichlet). Fix the velocity and remove any - contribution to the residual at this node. ---*/ + /*--- Impose the value of the velocity as a strong boundary + condition (Dirichlet). Fix the velocity and remove any + contribution to the residual at this node. ---*/ - nodes->SetVelocity_Old(iPoint,Vector); + if (dynamic_grid) { + nodes->SetVelocity_Old(iPoint, geometry->nodes->GetGridVel(iPoint)); + } else { + su2double zero[MAXNDIM] = {0.0}; + nodes->SetVelocity_Old(iPoint, zero); + } - for (iDim = 0; iDim < nDim; iDim++) - LinSysRes(iPoint, iDim+1) = 0.0; - nodes->SetVel_ResTruncError_Zero(iPoint); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + LinSysRes(iPoint, iDim+1) = 0.0; + nodes->SetVel_ResTruncError_Zero(iPoint); - if (energy) { + /*--- Enforce the no-slip boundary condition in a strong way by + modifying the velocity-rows of the Jacobian (1 on the diagonal). ---*/ - Tconjugate = GetConjugateHeatVariable(val_marker, iVertex, 0)/Temperature_Ref; + if (implicit) { + for (unsigned short iVar = 1; iVar <= nDim; iVar++) + Jacobian.DeleteValsRowi(iPoint*nVar+iVar); + if (energy) Jacobian.DeleteValsRowi(iPoint*nVar+nDim+1); + } - if ((config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if (!energy) continue; - /*--- Compute closest normal neighbor ---*/ + su2double Tconjugate = GetConjugateHeatVariable(val_marker, iVertex, 0) / Temperature_Ref; + su2double Twall = 0.0; - Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + if ((config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { - /*--- Get coordinates of i & nearest normal and compute distance ---*/ + /*--- Compute closest normal neighbor ---*/ - Coord_i = geometry->nodes->GetCoord(iPoint); - Coord_j = geometry->nodes->GetCoord(Point_Normal); - dist_ij = 0; - for (iDim = 0; iDim < nDim; iDim++) - dist_ij += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); - dist_ij = sqrt(dist_ij); + auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - /*--- Compute wall temperature from both temperatures ---*/ + /*--- Get coordinates of i & nearest normal and compute distance ---*/ - thermal_conductivity = nodes->GetThermalConductivity(iPoint); - There = nodes->GetTemperature(Point_Normal); - HF_FactorHere = thermal_conductivity*config->GetViscosity_Ref()/dist_ij; - HF_FactorConjugate = GetConjugateHeatVariable(val_marker, iVertex, 2); + auto Coord_i = geometry->nodes->GetCoord(iPoint); + auto Coord_j = geometry->nodes->GetCoord(Point_Normal); + su2double dist_ij = GeometryToolbox::Distance(nDim, Coord_j, Coord_i); - Twall = (There*HF_FactorHere + Tconjugate*HF_FactorConjugate)/(HF_FactorHere + HF_FactorConjugate); - } - else if ((config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { + /*--- Compute wall temperature from both temperatures ---*/ - /*--- (Directly) Set wall temperature to conjugate temperature. ---*/ + su2double thermal_conductivity = nodes->GetThermalConductivity(iPoint); + su2double There = nodes->GetTemperature(Point_Normal); + su2double HF_FactorHere = thermal_conductivity*config->GetViscosity_Ref()/dist_ij; + su2double HF_FactorConjugate = GetConjugateHeatVariable(val_marker, iVertex, 2); - Twall = Tconjugate; - } - else { - Twall = 0.0; - SU2_MPI::Error("Unknown CHT coupling method.", CURRENT_FUNCTION); - } + Twall = (There*HF_FactorHere + Tconjugate*HF_FactorConjugate)/(HF_FactorHere + HF_FactorConjugate); + } + else if ((config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { - /*--- Strong imposition of the temperature on the fluid zone. ---*/ + /*--- (Directly) Set wall temperature to conjugate temperature. ---*/ - LinSysRes(iPoint, nDim+1) = 0.0; - nodes->SetSolution_Old(iPoint, nDim+1, Twall); - nodes->SetEnergy_ResTruncError_Zero(iPoint); - } + Twall = Tconjugate; + } + else { + SU2_MPI::Error("Unknown CHT coupling method.", CURRENT_FUNCTION); + } - /*--- Enforce the no-slip boundary condition in a strong way by - modifying the velocity-rows of the Jacobian (1 on the diagonal). ---*/ + /*--- Strong imposition of the temperature on the fluid zone. ---*/ - if (implicit) { - for (iVar = 1; iVar <= nDim; iVar++) { - total_index = iPoint*nVar+iVar; - Jacobian.DeleteValsRowi(total_index); - } - if(energy) { - total_index = iPoint*nVar+nDim+1; - Jacobian.DeleteValsRowi(total_index); - } - } - } + LinSysRes(iPoint, nDim+1) = 0.0; + nodes->SetSolution_Old(iPoint, nDim+1, Twall); + nodes->SetEnergy_ResTruncError_Zero(iPoint); } } From f87cd4166155277e74cbf52cd2017b724ba6d8ae Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 19:18:31 +0000 Subject: [PATCH 150/326] ImplicitEuler_Iteration --- Common/include/linear_algebra/CSysMatrix.hpp | 12 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.hpp | 144 ++++++++++++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 6 +- SU2_CFD/src/SU2_CFD.cpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 155 ++--------------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 157 ++++-------------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 75 +-------- 8 files changed, 201 insertions(+), 352 deletions(-) diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index 44f5afe1f893..54e8110aac3b 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -708,8 +708,8 @@ class CSysMatrix { * \param[in] val_block - Block to add to the diagonal of the matrix. * \param[in] alpha - Scale factor. */ - template - inline void SetBlock2Diag(unsigned long block_i, const OtherType* const* val_block, OtherType alpha = 1.0) { + template + inline void SetBlock2Diag(unsigned long block_i, const OtherType& val_block, T alpha = 1.0) { auto mat_ii = &matrix[dia_ptr[block_i]*nVar*nEqn]; @@ -723,8 +723,8 @@ class CSysMatrix { /*! * \brief Non overwrite version of SetBlock2Diag, also with scaling. */ - template - inline void AddBlock2Diag(unsigned long block_i, const OtherType* const* val_block, OtherType alpha = 1.0) { + template + inline void AddBlock2Diag(unsigned long block_i, const OtherType& val_block, T alpha = 1.0) { SetBlock2Diag(block_i, val_block, alpha); } @@ -732,8 +732,8 @@ class CSysMatrix { * \brief Short-hand to AddBlock2Diag with alpha = -1, i.e. subtracts from the current diagonal. */ template - inline void SubtractBlock2Diag(unsigned long block_i, const OtherType* const* val_block) { - AddBlock2Diag(block_i, val_block, OtherType(-1)); + inline void SubtractBlock2Diag(unsigned long block_i, const OtherType& val_block) { + AddBlock2Diag(block_i, val_block, -1.0); } /*! diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 83e423e2c6ea..df13f802b1c1 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -447,7 +447,7 @@ class CEulerSolver : public CFVMFlowSolverBase { * \param[in,out] preconditioner - The preconditioner matrix, must be allocated outside. */ void SetPreconditioner(const CConfig *config, unsigned long iPoint, - su2double delta, su2double** preconditioner) const; + su2double delta, su2activematrix& preconditioner) const; /*! * \brief Parallelization of Undivided Laplacian. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index e26655d209cf..dff77aafbd5c 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -803,6 +803,150 @@ class CFVMFlowSolverBase : public CSolver { Explicit_Iteration_impl(precond, geometry, solver_container, config, iRKStep); } + /*! + * \brief Generic implementation of implicit Euler iteration with an optional preconditioner applied to the diagonal. + * \param[in] compute_ur - Whether to use automatic under-relaxation for the update. + * \tparam DiagonalPrecond - A function object implementing: + * - active: A boolean variable to determine if the preconditioner should be used. + * - (config, iPoint, delta): Compute and return a matrix type compatible with the Jacobian matrix, + * where "delta" is V/dt. + */ + template + void ImplicitEuler_Iteration_impl(DiagonalPrecond& preconditioner, CGeometry *geometry, + CSolver **solver_container, CConfig *config, bool compute_ur) { + + const bool adjoint = config->GetContinuous_Adjoint(); + + /*--- Set shared residual variables to 0 and declare + * local ones for current thread to work on. ---*/ + + SU2_OMP_MASTER + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + SetRes_RMS(iVar, 0.0); + SetRes_Max(iVar, 0.0, 0); + } + SU2_OMP_BARRIER + + su2double resMax[MAXNVAR] = {0.0}, resRMS[MAXNVAR] = {0.0}; + const su2double* coordMax[MAXNVAR] = {nullptr}; + unsigned long idxMax[MAXNVAR] = {0}; + + /*--- Build implicit system ---*/ + + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Read the residual ---*/ + + su2double* local_Res_TruncError = nodes->GetResTruncError(iPoint); + + /*--- Read the volume ---*/ + + su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); + + /*--- Modify matrix diagonal to assure diagonal dominance ---*/ + + if (nodes->GetDelta_Time(iPoint) != 0.0) { + + su2double Delta = Vol / nodes->GetDelta_Time(iPoint); + + if (preconditioner.active) { + Jacobian.AddBlock2Diag(iPoint, preconditioner(config, iPoint, Delta)); + } + else { + Jacobian.AddVal2Diag(iPoint, Delta); + } + } + else { + Jacobian.SetVal2Diag(iPoint, 1.0); + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + LinSysRes(iPoint,iVar) = 0.0; + local_Res_TruncError[iVar] = 0.0; + } + } + + /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ + + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + unsigned long total_index = iPoint*nVar + iVar; + LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); + LinSysSol[total_index] = 0.0; + + su2double Res = fabs(LinSysRes[total_index]); + resRMS[iVar] += Res*Res; + if (Res > resMax[iVar]) { + resMax[iVar] = Res; + idxMax[iVar] = iPoint; + coordMax[iVar] = geometry->nodes->GetCoord(iPoint); + } + } + } + SU2_OMP_CRITICAL + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + AddRes_RMS(iVar, resRMS[iVar]); + AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); + } + + /*--- Initialize residual and solution at the ghost points ---*/ + + SU2_OMP(sections nowait) + { + SU2_OMP(section) + for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) + LinSysRes.SetBlock_Zero(iPoint); + + SU2_OMP(section) + for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) + LinSysSol.SetBlock_Zero(iPoint); + } + + /*--- Solve or smooth the linear system. ---*/ + + auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + SU2_OMP_MASTER + { + SetIterLinSolver(iter); + SetResLinSolver(System.GetResidual()); + } + SU2_OMP_BARRIER + + if (compute_ur) ComputeUnderRelaxationFactor(solver_container, config); + + /*--- Update solution (system written in terms of increments) ---*/ + + if (!adjoint) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + nodes->AddSolution(iPoint, iVar, nodes->GetUnderRelaxation(iPoint)*LinSysSol[iPoint*nVar+iVar]); + } + } + } + + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { + InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); + CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); + } + + /*--- MPI solution ---*/ + + InitiateComms(geometry, config, SOLUTION); + CompleteComms(geometry, config, SOLUTION); + + SU2_OMP_MASTER + { + /*--- Compute the root mean square residual ---*/ + + SetResidual_RMS(geometry, config); + + /*--- For verification cases, compute the global error metrics. ---*/ + + ComputeVerificationError(geometry, config); + } + SU2_OMP_BARRIER + + } + /*! * \brief Evaluate the vorticity and strain rate magnitude. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index ac3af84a40e9..ab7ce81b62a7 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -44,7 +44,6 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetContinuous_Adjoint(); - const bool roe_turkel = config->GetKind_Upwind_Flow() == TURKEL; - const bool low_mach_prec = config->Low_Mach_Preconditioning(); + struct LowMachPrec { + const CEulerSolver* solver; + const bool active; + su2activematrix matrix; - /*--- Local matrix for preconditioning. ---*/ - su2double** LowMachPrec = nullptr; - if (roe_turkel || low_mach_prec) { - LowMachPrec = new su2double* [nVar]; - for(unsigned short iVar = 0; iVar < nVar; ++iVar) - LowMachPrec[iVar] = new su2double [nVar]; - } - - /*--- Set shared residual variables to 0 and declare - * local ones for current thread to work on. ---*/ - - SU2_OMP_MASTER - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - SU2_OMP_BARRIER - - su2double resMax[MAXNVAR] = {0.0}, resRMS[MAXNVAR] = {0.0}; - const su2double* coordMax[MAXNVAR] = {nullptr}; - unsigned long idxMax[MAXNVAR] = {0}; - - /*--- Build implicit system ---*/ - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Read the residual ---*/ - - su2double* local_Res_TruncError = nodes->GetResTruncError(iPoint); - - /*--- Read the volume ---*/ - - su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); - - /*--- Modify matrix diagonal to assure diagonal dominance ---*/ - - if (nodes->GetDelta_Time(iPoint) != 0.0) { - - su2double Delta = Vol / nodes->GetDelta_Time(iPoint); - - if (roe_turkel || low_mach_prec) { - SetPreconditioner(config, iPoint, Delta, LowMachPrec); - Jacobian.AddBlock2Diag(iPoint, LowMachPrec); - } - else { - Jacobian.AddVal2Diag(iPoint, Delta); - } - } - else { - Jacobian.SetVal2Diag(iPoint, 1.0); - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - LinSysRes(iPoint,iVar) = 0.0; - local_Res_TruncError[iVar] = 0.0; - } + LowMachPrec(const CEulerSolver* s, bool a, unsigned short nVar) : solver(s), active(a) { + if (active) matrix.resize(nVar,nVar); } - /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ - - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - unsigned long total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); - LinSysSol[total_index] = 0.0; - - su2double Res = fabs(LinSysRes[total_index]); - resRMS[iVar] += Res*Res; - if (Res > resMax[iVar]) { - resMax[iVar] = Res; - idxMax[iVar] = iPoint; - coordMax[iVar] = geometry->nodes->GetCoord(iPoint); - } - } - } - SU2_OMP_CRITICAL - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - AddRes_RMS(iVar, resRMS[iVar]); - AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); - } - - /*--- Initialize residual and solution at the ghost points ---*/ - - SU2_OMP(sections nowait) - { - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysRes.SetBlock_Zero(iPoint); - - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysSol.SetBlock_Zero(iPoint); - } - - /*--- Free local preconditioner. ---*/ - if (LowMachPrec) { - for(unsigned short iVar = 0; iVar < nVar; ++iVar) - delete [] LowMachPrec[iVar]; - delete [] LowMachPrec; - } - - /*--- Solve or smooth the linear system. ---*/ - - auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); - SU2_OMP_MASTER - { - SetIterLinSolver(iter); - SetResLinSolver(System.GetResidual()); - } - SU2_OMP_BARRIER - - - ComputeUnderRelaxationFactor(solver_container, config); - - /*--- Update solution (system written in terms of increments) ---*/ - - if (!adjoint) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - nodes->AddSolution(iPoint, iVar, nodes->GetUnderRelaxation(iPoint)*LinSysSol[iPoint*nVar+iVar]); - } + FORCEINLINE const su2activematrix& operator() (const CConfig* config, unsigned long iPoint, su2double delta) { + solver->SetPreconditioner(config, iPoint, delta, matrix); + return matrix; } - } - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); - } - - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); + } precond(this, config->Low_Mach_Preconditioning() || (config->GetKind_Upwind_Flow() == TURKEL), nVar); - SU2_OMP_MASTER - { - /*--- Compute the root mean square residual ---*/ - - SetResidual_RMS(geometry, config); - - /*--- For verification cases, compute the global error metrics. ---*/ - - ComputeVerificationError(geometry, config); - } - SU2_OMP_BARRIER + ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, true); } void CEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint, - su2double delta, su2double** preconditioner) const { + su2double delta, su2activematrix& preconditioner) const { unsigned short iDim, jDim, iVar, jVar; su2double local_Mach, rho, enthalpy, soundspeed, sq_vel; diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 367e265032cc..cd27cd575c39 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -41,7 +41,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned * being called by itself, or by its derived class CIncNSSolver. ---*/ const string description = navier_stokes? "Navier-Stokes" : "Euler"; - unsigned short iVar, iMarker, nLineLets; + unsigned short iMarker, nLineLets; ifstream restart_file; unsigned short nZone = geometry->GetnZone(); bool restart = (config->GetRestart() || config->GetRestart_Flow()); @@ -142,12 +142,6 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned Primitive_i = new su2double[nPrimVar] (); Primitive_j = new su2double[nPrimVar] (); - /*--- Allocate preconditioning matrix. ---*/ - - Preconditioner = new su2double* [nVar]; - for (iVar = 0; iVar < nVar; iVar ++) - Preconditioner[iVar] = new su2double[nVar]; - /*--- Allocate base class members. ---*/ Allocate(*config); @@ -226,18 +220,10 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned CIncEulerSolver::~CIncEulerSolver(void) { - unsigned short iVar; - delete [] Primitive; delete [] Primitive_i; delete [] Primitive_j; - if (Preconditioner != nullptr) { - for (iVar = 0; iVar < nVar; iVar ++) - delete [] Preconditioner[iVar]; - delete [] Preconditioner; - } - delete FluidModel; } @@ -1679,25 +1665,25 @@ template FORCEINLINE void CIncEulerSolver::Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep) { struct Precond { - CIncEulerSolver* solver; - const su2double* const* matrix; + const CIncEulerSolver* solver; + su2activematrix matrix; unsigned short nVar; - Precond(CIncEulerSolver* s, const su2double* const* m, unsigned short n) : - solver(s), matrix(m), nVar(n) {} + Precond(const CIncEulerSolver* s, unsigned short n) : solver(s), nVar(n) { + matrix.resize(nVar,nVar); + } FORCEINLINE void compute(const CConfig* config, unsigned long iPoint) { - /// TODO: This is not thread-safe, this function needs to return by value. - solver->SetPreconditioner(config, iPoint); + solver->SetPreconditioner(config, iPoint, 1.0, matrix); } - FORCEINLINE su2double apply(unsigned short iVar, const su2double* res, const su2double* resTrunc) { + FORCEINLINE su2double apply(unsigned short iVar, const su2double* res, const su2double* resTrunc) const { su2double resPrec = 0.0; for (unsigned short jVar = 0; jVar < nVar; ++jVar) - resPrec += matrix[iVar][jVar] * (res[jVar] + resTrunc[jVar]); + resPrec += matrix(iVar,jVar) * (res[jVar] + resTrunc[jVar]); return resPrec; } - } precond(this, Preconditioner, nVar); + } precond(this, nVar); Explicit_Iteration_impl(precond, geometry, solver_container, config, iRKStep); } @@ -1721,113 +1707,21 @@ void CIncEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **sol void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - unsigned short iVar, jVar; - unsigned long iPoint, total_index, IterLinSol = 0; - su2double Delta, *local_Res_TruncError, Vol; - - bool adjoint = config->GetContinuous_Adjoint(); - - /*--- Set maximum residual to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Build implicit system ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Read the residual ---*/ - - local_Res_TruncError = nodes->GetResTruncError(iPoint); - - /*--- Read the volume ---*/ - - Vol = (geometry->nodes->GetVolume(iPoint) + - geometry->nodes->GetPeriodicVolume(iPoint)); - - /*--- Apply the preconditioner and add to the diagonal. ---*/ - - if (nodes->GetDelta_Time(iPoint) != 0.0) { - Delta = Vol / nodes->GetDelta_Time(iPoint); - SetPreconditioner(config, iPoint); - for (iVar = 0; iVar < nVar; iVar ++ ) { - for (jVar = 0; jVar < nVar; jVar ++ ) { - Preconditioner[iVar][jVar] = Delta*Preconditioner[iVar][jVar]; - } - } - Jacobian.AddBlock2Diag(iPoint, Preconditioner); - } else { - Jacobian.SetVal2Diag(iPoint, 1.0); - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = 0.0; - local_Res_TruncError[iVar] = 0.0; - } - } - - /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ + struct IncPrec { + const CIncEulerSolver* solver; + const bool active = true; + su2activematrix matrix; - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); - LinSysSol[total_index] = 0.0; - AddRes_RMS(iVar, LinSysRes[total_index]*LinSysRes[total_index]); - AddRes_Max(iVar, fabs(LinSysRes[total_index]), geometry->nodes->GetGlobalIndex(iPoint), geometry->nodes->GetCoord(iPoint)); - } - - } - - /*--- Initialize residual and solution at the ghost points ---*/ - - for (iPoint = nPointDomain; iPoint < nPoint; iPoint++) { - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = 0.0; - LinSysSol[total_index] = 0.0; - } - } - - /*--- Solve or smooth the linear system ---*/ - - IterLinSol = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); - - /*--- Store the value of the residual. ---*/ - - SetResLinSolver(System.GetResidual()); - - /*--- The the number of iterations of the linear solver ---*/ - - SetIterLinSolver(IterLinSol); + IncPrec(const CIncEulerSolver* s, unsigned short nVar) : solver(s) { matrix.resize(nVar,nVar); } - /*--- Update solution (system written in terms of increments) ---*/ - - if (!adjoint) { - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - for (iVar = 0; iVar < nVar; iVar++) { - nodes->AddSolution(iPoint, iVar, nodes->GetUnderRelaxation(iPoint)*LinSysSol[iPoint*nVar+iVar]); - } + FORCEINLINE const su2activematrix& operator() (const CConfig* config, unsigned long iPoint, su2double delta) { + solver->SetPreconditioner(config, iPoint, delta, matrix); + return matrix; } - } - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); - } + } precond(this, nVar); - /*--- MPI solution ---*/ - - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - - /*--- Compute the root mean square residual ---*/ - - SetResidual_RMS(geometry, config); - - /*--- For verification cases, compute the global error metrics. ---*/ - - ComputeVerificationError(geometry, config); + ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, false); } @@ -1873,12 +1767,13 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co } -void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint) { +void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint, + su2double delta, su2activematrix& Preconditioner) const { - unsigned short iDim, jDim; + unsigned short iDim, jDim, iVar, jVar; su2double BetaInc2, Density, dRhodT, Temperature, oneOverCp, Cp; - su2double Velocity[3] = {0.0,0.0,0.0}; + su2double Velocity[MAXNDIM] = {0.0}; bool variable_density = (config->GetKind_DensityModel() == VARIABLE); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); @@ -1936,6 +1831,10 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo if (energy) Preconditioner[nDim+1][nDim+1] = Cp*(dRhodT*Temperature + Density); else Preconditioner[nDim+1][nDim+1] = 1.0; + for (iVar = 0; iVar < nVar; iVar ++ ) + for (jVar = 0; jVar < nVar; jVar ++ ) + Preconditioner[iVar][jVar] = delta*Preconditioner[iVar][jVar]; + } else { /*--- For explicit calculations, we move the residual to the diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index a86c60d2fadf..47d159596729 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1076,77 +1076,12 @@ void CNEMOEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **so void CNEMOEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - unsigned short iVar; - unsigned long iPoint, total_index, IterLinSol = 0; - su2double Delta, *local_Res_TruncError, Vol; - - /*--- Set maximum residual to zero ---*/ - for (iVar = 0; iVar < nVar; iVar++) { - SetRes_RMS(iVar, 0.0); - SetRes_Max(iVar, 0.0, 0); - } - - /*--- Build implicit system ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Read the residual ---*/ - local_Res_TruncError = nodes->GetResTruncError(iPoint); - - /*--- Read the volume ---*/ - Vol = geometry-> nodes->GetVolume(iPoint); - - /*--- Modify matrix diagonal to assure diagonal dominance ---*/ - if (nodes->GetDelta_Time(iPoint) != 0.0) { - Delta = Vol / nodes->GetDelta_Time(iPoint); - Jacobian.AddVal2Diag(iPoint, Delta); - } - else { - Jacobian.SetVal2Diag(iPoint, 1.0); - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = 0.0; - local_Res_TruncError[iVar] = 0.0; - } - } - - /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); - LinSysSol[total_index] = 0.0; - AddRes_RMS(iVar, LinSysRes[total_index]*LinSysRes[total_index]); - AddRes_Max(iVar, fabs(LinSysRes[total_index]), geometry-> nodes->GetGlobalIndex(iPoint), geometry->nodes->GetCoord(iPoint)); - } - } - - /*--- Initialize residual and solution at the ghost points ---*/ - for (iPoint = nPointDomain; iPoint < nPoint; iPoint++) { - for (iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; - LinSysRes[total_index] = 0.0; - LinSysSol[total_index] = 0.0; - } - } - - /*--- Solve or smooth the linear system ---*/ - IterLinSol = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); - - /*--- The the number of iterations of the linear solver ---*/ - SetIterLinSolver(IterLinSol); - - /*--- Update solution (system written in terms of increments) ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - for (iVar = 0; iVar < nVar; iVar++) { - nodes->AddSolution(iPoint,iVar, nodes->GetUnderRelaxation(iPoint)*LinSysSol[iPoint*nVar+iVar]); - } - } - - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); + struct DummyPrec { + const bool active = false; + FORCEINLINE su2double** operator() (const CConfig*, unsigned long, su2double) const { return nullptr; } + } precond; - /*--- Compute the root mean square residual ---*/ - SetResidual_RMS(geometry, config); + ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, false); } void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMesh) { From 299f0e076155a6055c8ec31704e338f642e19eef Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 19:35:20 +0000 Subject: [PATCH 151/326] IncEuler static arrays of primitives --- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 5 -- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 54 ++++++++------------- 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index ab7ce81b62a7..6889399b2c21 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -38,11 +38,6 @@ */ class CIncEulerSolver : public CFVMFlowSolverBase { protected: - su2double - *Primitive = nullptr, /*!< \brief Auxiliary nPrimVar vector. */ - *Primitive_i = nullptr, /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point i. */ - *Primitive_j = nullptr; /*!< \brief Auxiliary nPrimVar vector for storing the primitive at point j. */ - CFluidModel *FluidModel = nullptr; /*!< \brief fluid model used in the solver */ /*! diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index cd27cd575c39..8a384f4cf951 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -136,12 +136,6 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned AllocateTerribleLegacyTemporaryVariables(); - /*--- Define some auxiliary vectors related to the primitive solution ---*/ - - Primitive = new su2double[nPrimVar] (); - Primitive_i = new su2double[nPrimVar] (); - Primitive_j = new su2double[nPrimVar] (); - /*--- Allocate base class members. ---*/ Allocate(*config); @@ -220,10 +214,6 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned CIncEulerSolver::~CIncEulerSolver(void) { - delete [] Primitive; - delete [] Primitive_i; - delete [] Primitive_j; - delete FluidModel; } @@ -1130,8 +1120,8 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont CNumerics* numerics = numerics_container[CONV_TERM]; - su2double **Gradient_i, **Gradient_j, Project_Grad_i, Project_Grad_j, - *V_i, *V_j, *S_i, *S_j, *Limiter_i = nullptr, *Limiter_j = nullptr; + /*--- Static arrays of MUSCL-reconstructed primitives and secondaries (thread safety). ---*/ + su2double Primitive_i[MAXNVAR] = {0.0}, Primitive_j[MAXNVAR] = {0.0}; unsigned long iEdge, iPoint, jPoint, counter_local = 0, counter_global = 0; unsigned short iDim, iVar; @@ -1158,20 +1148,25 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Get primitive variables ---*/ - V_i = nodes->GetPrimitive(iPoint); V_j = nodes->GetPrimitive(jPoint); - S_i = nodes->GetSecondary(iPoint); S_j = nodes->GetSecondary(jPoint); + auto V_i = nodes->GetPrimitive(iPoint); + auto V_j = nodes->GetPrimitive(jPoint); /*--- High order reconstruction using MUSCL strategy ---*/ if (muscl) { + auto Coord_i = geometry->nodes->GetCoord(iPoint); + auto Coord_j = geometry->nodes->GetCoord(jPoint); + + su2double Vector_ij[MAXNDIM] = {0.0}; for (iDim = 0; iDim < nDim; iDim++) { - Vector_i[iDim] = 0.5*(geometry->nodes->GetCoord(jPoint, iDim) - geometry->nodes->GetCoord(iPoint, iDim)); - Vector_j[iDim] = 0.5*(geometry->nodes->GetCoord(iPoint, iDim) - geometry->nodes->GetCoord(jPoint, iDim)); + Vector_ij[iDim] = 0.5*(Coord_j[iDim] - Coord_i[iDim]); } - Gradient_i = nodes->GetGradient_Reconstruction(iPoint); - Gradient_j = nodes->GetGradient_Reconstruction(jPoint); + auto Gradient_i = nodes->GetGradient_Reconstruction(iPoint); + auto Gradient_j = nodes->GetGradient_Reconstruction(jPoint); + + su2double *Limiter_i = nullptr, *Limiter_j = nullptr; if (limiter) { Limiter_i = nodes->GetLimiter_Primitive(iPoint); @@ -1179,10 +1174,10 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont } for (iVar = 0; iVar < nPrimVarGrad; iVar++) { - Project_Grad_i = 0.0; Project_Grad_j = 0.0; + su2double Project_Grad_i = 0.0, Project_Grad_j = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - Project_Grad_i += Vector_i[iDim]*Gradient_i[iVar][iDim]; - Project_Grad_j += Vector_j[iDim]*Gradient_j[iVar][iDim]; + Project_Grad_i += Vector_ij[iDim]*Gradient_i[iVar][iDim]; + Project_Grad_j -= Vector_ij[iDim]*Gradient_j[iVar][iDim]; } if (limiter) { if (van_albada){ @@ -1217,17 +1212,8 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont bool neg_density_i = (Primitive_i[nDim+2] < 0.0); bool neg_density_j = (Primitive_j[nDim+2] < 0.0); - if (neg_density_i || neg_temperature_i) { - nodes->SetNon_Physical(iPoint, true); - } else { - nodes->SetNon_Physical(iPoint, false); - } - - if (neg_density_j || neg_temperature_j) { - nodes->SetNon_Physical(jPoint, true); - } else { - nodes->SetNon_Physical(jPoint, false); - } + nodes->SetNon_Physical(iPoint, neg_density_i || neg_temperature_i); + nodes->SetNon_Physical(jPoint, neg_density_j || neg_temperature_j); /* Lastly, check for existing first-order points still active from previous iterations. */ @@ -1248,10 +1234,9 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont } else { - /*--- Set conservative variables without reconstruction ---*/ + /*--- Set primitive variables without reconstruction ---*/ numerics->SetPrimitive(V_i, V_j); - numerics->SetSecondary(S_i, S_j); } @@ -2763,6 +2748,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, Velocity2, Density, Area, AxiFactor; unsigned short iMarker_Outlet, nMarker_Outlet; string Inlet_TagBound, Outlet_TagBound; + su2double Vector[MAXNDIM] = {0.0}; bool axisymmetric = config->GetAxisymmetric(); From 494b0cbde76241df55412018addcf184322c45b1 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 21:11:08 +0000 Subject: [PATCH 152/326] fix some virtual specifiers of CNEMOEulerVariable --- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CSolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSASolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 2 +- .../include/variables/CNEMOEulerVariable.hpp | 22 +++++++++---------- SU2_CFD/include/variables/CNEMONSVariable.hpp | 11 ---------- SU2_CFD/src/solvers/CEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- 9 files changed, 18 insertions(+), 29 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index df13f802b1c1..a4bd9f1411b9 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -1117,7 +1117,7 @@ class CEulerSolver : public CFVMFlowSolverBase { * \brief Set the solution using the Freestream values. * \param[in] config - Definition of the particular problem. */ - void SetFreeStream_Solution(CConfig *config) final; + void SetFreeStream_Solution(const CConfig *config) final; /*! * \brief Initilize turbo containers. diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 6889399b2c21..1c22ab8a7f83 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -393,7 +393,7 @@ class CIncEulerSolver : public CFVMFlowSolverBaseSetSolution(iPoint, 0, nu_tilde_Inf); } diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index a1f7df67848d..205194444cfa 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -239,7 +239,7 @@ class CTurbSSTSolver final : public CTurbSolver { * \brief Set the solution using the Freestream values. * \param[in] config - Definition of the particular problem. */ - inline void SetFreeStream_Solution(CConfig *config) override { + inline void SetFreeStream_Solution(const CConfig *config) override { for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++){ nodes->SetSolution(iPoint, 0, kine_Inf); nodes->SetSolution(iPoint, 1, omega_Inf); diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index 9e29f47ed552..dea4fbbbb67f 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -141,7 +141,7 @@ class CNEMOEulerVariable : public CVariable { * \param[in] iVar - Index of the variable. * \return Set the value of the primitive variable for the index iVar. */ - inline void SetPrimitive(unsigned long iPoint, unsigned long iVar, su2double val_prim) override { Primitive(iPoint,iVar) = val_prim; } + inline void SetPrimitive(unsigned long iPoint, unsigned long iVar, su2double val_prim) final { Primitive(iPoint,iVar) = val_prim; } /*! * \brief Set the value of the primitive variables. @@ -283,7 +283,7 @@ class CNEMOEulerVariable : public CVariable { * \param[in] iDim - Index of the dimension. * \param[in] value - Value of the reconstruction gradient component. */ - inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) override { + inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { Gradient_Reconstruction(iPoint,iVar,iDim) = value; } @@ -364,7 +364,7 @@ class CNEMOEulerVariable : public CVariable { * \brief Set the norm 2 of the velocity. * \return Norm 2 of the velocity vector. */ - void SetVelocity2(unsigned long iPoint) override; + void SetVelocity2(unsigned long iPoint) final; /*! * \brief Get the norm 2 of the velocity. @@ -459,28 +459,28 @@ class CNEMOEulerVariable : public CVariable { * \brief A virtual member. * \return Value of the vibrational-electronic temperature. */ - inline su2double GetTemperature_ve(unsigned long iPoint) const override + inline su2double GetTemperature_ve(unsigned long iPoint) const final { return Primitive(iPoint,TVE_INDEX); } /*! * \brief Sets the vibrational electronic temperature of the flow. * \return Value of the temperature of the flow. */ - inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve) override + inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve) final { Primitive(iPoint,TVE_INDEX) = val_Tve; return false; } /*! * \brief Get the mixture specific heat at constant volume (trans.-rot.). * \return \f$\rho C^{t-r}_{v} \f$ */ - inline su2double GetRhoCv_tr(unsigned long iPoint) const override + inline su2double GetRhoCv_tr(unsigned long iPoint) const final { return Primitive(iPoint,RHOCVTR_INDEX); } /*! * \brief Get the mixture specific heat at constant volume (vib.-el.). * \return \f$\rho C^{v-e}_{v} \f$ */ - inline su2double GetRhoCv_ve(unsigned long iPoint) const override + inline su2double GetRhoCv_ve(unsigned long iPoint) const final { return Primitive(iPoint,RHOCVVE_INDEX); } /*! @@ -496,24 +496,24 @@ class CNEMOEulerVariable : public CVariable { /*! * \brief Set partial derivative of pressure w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$ */ - inline su2double *GetdPdU(unsigned long iPoint) override { return dPdU[iPoint]; } + inline su2double *GetdPdU(unsigned long iPoint) final { return dPdU[iPoint]; } /*! * \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial T}{\partial \rho_s}\f$ */ - inline su2double *GetdTdU(unsigned long iPoint) override { return dTdU[iPoint]; } + inline su2double *GetdTdU(unsigned long iPoint) final { return dTdU[iPoint]; } /*! * \brief Set partial derivative of vib.-el. temperature w.r.t. density \f$\frac{\partial T^{V-E}}{\partial \rho_s}\f$ */ - inline su2double *GetdTvedU(unsigned long iPoint) override { return dTvedU[iPoint]; } + inline su2double *GetdTvedU(unsigned long iPoint) final { return dTvedU[iPoint]; } /*! * \brief Get the mass fraction \f$\rho_s / \rho \f$ of species s. * \param[in] val_Species - Index of species s. * \return Value of the mass fraction of species s. */ - inline su2double GetMassFraction(unsigned long iPoint, unsigned long val_Species) const override { + inline su2double GetMassFraction(unsigned long iPoint, unsigned long val_Species) const final { return Primitive(iPoint,RHOS_INDEX+val_Species) / Primitive(iPoint,RHO_INDEX); } diff --git a/SU2_CFD/include/variables/CNEMONSVariable.hpp b/SU2_CFD/include/variables/CNEMONSVariable.hpp index 5531409ce8e0..657e5aac85ae 100644 --- a/SU2_CFD/include/variables/CNEMONSVariable.hpp +++ b/SU2_CFD/include/variables/CNEMONSVariable.hpp @@ -104,17 +104,6 @@ class CNEMONSVariable final : public CNEMOEulerVariable { */ inline const MatrixType& GetPrimitive_Aux(void) const { return Primitive_Aux; } - /*! - * \brief Set the value of the reconstruction variables gradient at a node. - * \param[in] iPoint - Index of the current node. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value of the reconstruction gradient component. - */ - /* Works as a dummy function for consistency since no reconstruction is needed for primitive variables*/ - inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) override { } - - /*! * \brief Set all the primitive variables for compressible flows. */ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index ea7ac5e20315..d692ad7e5deb 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -9607,7 +9607,7 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig } -void CEulerSolver::SetFreeStream_Solution(CConfig *config) { +void CEulerSolver::SetFreeStream_Solution(const CConfig *config) { unsigned long iPoint; unsigned short iDim; diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 8a384f4cf951..727ddef7c979 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -3193,7 +3193,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf } -void CIncEulerSolver::SetFreeStream_Solution(CConfig *config){ +void CIncEulerSolver::SetFreeStream_Solution(const CConfig *config){ unsigned long iPoint; unsigned short iDim; From da868815b52698edc9206588d41d210be6cfa426 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 22:17:31 +0000 Subject: [PATCH 153/326] Avoid member arrays in IncSolver dual-time res --- Common/include/linear_algebra/CSysMatrix.hpp | 12 + SU2_CFD/src/solvers/CIncEulerSolver.cpp | 293 ++++++------------- 2 files changed, 108 insertions(+), 197 deletions(-) diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index 54e8110aac3b..cfde0c3b1f1e 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -748,6 +748,18 @@ class CSysMatrix { matrix[dia_ptr[block_i]*nVar*nVar + iVar*(nVar+1)] += PassiveAssign(val_matrix); } + /*! + * \brief Adds the specified value to the diagonal of the (i, i) subblock + * of the matrix-by-blocks structure. + * \param[in] block_i - Diagonal index. + * \param[in] iVar - Variable index. + * \param[in] val - Value to add to the diagonal elements of A(i, i). + */ + template + inline void AddVal2Diag(unsigned long block_i, unsigned long iVar, OtherType val) { + matrix[dia_ptr[block_i]*nVar*nVar + iVar*(nVar+1)] += PassiveAssign(val); + } + /*! * \brief Sets the specified value to the diagonal of the (i, i) subblock * of the matrix-by-blocks structure. diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 727ddef7c979..4e9f4f46b7aa 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -132,10 +132,6 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned SetVerificationSolution(nDim, nVar, config); - /// TODO: This type of variables will be replaced. - - AllocateTerribleLegacyTemporaryVariables(); - /*--- Allocate base class members. ---*/ Allocate(*config); @@ -2418,18 +2414,26 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Local variables ---*/ - unsigned short iVar, jVar, iMarker, iDim; + unsigned short iVar, iMarker, iDim, iNeigh; unsigned long iPoint, jPoint, iEdge, iVertex; - su2double Density, Cp; - su2double *V_time_nM1, *V_time_n, *V_time_nP1; - su2double U_time_nM1[5], U_time_n[5], U_time_nP1[5]; + const su2double *V_time_nM1 = nullptr, *V_time_n = nullptr, *V_time_nP1 = nullptr; + su2double U_time_nM1[MAXNVAR], U_time_n[MAXNVAR], U_time_nP1[MAXNVAR]; su2double Volume_nM1, Volume_nP1, TimeStep; - su2double *GridVel_i = nullptr, *GridVel_j = nullptr, Residual_GCL; - const su2double* Normal; + const su2double *Normal = nullptr, *GridVel_i = nullptr, *GridVel_j = nullptr; + su2double Density, Cp; - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool energy = config->GetEnergy_Equation(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); + const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool energy = config->GetEnergy_Equation(); + + const int ndim = nDim; + auto V2U = [ndim](su2double Density, su2double Cp, const su2double* V, su2double* U) { + U[0] = Density; + for (int iDim = 0; iDim < ndim; iDim++) U[iDim+1] = Density*V[iDim+1]; + U[ndim+1] = Density*Cp*V[ndim+1]; + }; /*--- Store the physical time step ---*/ @@ -2441,18 +2445,9 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Loop over all nodes (excluding halos) ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - /*--- Initialize the Residual / Jacobian container to zero. ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Residual[iVar] = 0.0; - if (implicit) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - } - } - /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, previous solutions that are stored in memory. These are actually @@ -2464,24 +2459,14 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Access the density and Cp at this node (constant for now). ---*/ - Density = nodes->GetDensity(iPoint); - Cp = nodes->GetSpecificHeatCp(iPoint); + Density = nodes->GetDensity(iPoint); + Cp = nodes->GetSpecificHeatCp(iPoint); /*--- Compute the conservative variable vector for all time levels. ---*/ - U_time_nM1[0] = Density; - U_time_n[0] = Density; - U_time_nP1[0] = Density; - - for (iDim = 0; iDim < nDim; iDim++) { - U_time_nM1[iDim+1] = Density*V_time_nM1[iDim+1]; - U_time_n[iDim+1] = Density*V_time_n[iDim+1]; - U_time_nP1[iDim+1] = Density*V_time_nP1[iDim+1]; - } - - U_time_nM1[nDim+1] = Density*Cp*V_time_nM1[nDim+1]; - U_time_n[nDim+1] = Density*Cp*V_time_n[nDim+1]; - U_time_nP1[nDim+1] = Density*Cp*V_time_nP1[nDim+1]; + V2U(Density, Cp, V_time_nM1, U_time_nM1); + V2U(Density, Cp, V_time_n, U_time_n); + V2U(Density, Cp, V_time_nP1, U_time_nP1); /*--- CV volume at time n+1. As we are on a static mesh, the volume of the CV will remained fixed for all time steps. ---*/ @@ -2489,41 +2474,28 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver Volume_nP1 = geometry->nodes->GetVolume(iPoint); /*--- Compute the dual time-stepping source term based on the chosen - time discretization scheme (1st- or 2nd-order). Note that for an - incompressible problem, the pressure equation does not have a - contribution, as the time derivative should always be zero. ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Residual[iVar] = ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] - +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); + time discretization scheme (1st- or 2nd-order).---*/ + + for (iVar = 0; iVar < nVar-!energy; iVar++) { + if (first_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; + if (second_order) + LinSysRes(iPoint,iVar) += ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] + +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } - if (!energy) Residual[nDim+1] = 0.0; - - /*--- Store the residual and compute the Jacobian contribution due - to the dual time source term. ---*/ - - LinSysRes.AddBlock(iPoint, Residual); + /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ if (implicit) { - for (iVar = 1; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); - } + su2double delta = (second_order? 1.5 : 1.0) * Volume_nP1 * Density / TimeStep; + for (iDim = 0; iDim < nDim; iDim++) - Jacobian_i[iDim+1][iDim+1] = Density*Jacobian_i[iDim+1][iDim+1]; - if (energy) Jacobian_i[nDim+1][nDim+1] = Density*Cp*Jacobian_i[nDim+1][nDim+1]; + Jacobian.AddVal2Diag(iPoint, iDim+1, delta); - Jacobian.AddBlock2Diag(iPoint, Jacobian_i); + if (energy) delta *= Cp; + Jacobian.AddVal2Diag(iPoint, nDim+1, delta); } - } - } else { @@ -2536,141 +2508,86 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver we will loop over the edges and boundaries to compute the GCL component of the dual time source term that depends on grid velocities. ---*/ - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - /*--- Initialize the Residual / Jacobian container to zero. ---*/ - - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - - /*--- Get indices for nodes i & j plus the face normal ---*/ - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - Normal = geometry->edges->GetNormal(iEdge); - - /*--- Grid velocities stored at nodes i & j ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { - GridVel_i = geometry->nodes->GetGridVel(iPoint); - GridVel_j = geometry->nodes->GetGridVel(jPoint); - - /*--- Compute the GCL term by averaging the grid velocities at the - edge mid-point and dotting with the face normal. ---*/ - - Residual_GCL = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Residual_GCL += 0.5*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; - - /*--- Compute the GCL component of the source term for node i ---*/ + /*--- Compute the conservative variables. ---*/ V_time_n = nodes->GetSolution_time_n(iPoint); + Density = nodes->GetDensity(iPoint); + Cp = nodes->GetSpecificHeatCp(iPoint); + V2U(Density, Cp, V_time_n, U_time_n); - /*--- Access the density and Cp at this node (constant for now). ---*/ - - Density = nodes->GetDensity(iPoint); - Cp = nodes->GetSpecificHeatCp(iPoint); - - /*--- Compute the conservative variable vector for all time levels. ---*/ + GridVel_i = geometry->nodes->GetGridVel(iPoint); - U_time_n[0] = Density; - for (iDim = 0; iDim < nDim; iDim++) { - U_time_n[iDim+1] = Density*V_time_n[iDim+1]; - } - U_time_n[nDim+1] = Density*Cp*V_time_n[nDim+1]; + for (iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); iNeigh++) { - for (iVar = 0; iVar < nVar; iVar++) - Residual[iVar] = U_time_n[iVar]*Residual_GCL; + iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); + Normal = geometry->edges->GetNormal(iEdge); - if (!energy) Residual[nDim+1] = 0.0; - LinSysRes.AddBlock(iPoint, Residual); + jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); + GridVel_j = geometry->nodes->GetGridVel(jPoint); - /*--- Compute the GCL component of the source term for node j ---*/ + /*--- Determine whether to consider the normal outward or inward. ---*/ + su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; - V_time_n = nodes->GetSolution_time_n(jPoint); + su2double Residual_GCL = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + Residual_GCL += dir*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; - U_time_n[0] = Density; - for (iDim = 0; iDim < nDim; iDim++) { - U_time_n[iDim+1] = Density*V_time_n[iDim+1]; + for (iVar = 0; iVar < nVar-!energy; iVar++) + LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; } - U_time_n[nDim+1] = Density*Cp*V_time_n[nDim+1]; - - for (iVar = 0; iVar < nVar; iVar++) - Residual[iVar] = U_time_n[iVar]*Residual_GCL; - - if (!energy) Residual[nDim+1] = 0.0; - LinSysRes.SubtractBlock(jPoint, Residual); - } - /*--- Loop over the boundary edges ---*/ + /*--- Loop over the boundary edges ---*/ for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - /*--- Initialize the Residual / Jacobian container to zero. ---*/ + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; + /*--- Get the index for node i plus the boundary face normal ---*/ - /*--- Get the index for node i plus the boundary face normal ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - /*--- Grid velocities stored at boundary node i ---*/ - - GridVel_i = geometry->nodes->GetGridVel(iPoint); + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - /*--- Compute the GCL term by dotting the grid velocity with the face - normal. The normal is negated to match the boundary convention. ---*/ + /*--- Grid velocities stored at boundary node i ---*/ - Residual_GCL = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Residual_GCL -= 0.5*(GridVel_i[iDim]+GridVel_i[iDim])*Normal[iDim]; + GridVel_i = geometry->nodes->GetGridVel(iPoint); - /*--- Compute the GCL component of the source term for node i ---*/ + /*--- Compute the GCL term by dotting the grid velocity with the face + normal. The normal is negated to match the boundary convention. ---*/ - V_time_n = nodes->GetSolution_time_n(iPoint); + su2double Residual_GCL = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + Residual_GCL -= 0.5*(GridVel_i[iDim]+GridVel_i[iDim])*Normal[iDim]; - /*--- Access the density and Cp at this node (constant for now). ---*/ + /*--- Compute the GCL component of the source term for node i ---*/ - Density = nodes->GetDensity(iPoint); - Cp = nodes->GetSpecificHeatCp(iPoint); + V_time_n = nodes->GetSolution_time_n(iPoint); + Density = nodes->GetDensity(iPoint); + Cp = nodes->GetSpecificHeatCp(iPoint); + V2U(Density, Cp, V_time_n, U_time_n); - U_time_n[0] = Density; - for (iDim = 0; iDim < nDim; iDim++) { - U_time_n[iDim+1] = Density*V_time_n[iDim+1]; + for (iVar = 0; iVar < nVar-!energy; iVar++) + LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; } - U_time_n[nDim+1] = Density*Cp*V_time_n[nDim+1]; - - for (iVar = 0; iVar < nVar; iVar++) - Residual[iVar] = U_time_n[iVar]*Residual_GCL; - - if (!energy) Residual[nDim+1] = 0.0; - LinSysRes.AddBlock(iPoint, Residual); - - } } } /*--- Loop over all nodes (excluding halos) to compute the remainder of the dual time-stepping source term. ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - /*--- Initialize the Residual / Jacobian container to zero. ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Residual[iVar] = 0.0; - if (implicit) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - } - } - /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, - previous solutions that are stored in memory. ---*/ + previous solutions that are stored in memory. These are actually + the primitive values, but we will convert to conservatives. ---*/ V_time_nM1 = nodes->GetSolution_time_n1(iPoint); V_time_n = nodes->GetSolution_time_n(iPoint); @@ -2678,24 +2595,14 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Access the density and Cp at this node (constant for now). ---*/ - Density = nodes->GetDensity(iPoint); - Cp = nodes->GetSpecificHeatCp(iPoint); + Density = nodes->GetDensity(iPoint); + Cp = nodes->GetSpecificHeatCp(iPoint); /*--- Compute the conservative variable vector for all time levels. ---*/ - U_time_nM1[0] = Density; - U_time_n[0] = Density; - U_time_nP1[0] = Density; - - for (iDim = 0; iDim < nDim; iDim++) { - U_time_nM1[iDim+1] = Density*V_time_nM1[iDim+1]; - U_time_n[iDim+1] = Density*V_time_n[iDim+1]; - U_time_nP1[iDim+1] = Density*V_time_nP1[iDim+1]; - } - - U_time_nM1[nDim+1] = Density*Cp*V_time_nM1[nDim+1]; - U_time_n[nDim+1] = Density*Cp*V_time_n[nDim+1]; - U_time_nP1[nDim+1] = Density*Cp*V_time_nP1[nDim+1]; + V2U(Density, Cp, V_time_nM1, U_time_nM1); + V2U(Density, Cp, V_time_n, U_time_n); + V2U(Density, Cp, V_time_nP1, U_time_nP1); /*--- CV volume at time n-1 and n+1. In the case of dynamically deforming grids, the volumes will change. On rigidly transforming grids, the @@ -2708,33 +2615,25 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver introduction of the GCL term above, the remainder of the source residual due to the time discretization has a new form.---*/ - for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) - + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); + for (iVar = 0; iVar < nVar-!energy; iVar++) { + if (first_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); + if (second_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); } - /*--- Store the residual and compute the Jacobian contribution due - to the dual time source term. ---*/ - if (!energy) Residual[nDim+1] = 0.0; - LinSysRes.AddBlock(iPoint, Residual); + /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ if (implicit) { - for (iVar = 1; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); - } + su2double delta = (second_order? 1.5 : 1.0) * Volume_nP1 * Density / TimeStep; + for (iDim = 0; iDim < nDim; iDim++) - Jacobian_i[iDim+1][iDim+1] = Density*Jacobian_i[iDim+1][iDim+1]; - if (energy) Jacobian_i[nDim+1][nDim+1] = Density*Cp*Jacobian_i[nDim+1][nDim+1]; + Jacobian.AddVal2Diag(iPoint, iDim+1, delta); - Jacobian.AddBlock2Diag(iPoint, Jacobian_i); + if (energy) delta *= Cp; + Jacobian.AddVal2Diag(iPoint, nDim+1, delta); } - } } From 71bfe145a413ef403a22cfdff9ed086a26aff11a Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 23 Jan 2021 23:25:05 +0000 Subject: [PATCH 154/326] fix leak in LoadRestart --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 4e9f4f46b7aa..f223f820c5f6 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2888,7 +2888,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf unsigned short iDim, iVar, iMesh, iMeshFine; unsigned long iPoint, index, iChildren, Point_Fine; unsigned short turb_model = config->GetKind_Turb_Model(); - su2double Area_Children, Area_Parent, Coord[3] = {0.0}, *Solution_Fine; + su2double Area_Children, Area_Parent, Coord[MAXNDIM] = {0.0}, *Solution_Fine; bool static_fsi = ((config->GetTime_Marching() == STEADY) && config->GetFSI_Simulation()); bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == DT_STEPPING_2ND)); @@ -2923,6 +2923,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf unsigned short nVar_Restart = nVar; if ((!energy) && (!weakly_coupled_heat)) nVar_Restart--; + su2double Solution[MAXNVAR] = {0.0}; Solution[nVar-1] = GetTemperature_Inf(); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ @@ -2966,7 +2967,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf index = counter*Restart_Vars[1]; for (iDim = 0; iDim < nDim; iDim++) { Coord[iDim] = Restart_Data[index+iDim]; } - su2double GridVel[3] = {0.0,0.0,0.0}; + su2double GridVel[MAXNDIM] = {0.0}; if (!steady_restart) { /*--- Move the index forward to get the grid velocities. ---*/ index = counter*Restart_Vars[1] + skipVars + nVar_Restart + turbVars; From 29f7cd1642710f5f7124ea3025a56b415243458f Mon Sep 17 00:00:00 2001 From: bigfootedrockmidget Date: Sun, 24 Jan 2021 11:06:51 +0100 Subject: [PATCH 155/326] fixed typo --- TestCases/serial_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 41835db722f3..fb42f03fa87e 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1522,7 +1522,7 @@ def main(): intersect_def.tol = 1e-04 pass_list.append(intersect_def.run_def()) - test_list.append(intersec_def) + test_list.append(intersect_def) # Inviscid NACA0012 (triangles) naca0012_def = TestCase('naca0012_def') From 6d12484a3fe12c527e391a8e86f8429c96e58aef Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 10:39:21 +0000 Subject: [PATCH 156/326] dual time residual seems to be the same for NEMO --- SU2_CFD/include/solvers/CEulerSolver.hpp | 16 -- .../include/solvers/CFVMFlowSolverBase.hpp | 12 ++ .../include/solvers/CFVMFlowSolverBase.inl | 177 ++++++++++++++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 19 +- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 13 -- SU2_CFD/src/solvers/CEulerSolver.cpp | 176 ----------------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 8 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 63 ------- 8 files changed, 196 insertions(+), 288 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index a4bd9f1411b9..5eb2935751d4 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -1071,22 +1071,6 @@ class CEulerSolver : public CFVMFlowSolverBase { */ void UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config) final; - /*! - * \brief Set the total residual adding the term that comes from the Dual Time Strategy. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] iRKStep - Current step of the Runge-Kutta iteration. - * \param[in] iMesh - Index of the mesh in multigrid computations. - * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - */ - void SetResidual_DualTime(CGeometry *geometry, - CSolver **solver_container, - CConfig *config, - unsigned short iRKStep, - unsigned short iMesh, - unsigned short RunTime_EqSystem) final; - /*! * \brief Load a solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index dff77aafbd5c..836f01659688 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -1029,6 +1029,18 @@ class CFVMFlowSolverBase : public CSolver { */ void ComputeUnderRelaxationFactor(CSolver** solver, const CConfig* config) final; + /*! + * \brief Set the total residual adding the term that comes from the Dual Time Strategy. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] iRKStep - Current step of the Runge-Kutta iteration. + * \param[in] iMesh - Index of the mesh in multigrid computations. + * \param[in] RunTime_EqSystem - System of equations which is going to be solved. + */ + void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, + unsigned short iMesh, unsigned short RunTime_EqSystem) override; + /*! * \brief Set a uniform inlet profile * diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 8cfcdcd299b3..d2ccebcb9676 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1341,6 +1341,183 @@ void CFVMFlowSolverBase::SumEdgeFluxes(const CGeometry* geometry) { } } +template +void CFVMFlowSolverBase::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iRKStep, unsigned short iMesh, + unsigned short RunTime_EqSystem) { + /*--- Local variables ---*/ + + unsigned short iVar, iMarker, iDim, iNeigh; + unsigned long iPoint, jPoint, iEdge, iVertex; + + const su2double *U_time_nM1 = nullptr, *U_time_n = nullptr, *U_time_nP1 = nullptr; + su2double Volume_nM1, Volume_nP1, TimeStep; + const su2double *Normal = nullptr, *GridVel_i = nullptr, *GridVel_j = nullptr; + su2double Residual_GCL; + + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); + const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); + + /*--- Store the physical time step ---*/ + + TimeStep = config->GetDelta_UnstTimeND(); + + /*--- Compute the dual time-stepping source term for static meshes ---*/ + + if (!dynamic_grid) { + + /*--- Loop over all nodes (excluding halos) ---*/ + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that + we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, + previous solutions that are stored in memory. ---*/ + + U_time_nM1 = nodes->GetSolution_time_n1(iPoint); + U_time_n = nodes->GetSolution_time_n(iPoint); + U_time_nP1 = nodes->GetSolution(iPoint); + + /*--- CV volume at time n+1. As we are on a static mesh, the volume + of the CV will remained fixed for all time steps. ---*/ + + Volume_nP1 = geometry->nodes->GetVolume(iPoint); + + /*--- Compute the dual time-stepping source term based on the chosen + time discretization scheme (1st- or 2nd-order).---*/ + + for (iVar = 0; iVar < nVar; iVar++) { + if (first_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; + if (second_order) + LinSysRes(iPoint,iVar) += ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] + +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); + } + + /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ + if (implicit) { + if (first_order) Jacobian.AddVal2Diag(iPoint, Volume_nP1/TimeStep); + if (second_order) Jacobian.AddVal2Diag(iPoint, (Volume_nP1*3.0)/(2.0*TimeStep)); + } + } + + } + + else { + + /*--- For unsteady flows on dynamic meshes (rigidly transforming or + dynamically deforming), the Geometric Conservation Law (GCL) should be + satisfied in conjunction with the ALE formulation of the governing + equations. The GCL prevents accuracy issues caused by grid motion, i.e. + a uniform free-stream should be preserved through a moving grid. First, + we will loop over the edges and boundaries to compute the GCL component + of the dual time source term that depends on grid velocities. ---*/ + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { + + GridVel_i = geometry->nodes->GetGridVel(iPoint); + U_time_n = nodes->GetSolution_time_n(iPoint); + + for (iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); iNeigh++) { + + iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); + Normal = geometry->edges->GetNormal(iEdge); + + jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); + GridVel_j = geometry->nodes->GetGridVel(jPoint); + + /*--- Determine whether to consider the normal outward or inward. ---*/ + su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; + + Residual_GCL = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + Residual_GCL += dir*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; + + for (iVar = 0; iVar < nVar; iVar++) + LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; + } + } + + /*--- Loop over the boundary edges ---*/ + + for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && + (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { + + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { + + /*--- Get the index for node i plus the boundary face normal ---*/ + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + /*--- Grid velocities stored at boundary node i ---*/ + + GridVel_i = geometry->nodes->GetGridVel(iPoint); + + /*--- Compute the GCL term by dotting the grid velocity with the face + normal. The normal is negated to match the boundary convention. ---*/ + + Residual_GCL = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + Residual_GCL -= 0.5*(GridVel_i[iDim]+GridVel_i[iDim])*Normal[iDim]; + + /*--- Compute the GCL component of the source term for node i ---*/ + + U_time_n = nodes->GetSolution_time_n(iPoint); + for (iVar = 0; iVar < nVar; iVar++) + LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; + } + } + } + + /*--- Loop over all nodes (excluding halos) to compute the remainder + of the dual time-stepping source term. ---*/ + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that + we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, + previous solutions that are stored in memory. ---*/ + + U_time_nM1 = nodes->GetSolution_time_n1(iPoint); + U_time_n = nodes->GetSolution_time_n(iPoint); + U_time_nP1 = nodes->GetSolution(iPoint); + + /*--- CV volume at time n-1 and n+1. In the case of dynamically deforming + grids, the volumes will change. On rigidly transforming grids, the + volumes will remain constant. ---*/ + + Volume_nM1 = geometry->nodes->GetVolume_nM1(iPoint); + Volume_nP1 = geometry->nodes->GetVolume(iPoint); + + /*--- Compute the dual time-stepping source residual. Due to the + introduction of the GCL term above, the remainder of the source residual + due to the time discretization has a new form.---*/ + + for (iVar = 0; iVar < nVar; iVar++) { + if (first_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); + if (second_order) + LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); + } + + /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ + if (implicit) { + if (first_order) Jacobian.AddVal2Diag(iPoint, Volume_nP1/TimeStep); + if (second_order) Jacobian.AddVal2Diag(iPoint, (Volume_nP1*3.0)/(2.0*TimeStep)); + } + } + } + +} + template void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometry, const CConfig* config) { unsigned long iVertex, iPoint; diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 1c22ab8a7f83..9c1ab37d16d1 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -119,6 +119,12 @@ class CIncEulerSolver : public CFVMFlowSolverBase + void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep); + public: /*! * \brief Constructor of the class. @@ -291,19 +297,6 @@ class CIncEulerSolver : public CFVMFlowSolverBase a,std::vector b); - - /*! - * \brief Generic implementation of explicit iterations with preconditioner. - */ - template - void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep); - /*! * \brief Update the solution using a Runge-Kutta scheme. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index f6e61abfa549..a902523c0fe6 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -304,7 +304,6 @@ class CNEMOEulerSolver : public CFVMFlowSolverBaseGetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); - const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); - - /*--- Store the physical time step ---*/ - - TimeStep = config->GetDelta_UnstTimeND(); - - /*--- Compute the dual time-stepping source term for static meshes ---*/ - - if (!dynamic_grid) { - - /*--- Loop over all nodes (excluding halos) ---*/ - - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that - we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, - previous solutions that are stored in memory. ---*/ - - U_time_nM1 = nodes->GetSolution_time_n1(iPoint); - U_time_n = nodes->GetSolution_time_n(iPoint); - U_time_nP1 = nodes->GetSolution(iPoint); - - /*--- CV volume at time n+1. As we are on a static mesh, the volume - of the CV will remained fixed for all time steps. ---*/ - - Volume_nP1 = geometry->nodes->GetVolume(iPoint); - - /*--- Compute the dual time-stepping source term based on the chosen - time discretization scheme (1st- or 2nd-order).---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - if (first_order) - LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (second_order) - LinSysRes(iPoint,iVar) += ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] - +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); - } - - /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ - if (implicit) { - if (first_order) Jacobian.AddVal2Diag(iPoint, Volume_nP1/TimeStep); - if (second_order) Jacobian.AddVal2Diag(iPoint, (Volume_nP1*3.0)/(2.0*TimeStep)); - } - } - - } - - else { - - /*--- For unsteady flows on dynamic meshes (rigidly transforming or - dynamically deforming), the Geometric Conservation Law (GCL) should be - satisfied in conjunction with the ALE formulation of the governing - equations. The GCL prevents accuracy issues caused by grid motion, i.e. - a uniform free-stream should be preserved through a moving grid. First, - we will loop over the edges and boundaries to compute the GCL component - of the dual time source term that depends on grid velocities. ---*/ - - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { - - GridVel_i = geometry->nodes->GetGridVel(iPoint); - U_time_n = nodes->GetSolution_time_n(iPoint); - - for (iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); iNeigh++) { - - iEdge = geometry->nodes->GetEdge(iPoint, iNeigh); - Normal = geometry->edges->GetNormal(iEdge); - - jPoint = geometry->nodes->GetPoint(iPoint, iNeigh); - GridVel_j = geometry->nodes->GetGridVel(jPoint); - - /*--- Determine whether to consider the normal outward or inward. ---*/ - su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; - - Residual_GCL = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Residual_GCL += dir*(GridVel_i[iDim]+GridVel_j[iDim])*Normal[iDim]; - - for (iVar = 0; iVar < nVar; iVar++) - LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; - } - } - - /*--- Loop over the boundary edges ---*/ - - for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY)) { - - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- Get the index for node i plus the boundary face normal ---*/ - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - /*--- Grid velocities stored at boundary node i ---*/ - - GridVel_i = geometry->nodes->GetGridVel(iPoint); - - /*--- Compute the GCL term by dotting the grid velocity with the face - normal. The normal is negated to match the boundary convention. ---*/ - - Residual_GCL = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Residual_GCL -= 0.5*(GridVel_i[iDim]+GridVel_i[iDim])*Normal[iDim]; - - /*--- Compute the GCL component of the source term for node i ---*/ - - U_time_n = nodes->GetSolution_time_n(iPoint); - for (iVar = 0; iVar < nVar; iVar++) - LinSysRes(iPoint,iVar) += U_time_n[iVar]*Residual_GCL; - } - } - } - - /*--- Loop over all nodes (excluding halos) to compute the remainder - of the dual time-stepping source term. ---*/ - - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Retrieve the solution at time levels n-1, n, and n+1. Note that - we are currently iterating on U^n+1 and that U^n & U^n-1 are fixed, - previous solutions that are stored in memory. ---*/ - - U_time_nM1 = nodes->GetSolution_time_n1(iPoint); - U_time_n = nodes->GetSolution_time_n(iPoint); - U_time_nP1 = nodes->GetSolution(iPoint); - - /*--- CV volume at time n-1 and n+1. In the case of dynamically deforming - grids, the volumes will change. On rigidly transforming grids, the - volumes will remain constant. ---*/ - - Volume_nM1 = geometry->nodes->GetVolume_nM1(iPoint); - Volume_nP1 = geometry->nodes->GetVolume(iPoint); - - /*--- Compute the dual time-stepping source residual. Due to the - introduction of the GCL term above, the remainder of the source residual - due to the time discretization has a new form.---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - if (first_order) - LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); - if (second_order) - LinSysRes(iPoint,iVar) += (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) - + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); - } - - /*--- Compute the Jacobian contribution due to the dual time source term. ---*/ - if (implicit) { - if (first_order) Jacobian.AddVal2Diag(iPoint, Volume_nP1/TimeStep); - if (second_order) Jacobian.AddVal2Diag(iPoint, (Volume_nP1*3.0)/(2.0*TimeStep)); - } - } - } - -} - void CEulerSolver::PrintVerificationError(const CConfig *config) const { if ((rank != MASTER_NODE) || (MGLevel != MESH_0)) return; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 0e8ccfe87095..5dd6b564bbaa 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -297,13 +297,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con su2double proj_vector_ij = 0.0; if (dist_ij_2 > 0.0) proj_vector_ij = GeometryToolbox::DotProduct(nDim, Edge_Vector, Normal) / dist_ij_2; - - auto Blk_i = Jacobian.GetBlock(iPoint, iPoint); -#ifdef CODI_FORWARD_TYPE - Blk_i[nVar*nVar-1] += thermal_conductivity*proj_vector_ij; -#else - Blk_i[nVar*nVar-1] += SU2_TYPE::GetValue(thermal_conductivity*proj_vector_ij); -#endif + Jacobian.AddVal2Diag(iPoint, nDim+1, thermal_conductivity*proj_vector_ij); } } } diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 47d159596729..8e18fd1f5bd8 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -2540,69 +2540,6 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solut // //} -void CNEMOEulerSolver::SetResidual_DualTime(CGeometry *geometry, - CSolver **solution_container, - CConfig *config, - unsigned short iRKStep, - unsigned short iMesh, - unsigned short RunTime_EqSystem) { - unsigned short iVar, jVar; - unsigned long iPoint; - su2double *U_time_nM1, *U_time_n, *U_time_nP1, Volume_nM1, Volume_n, Volume_nP1, TimeStep; - - bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool dynamic_grid = config->GetGrid_Movement(); - - /*--- loop over points ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Solution at time n-1, n and n+1 ---*/ - U_time_nM1 = nodes->GetSolution_time_n1(iPoint); - U_time_n = nodes->GetSolution_time_n(iPoint); - U_time_nP1 = nodes->GetSolution(iPoint); - - /*--- Volume at time n-1 and n ---*/ - if (dynamic_grid) { - Volume_nM1 = geometry->nodes->GetVolume_nM1(iPoint); - Volume_n = geometry->nodes->GetVolume_n(iPoint); - Volume_nP1 = geometry->nodes->GetVolume(iPoint); - } - else { - Volume_nM1 = geometry->nodes->GetVolume(iPoint); - Volume_n = geometry->nodes->GetVolume(iPoint); - Volume_nP1 = geometry->nodes->GetVolume(iPoint); - } - - /*--- Time Step ---*/ - TimeStep = config->GetDelta_UnstTimeND(); - - /*--- Compute Residual ---*/ - for(iVar = 0; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Residual[iVar] = ( U_time_nP1[iVar]*Volume_nP1 - U_time_n[iVar]*Volume_n ) / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Residual[iVar] = ( 3.0*U_time_nP1[iVar]*Volume_nP1 - 4.0*U_time_n[iVar]*Volume_n - + 1.0*U_time_nM1[iVar]*Volume_nM1 ) / (2.0*TimeStep); - } - - /*--- Add Residual ---*/ - LinSysRes.AddBlock(iPoint, Residual); - - if (implicit) { - for (iVar = 0; iVar < nVar; iVar++) { - for (jVar = 0; jVar < nVar; jVar++) - Jacobian_i[iVar][jVar] = 0.0; - - if (config->GetTime_Marching() == DT_STEPPING_1ST) - Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) - Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); - } - Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); - } - } -} - void CNEMOEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { /*--- Restart the solution from file information ---*/ From 203369de1210a5baa353081cc83b2db9cac1c33d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 14:14:42 +0000 Subject: [PATCH 157/326] BC's, fluid model, restart --- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 4 +- SU2_CFD/include/solvers/CTurbSASolver.hpp | 4 +- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 1 + SU2_CFD/src/solvers/CEulerSolver.cpp | 1 + SU2_CFD/src/solvers/CIncEulerSolver.cpp | 157 ++++++++++++-------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 +- 6 files changed, 108 insertions(+), 63 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 9c1ab37d16d1..cb6090e98981 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -38,7 +38,7 @@ */ class CIncEulerSolver : public CFVMFlowSolverBase { protected: - CFluidModel *FluidModel = nullptr; /*!< \brief fluid model used in the solver */ + vector FluidModel; /*!< \brief fluid model used in the solver. */ /*! * \brief Preprocessing actions common to the Euler and NS solvers. @@ -149,7 +149,7 @@ class CIncEulerSolver : public CFVMFlowSolverBaseSetSolution(iPoint, 0, nu_tilde_Inf); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) + nodes->SetSolution(iPoint, 0, nu_tilde_Inf); } /*! diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 205194444cfa..807a3b106130 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -240,6 +240,7 @@ class CTurbSSTSolver final : public CTurbSolver { * \param[in] config - Definition of the particular problem. */ inline void SetFreeStream_Solution(const CConfig *config) override { + SU2_OMP_FOR_STAT(omp_chunk_size) for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++){ nodes->SetSolution(iPoint, 0, kine_Inf); nodes->SetSolution(iPoint, 1, omega_Inf); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 1629d078f7e6..0e9e1da2639e 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -9438,6 +9438,7 @@ void CEulerSolver::SetFreeStream_Solution(const CConfig *config) { unsigned long iPoint; unsigned short iDim; + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPoint; iPoint++) { nodes->SetSolution(iPoint,0, Density_Inf); for (iDim = 0; iDim < nDim; iDim++) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index f223f820c5f6..e720e63ce730 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -136,6 +136,10 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned Allocate(*config); + /*--- MPI + OpenMP initialization. ---*/ + + HybridParallelInitialization(*config, *geometry); + /*--- Jacobians and vector structures for implicit computations ---*/ if (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT) { @@ -143,7 +147,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned if (rank == MASTER_NODE) cout << "Initialize Jacobian structure (" << description << "). MG level: " << iMesh <<"." << endl; - Jacobian.Initialize(nPoint, nPointDomain, nVar, nVar, true, geometry, config); + Jacobian.Initialize(nPoint, nPointDomain, nVar, nVar, true, geometry, config, ReducerStrategy); if (config->GetKind_Linear_Solver_Prec() == LINELET) { nLineLets = Jacobian.BuildLineletPreconditioner(geometry, config); @@ -210,7 +214,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned CIncEulerSolver::~CIncEulerSolver(void) { - delete FluidModel; + for(auto& model : FluidModel) delete model; } void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMesh) { @@ -255,21 +259,23 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Depending on the density model chosen, select a fluid model. ---*/ + CFluidModel* auxFluidModel = nullptr; + switch (config->GetKind_FluidModel()) { case CONSTANT_DENSITY: - FluidModel = new CConstantDensity(Density_FreeStream, config->GetSpecific_Heat_Cp()); - FluidModel->SetTDState_T(Temperature_FreeStream); + auxFluidModel = new CConstantDensity(Density_FreeStream, config->GetSpecific_Heat_Cp()); + auxFluidModel->SetTDState_T(Temperature_FreeStream); break; case INC_IDEAL_GAS: config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0)); Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant(); - FluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic); - FluidModel->SetTDState_T(Temperature_FreeStream); - Pressure_Thermodynamic = FluidModel->GetPressure(); + auxFluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic); + auxFluidModel->SetTDState_T(Temperature_FreeStream); + Pressure_Thermodynamic = auxFluidModel->GetPressure(); config->SetPressure_Thermodynamic(Pressure_Thermodynamic); break; @@ -277,15 +283,15 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0)); Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant(); - FluidModel = new CIncIdealGasPolynomial(config->GetGas_Constant(), Pressure_Thermodynamic); + auxFluidModel = new CIncIdealGasPolynomial(config->GetGas_Constant(), Pressure_Thermodynamic); if (viscous) { /*--- Variable Cp model via polynomial. ---*/ for (iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) config->SetCp_PolyCoeffND(config->GetCp_PolyCoeff(iVar), iVar); - FluidModel->SetCpModel(config); + auxFluidModel->SetCpModel(config); } - FluidModel->SetTDState_T(Temperature_FreeStream); - Pressure_Thermodynamic = FluidModel->GetPressure(); + auxFluidModel->SetTDState_T(Temperature_FreeStream); + Pressure_Thermodynamic = auxFluidModel->GetPressure(); config->SetPressure_Thermodynamic(Pressure_Thermodynamic); break; @@ -311,8 +317,8 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Use the fluid model to compute the dimensional viscosity/conductivity. ---*/ - FluidModel->SetLaminarViscosityModel(config); - Viscosity_FreeStream = FluidModel->GetLaminarViscosity(); + auxFluidModel->SetLaminarViscosityModel(config); + Viscosity_FreeStream = auxFluidModel->GetLaminarViscosity(); config->SetViscosity_FreeStream(Viscosity_FreeStream); Reynolds = Density_FreeStream*ModVel_FreeStream/Viscosity_FreeStream; config->SetReynolds(Reynolds); @@ -369,7 +375,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Get the freestream energy. Only useful if energy equation is active. ---*/ - Energy_FreeStream = FluidModel->GetStaticEnergy() + 0.5*ModVel_FreeStream*ModVel_FreeStream; + Energy_FreeStream = auxFluidModel->GetStaticEnergy() + 0.5*ModVel_FreeStream*ModVel_FreeStream; config->SetEnergy_FreeStream(Energy_FreeStream); if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream); @@ -421,68 +427,79 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Delete the original (dimensional) FluidModel object. No fluid is used for inscompressible cases. ---*/ - delete FluidModel; + delete auxFluidModel; - switch (config->GetKind_FluidModel()) { + /*--- Create one final fluid model object per OpenMP thread to be able to use them in parallel. + * GetFluidModel() should be used to automatically access the "right" object of each thread. ---*/ - case CONSTANT_DENSITY: - FluidModel = new CConstantDensity(Density_FreeStreamND, Specific_Heat_CpND); - break; + assert(FluidModel.empty() && "Potential memory leak!"); + FluidModel.resize(omp_get_max_threads()); - case INC_IDEAL_GAS: - FluidModel = new CIncIdealGas(Specific_Heat_CpND, Gas_ConstantND, Pressure_ThermodynamicND); - break; + for (auto& fluidModel : FluidModel) { - case INC_IDEAL_GAS_POLY: - FluidModel = new CIncIdealGasPolynomial(Gas_ConstantND, Pressure_ThermodynamicND); - if (viscous) { - /*--- Variable Cp model via polynomial. ---*/ - config->SetCp_PolyCoeffND(config->GetCp_PolyCoeff(0)/Gas_Constant_Ref, 0); - for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) - config->SetCp_PolyCoeffND(config->GetCp_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Gas_Constant_Ref, iVar); - FluidModel->SetCpModel(config); - } - break; - FluidModel->SetTDState_T(Temperature_FreeStreamND); - } + switch (config->GetKind_FluidModel()) { - Energy_FreeStreamND = FluidModel->GetStaticEnergy() + 0.5*ModVel_FreeStreamND*ModVel_FreeStreamND; + case CONSTANT_DENSITY: + fluidModel = new CConstantDensity(Density_FreeStreamND, Specific_Heat_CpND); + break; - if (viscous) { + case INC_IDEAL_GAS: + fluidModel = new CIncIdealGas(Specific_Heat_CpND, Gas_ConstantND, Pressure_ThermodynamicND); + break; + + case INC_IDEAL_GAS_POLY: + fluidModel = new CIncIdealGasPolynomial(Gas_ConstantND, Pressure_ThermodynamicND); + if (viscous) { + /*--- Variable Cp model via polynomial. ---*/ + config->SetCp_PolyCoeffND(config->GetCp_PolyCoeff(0)/Gas_Constant_Ref, 0); + for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) + config->SetCp_PolyCoeffND(config->GetCp_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Gas_Constant_Ref, iVar); + fluidModel->SetCpModel(config); + } + break; + /// TODO: Why is this outside? + fluidModel->SetTDState_T(Temperature_FreeStreamND); + } + + if (viscous) { + + /*--- Constant viscosity model ---*/ - /*--- Constant viscosity model ---*/ + config->SetMu_ConstantND(config->GetMu_Constant()/Viscosity_Ref); - config->SetMu_ConstantND(config->GetMu_Constant()/Viscosity_Ref); + /*--- Sutherland's model ---*/ - /*--- Sutherland's model ---*/ + config->SetMu_RefND(config->GetMu_Ref()/Viscosity_Ref); + config->SetMu_SND(config->GetMu_S()/config->GetTemperature_Ref()); + config->SetMu_Temperature_RefND(config->GetMu_Temperature_Ref()/config->GetTemperature_Ref()); - config->SetMu_RefND(config->GetMu_Ref()/Viscosity_Ref); - config->SetMu_SND(config->GetMu_S()/config->GetTemperature_Ref()); - config->SetMu_Temperature_RefND(config->GetMu_Temperature_Ref()/config->GetTemperature_Ref()); + /*--- Viscosity model via polynomial. ---*/ - /*--- Viscosity model via polynomial. ---*/ + config->SetMu_PolyCoeffND(config->GetMu_PolyCoeff(0)/Viscosity_Ref, 0); + for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) + config->SetMu_PolyCoeffND(config->GetMu_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Viscosity_Ref, iVar); - config->SetMu_PolyCoeffND(config->GetMu_PolyCoeff(0)/Viscosity_Ref, 0); - for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) - config->SetMu_PolyCoeffND(config->GetMu_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Viscosity_Ref, iVar); + /*--- Constant thermal conductivity model ---*/ - /*--- Constant thermal conductivity model ---*/ + config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); - config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); + /*--- Conductivity model via polynomial. ---*/ - /*--- Conductivity model via polynomial. ---*/ + config->SetKt_PolyCoeffND(config->GetKt_PolyCoeff(0)/Conductivity_Ref, 0); + for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) + config->SetKt_PolyCoeffND(config->GetKt_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Conductivity_Ref, iVar); - config->SetKt_PolyCoeffND(config->GetKt_PolyCoeff(0)/Conductivity_Ref, 0); - for (iVar = 1; iVar < config->GetnPolyCoeffs(); iVar++) - config->SetKt_PolyCoeffND(config->GetKt_PolyCoeff(iVar)*pow(Temperature_Ref,iVar)/Conductivity_Ref, iVar); + /*--- Set up the transport property models. ---*/ - /*--- Set up the transport property models. ---*/ + fluidModel->SetLaminarViscosityModel(config); + fluidModel->SetThermalConductivityModel(config); - FluidModel->SetLaminarViscosityModel(config); - FluidModel->SetThermalConductivityModel(config); + } } + Energy_FreeStreamND = GetFluidModel()->GetStaticEnergy() + 0.5*ModVel_FreeStreamND*ModVel_FreeStreamND; + if (tkeNeeded) { Energy_FreeStreamND += Tke_FreeStreamND; }; config->SetEnergy_FreeStreamND(Energy_FreeStreamND); Energy_Ref = Energy_FreeStream/Energy_FreeStreamND; config->SetEnergy_Ref(Energy_Ref); @@ -931,11 +948,17 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ /*--- Update the beta value based on the maximum velocity. ---*/ + SU2_OMP_MASTER SetBeta_Parameter(geometry, solver_container, config, iMesh); + SU2_OMP_BARRIER /*--- Compute properties needed for mass flow BCs. ---*/ - if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); + if (outlet) { + SU2_OMP_MASTER + GetOutlet_Properties(geometry, config, iMesh, Output); + SU2_OMP_BARRIER + } /*--- Initialize the Jacobian matrix and residual, not needed for the reducer strategy * as we set blocks (including diagonal ones) and completely overwrite. ---*/ @@ -990,7 +1013,7 @@ unsigned long CIncEulerSolver::SetPrimitive_Variables(CSolver **solver_container /*--- Incompressible flow, primitive variables ---*/ - auto physical = nodes->SetPrimVar(iPoint,FluidModel); + auto physical = nodes->SetPrimVar(iPoint,GetFluidModel()); /* Check for non-realizable states for reporting. */ @@ -1864,6 +1887,7 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain /*--- Loop over all the vertices on this boundary marker ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -1998,6 +2022,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Loop over all the vertices on this boundary marker ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -2232,6 +2257,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Loop over all the vertices on this boundary marker ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -2897,10 +2923,13 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); - int counter = 0; + unsigned long counter = 0; long iPoint_Local = 0; unsigned long iPoint_Global = 0; unsigned long iPoint_Global_Local = 0; + /*--- To make this routine safe to call in parallel most of it can only be executed by one thread. ---*/ + SU2_OMP_MASTER { + /*--- Skip coordinates ---*/ unsigned short skipVars = geometry[MESH_0]->GetnDim(); @@ -3001,10 +3030,12 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf /*--- Detect a wrong solution file ---*/ - if (iPoint_Global_Local < nPointDomain) { + if (counter != nPointDomain) { SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); } + } // end SU2_OMP_MASTER + SU2_OMP_BARRIER /*--- Update the geometry for flows on deforming meshes ---*/ @@ -3059,6 +3090,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf /*--- Interpolate the solution down to the coarse multigrid levels ---*/ for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); for (iVar = 0; iVar < nVar; iVar++) Solution[iVar] = 0.0; @@ -3086,11 +3118,17 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf Restart_OldGeometry(geometry[MESH_0], config); } + /*--- Go back to single threaded execution. ---*/ + SU2_OMP_MASTER + { /*--- Delete the class memory that is used to load the restart. ---*/ delete [] Restart_Vars; Restart_Vars = nullptr; delete [] Restart_Data; Restart_Data = nullptr; + } // end SU2_OMP_MASTER + SU2_OMP_BARRIER + } void CIncEulerSolver::SetFreeStream_Solution(const CConfig *config){ @@ -3098,6 +3136,7 @@ void CIncEulerSolver::SetFreeStream_Solution(const CConfig *config){ unsigned long iPoint; unsigned short iDim; + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPoint; iPoint++){ nodes->SetSolution(iPoint,0, Pressure_Inf); for (iDim = 0; iDim < nDim; iDim++){ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 5dd6b564bbaa..5233504c6283 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -123,7 +123,7 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c /*--- Incompressible flow, primitive variables --- */ - bool physical = static_cast(nodes)->SetPrimVar(iPoint,eddy_visc, turb_ke, FluidModel); + bool physical = static_cast(nodes)->SetPrimVar(iPoint,eddy_visc, turb_ke, GetFluidModel()); /* Check for non-realizable states for reporting. */ @@ -220,6 +220,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Loop over all of the vertices on this boundary marker ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -335,6 +336,7 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Loop over boundary points ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); From f6bc631c6099b7ced73234a3e7a0caa9ab401f80 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 17:01:06 +0000 Subject: [PATCH 158/326] Vorticity/StrainMag and UndivLaplacian --- SU2_CFD/include/solvers/CAdjEulerSolver.hpp | 7 -- .../include/solvers/CFVMFlowSolverBase.hpp | 85 ++++++++++++---- SU2_CFD/include/solvers/CHeatSolver.hpp | 7 -- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 7 -- SU2_CFD/include/solvers/CSolver.hpp | 7 ++ SU2_CFD/include/variables/CEulerVariable.hpp | 17 ++++ .../include/variables/CIncEulerVariable.hpp | 30 ++++-- SU2_CFD/include/variables/CIncNSVariable.hpp | 22 +---- SU2_CFD/include/variables/CNSVariable.hpp | 19 ---- SU2_CFD/include/variables/CVariable.hpp | 37 ------- SU2_CFD/src/solvers/CAdjEulerSolver.cpp | 96 ------------------- SU2_CFD/src/solvers/CHeatSolver.cpp | 53 ---------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 59 ------------ SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 48 +++++++++- SU2_CFD/src/variables/CIncEulerVariable.cpp | 5 - SU2_CFD/src/variables/CIncNSVariable.cpp | 57 ----------- SU2_CFD/src/variables/CNSVariable.cpp | 53 ---------- SU2_CFD/src/variables/CVariable.cpp | 2 - 20 files changed, 161 insertions(+), 454 deletions(-) diff --git a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp index b6a41031e7a8..71ec9e79e0e8 100644 --- a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp @@ -230,13 +230,6 @@ class CAdjEulerSolver : public CSolver { CConfig *config, unsigned short iMesh) final; - /*! - * \brief Compute the undivided laplacian for the adjoint solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - /*! * \brief Value of the characteristic variables at the boundaries. * \param[in] val_marker - Surface marker where the coefficient is computed. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 836f01659688..2b86aae343ed 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -949,8 +949,13 @@ class CFVMFlowSolverBase : public CSolver { /*! * \brief Evaluate the vorticity and strain rate magnitude. + * \tparam VelocityOffset: Index in the primitive variables where the velocity starts. */ - inline void ComputeVorticityAndStrainMag(const CConfig& config, unsigned short iMesh) { + template + void ComputeVorticityAndStrainMag(const CConfig& config, unsigned short iMesh) { + + const auto& Gradient_Primitive = nodes->GetGradient_Primitive(); + auto& StrainMag = nodes->GetStrainMag(); SU2_OMP_MASTER { StrainMag_Max = 0.0; @@ -958,27 +963,76 @@ class CFVMFlowSolverBase : public CSolver { } SU2_OMP_BARRIER - nodes->SetVorticity_StrainMag(); + su2double strainMax = 0.0, omegaMax = 0.0; - /*--- Min and Max are not really differentiable ---*/ - const bool wasActive = AD::BeginPassive(); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPoint; ++iPoint) { - su2double strainMax = 0.0, omegaMax = 0.0; + constexpr size_t u = VelocityOffset; + constexpr size_t v = VelocityOffset+1; + constexpr size_t w = VelocityOffset+2; - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - strainMax = max(strainMax, nodes->GetStrainMag(iPoint)); - omegaMax = max(omegaMax, GeometryToolbox::Norm(3, nodes->GetVorticity(iPoint))); - } - SU2_OMP_CRITICAL { - StrainMag_Max = max(StrainMag_Max, strainMax); - Omega_Max = max(Omega_Max, omegaMax); + /*--- Vorticity ---*/ + + su2double* Vorticity = nodes->GetVorticity(iPoint); + + Vorticity[0] = 0.0; Vorticity[1] = 0.0; + + Vorticity[2] = Gradient_Primitive(iPoint,v,0)-Gradient_Primitive(iPoint,u,1); + + if (nDim == 3) { + Vorticity[0] = Gradient_Primitive(iPoint,w,1)-Gradient_Primitive(iPoint,v,2); + Vorticity[1] = -(Gradient_Primitive(iPoint,w,0)-Gradient_Primitive(iPoint,u,2)); + } + + /*--- Strain Magnitude ---*/ + + AD::StartPreacc(); + AD::SetPreaccIn(&Gradient_Primitive[iPoint][VelocityOffset], nDim, nDim); + + su2double Div = 0.0; + for (unsigned long iDim = 0; iDim < nDim; iDim++) + Div += Gradient_Primitive(iPoint, iDim+VelocityOffset, iDim); + Div /= 3.0; + + StrainMag(iPoint) = 0.0; + + /*--- Add diagonal part ---*/ + + for (unsigned long iDim = 0; iDim < nDim; iDim++) { + StrainMag(iPoint) += pow(Gradient_Primitive(iPoint, iDim+VelocityOffset, iDim) - Div, 2); + } + if (nDim == 2) { + StrainMag(iPoint) += pow(Div, 2); + } + + /*--- Add off diagonals ---*/ + + StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,u,1) + Gradient_Primitive(iPoint,v,0)), 2); + + if (nDim == 3) { + StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,u,2) + Gradient_Primitive(iPoint,w,0)), 2); + StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,v,2) + Gradient_Primitive(iPoint,w,1)), 2); + } + + StrainMag(iPoint) = sqrt(2.0*StrainMag(iPoint)); + AD::SetPreaccOut(StrainMag(iPoint)); + + /*--- Max is not differentiable, we so not register for preacc. ---*/ + strainMax = max(strainMax, StrainMag(iPoint)); + omegaMax = max(omegaMax, GeometryToolbox::Norm(3, Vorticity)); + + AD::EndPreacc(); } if ((iMesh == MESH_0) && (config.GetComm_Level() == COMM_FULL)) { + SU2_OMP_CRITICAL { + StrainMag_Max = max(StrainMag_Max, strainMax); + Omega_Max = max(Omega_Max, omegaMax); + } + SU2_OMP_BARRIER - SU2_OMP_MASTER - { + SU2_OMP_MASTER { su2double MyOmega_Max = Omega_Max; su2double MyStrainMag_Max = StrainMag_Max; @@ -988,7 +1042,6 @@ class CFVMFlowSolverBase : public CSolver { SU2_OMP_BARRIER } - AD::EndPassive(wasActive); } /*! diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index 004ebdf55f24..d09d1c3eaefa 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -113,13 +113,6 @@ class CHeatSolver final : public CSolver { int val_iter, bool val_update_geo) override; - /*! - * \brief Compute the undivided laplacian for the solution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetUndivided_Laplacian(CGeometry *geometry, CConfig *config); - /*! * \brief Compute the spatial integration using a centered scheme. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index cb6090e98981..b1ad55a25642 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -70,13 +70,6 @@ class CIncEulerSolver : public CFVMFlowSolverBaseSetUnd_LaplZero(); - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - for (iVar = 0; iVar < nVar; iVar++) - Diff[iVar] = nodes->GetSolution(iPoint,iVar) - nodes->GetSolution(jPoint,iVar); - -#ifdef STRUCTURED_GRID - - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint, Diff); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint, Diff); - -#else - - bool boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); - bool boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); - - /*--- Both points inside the domain, or both in the boundary ---*/ - if ((!boundary_i && !boundary_j) || (boundary_i && boundary_j)) { - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint, Diff); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint, Diff); - } - - /*--- iPoint inside the domain, jPoint on the boundary ---*/ - if (!boundary_i && boundary_j) - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint, Diff); - - /*--- jPoint inside the domain, iPoint on the boundary ---*/ - if (boundary_i && !boundary_j) - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint, Diff); - -#endif - - } - -#ifdef STRUCTURED_GRID - - unsigned long Point_Normal = 0, iVertex; - unsigned short iMarker; - su2double *Psi_mirror; - - Psi_mirror = new su2double[nVar]; - - /*--- Loop over all boundaries and include an extra contribution - from a halo node. Find the nearest normal, interior point - for a boundary node and make a linear approximation. ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++) { - - if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE && - config->GetMarker_All_KindBC(iMarker) != INTERFACE_BOUNDARY && - config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY) { - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - - Point_Normal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); - - /*--- Interpolate & compute difference in the conserved variables ---*/ - - for (iVar = 0; iVar < nVar; iVar++) { - Psi_mirror[iVar] = 2.0*nodes->GetSolution(iPoint, iVar) - nodes->GetSolution(Point_Normal, iVar); - Diff[iVar] = nodes->GetSolution(iPoint,iVar) - Psi_mirror[iVar]; - } - - /*--- Subtract contribution at the boundary node only ---*/ - - nodes->SubtractUnd_Lapl(iPoint,Diff); - } - } - } - } - - delete [] Psi_mirror; - -#endif - - delete [] Diff; - - /*--- MPI parallelization ---*/ - - InitiateComms(geometry, config, UNDIVIDED_LAPLACIAN); - CompleteComms(geometry, config, UNDIVIDED_LAPLACIAN); - -} - void CAdjEulerSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config) { unsigned long iPoint; diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 21618f92304c..7ee4b750fa1b 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -438,59 +438,6 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * } - -void CHeatSolver::SetUndivided_Laplacian(CGeometry *geometry, CConfig *config) { - - unsigned long iPoint, jPoint, iEdge; - su2double *Diff; - unsigned short iVar; - bool boundary_i, boundary_j; - - Diff = new su2double[nVar]; - - nodes->SetUnd_LaplZero(); - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - /*--- Solution differences ---*/ - - for (iVar = 0; iVar < nVar; iVar++) - Diff[iVar] = nodes->GetSolution(iPoint,iVar) - nodes->GetSolution(jPoint,iVar); - - boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); - boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); - - /*--- Both points inside the domain, or both in the boundary ---*/ - - if ((!boundary_i && !boundary_j) || (boundary_i && boundary_j)) { - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint,Diff); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint,Diff); - } - - /*--- iPoint inside the domain, jPoint on the boundary ---*/ - - if (!boundary_i && boundary_j) - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint,Diff); - - /*--- jPoint inside the domain, iPoint on the boundary ---*/ - - if (boundary_i && !boundary_j) - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint,Diff); - - } - - /*--- MPI parallelization ---*/ - - InitiateComms(geometry, config, UNDIVIDED_LAPLACIAN); - CompleteComms(geometry, config, UNDIVIDED_LAPLACIAN); - - delete [] Diff; - -} - void CHeatSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index e720e63ce730..3f3e24c4f08d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1592,65 +1592,6 @@ void CIncEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, const CConfig *conf } -void CIncEulerSolver::SetUndivided_Laplacian(CGeometry *geometry, const CConfig *config) { - - unsigned long iPoint, jPoint, iEdge; - su2double *Diff; - unsigned short iVar; - bool boundary_i, boundary_j; - - Diff = new su2double[nVar]; - - nodes->SetUnd_LaplZero(); - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - - /*--- Solution differences ---*/ - - for (iVar = 0; iVar < nVar; iVar++) - Diff[iVar] = nodes->GetSolution(iPoint,iVar) - nodes->GetSolution(jPoint,iVar); - - boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); - boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); - - /*--- Both points inside the domain, or both in the boundary ---*/ - - if ((!boundary_i && !boundary_j) || (boundary_i && boundary_j)) { - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint,Diff); - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint,Diff); - } - - /*--- iPoint inside the domain, jPoint on the boundary ---*/ - - if (!boundary_i && boundary_j) - if (geometry->nodes->GetDomain(iPoint)) nodes->SubtractUnd_Lapl(iPoint,Diff); - - /*--- jPoint inside the domain, iPoint on the boundary ---*/ - - if (boundary_i && !boundary_j) - if (geometry->nodes->GetDomain(jPoint)) nodes->AddUnd_Lapl(jPoint,Diff); - - } - - /*--- Correct the Laplacian values across any periodic boundaries. ---*/ - - for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { - InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_LAPLACIAN); - CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_LAPLACIAN); - } - - /*--- MPI parallelization ---*/ - - InitiateComms(geometry, config, UNDIVIDED_LAPLACIAN); - CompleteComms(geometry, config, UNDIVIDED_LAPLACIAN); - - delete [] Diff; - -} - void CIncEulerSolver::SetCentered_Dissipation_Sensor(CGeometry *geometry, const CConfig *config) { /*--- Define an object for the sensor variable, density. ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 5233504c6283..305f45fdccf7 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -95,7 +95,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container SetPrimitive_Limiter(geometry, config); } - ComputeVorticityAndStrainMag(*config, iMesh); + ComputeVorticityAndStrainMag<1>(*config, iMesh); } diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 8b36400de1ff..cebd1caf8603 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -148,7 +148,7 @@ void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, C SetPrimitive_Limiter(geometry, config); } - ComputeVorticityAndStrainMag(*config, iMesh); + ComputeVorticityAndStrainMag<1>(*config, iMesh); /*--- Compute the TauWall from the wall functions ---*/ diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index bb318fd4a0fc..d28508f23504 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -1398,9 +1398,7 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, with a subtraction before communicating, so now just add. ---*/ for (iVar = 0; iVar < nVar; iVar++) - Diff[iVar] = bufDRecv[buf_offset+iVar]; - - base_nodes->AddUnd_Lapl(iPoint,Diff); + base_nodes->AddUnd_Lapl(iPoint, iVar, bufDRecv[buf_offset+iVar]); break; @@ -2552,6 +2550,50 @@ void CSolver::SetSolution_Gradient_LS(CGeometry *geometry, const CConfig *config weighted, solution, 0, nVar, gradient, rmatrix); } +void CSolver::SetUndivided_Laplacian(CGeometry *geometry, const CConfig *config) { + + /*--- Loop domain points. ---*/ + + SU2_OMP_FOR_DYN(256) + for (unsigned long iPoint = 0; iPoint < nPointDomain; ++iPoint) { + + const bool boundary_i = geometry->nodes->GetPhysicalBoundary(iPoint); + + /*--- Initialize. ---*/ + for (unsigned short iVar = 0; iVar < nVar; iVar++) + base_nodes->SetUnd_Lapl(iPoint, iVar, 0.0); + + /*--- Loop over the neighbors of point i. ---*/ + for (auto jPoint : geometry->nodes->GetPoints(iPoint)) { + + bool boundary_j = geometry->nodes->GetPhysicalBoundary(jPoint); + + /*--- If iPoint is boundary it only takes contributions from other boundary points. ---*/ + if (boundary_i && !boundary_j) continue; + + /*--- Add solution differences, with correction for compressible flows which use the enthalpy. ---*/ + + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + su2double delta = base_nodes->GetSolution(jPoint,iVar)-base_nodes->GetSolution(iPoint,iVar); + base_nodes->AddUnd_Lapl(iPoint, iVar, delta); + } + } + } + + /*--- Correct the Laplacian across any periodic boundaries. ---*/ + + for (unsigned short iPeriodic = 1; iPeriodic <= config->GetnMarker_Periodic()/2; iPeriodic++) { + InitiatePeriodicComms(geometry, config, iPeriodic, PERIODIC_LAPLACIAN); + CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_LAPLACIAN); + } + + /*--- MPI parallelization ---*/ + + InitiateComms(geometry, config, UNDIVIDED_LAPLACIAN); + CompleteComms(geometry, config, UNDIVIDED_LAPLACIAN); + +} + void CSolver::Add_External_To_Solution() { for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { base_nodes->AddSolution(iPoint, base_nodes->Get_External(iPoint)); diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 35873c08a7a3..657081133bcf 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -106,7 +106,6 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci if (config->GetMultizone_Problem()) Set_BGSSolution_k(); - Density_Old.resize(nPoint) = su2double(0.0); Velocity2.resize(nPoint) = su2double(0.0); Max_Lambda_Inv.resize(nPoint) = su2double(0.0); Delta_Time.resize(nPoint) = su2double(0.0); @@ -128,10 +127,6 @@ bool CIncEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel unsigned long iVar; bool check_dens = false, check_temp = false, physical = true; - /*--- Store the density from the previous iteration. ---*/ - - Density_Old(iPoint) = GetDensity(iPoint); - /*--- Set the value of the pressure ---*/ SetPressure(iPoint); diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index 0eb93a1946fc..008dc5457090 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -44,68 +44,11 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su } } -bool CIncNSVariable::SetVorticity_StrainMag() { - - for (unsigned long iPoint = 0; iPoint < nPoint; ++iPoint) { - - /*--- Vorticity ---*/ - - Vorticity(iPoint,0) = 0.0; Vorticity(iPoint,1) = 0.0; - - Vorticity(iPoint,2) = Gradient_Primitive(iPoint,2,0)-Gradient_Primitive(iPoint,1,1); - - if (nDim == 3) { - Vorticity(iPoint,0) = Gradient_Primitive(iPoint,3,1)-Gradient_Primitive(iPoint,2,2); - Vorticity(iPoint,1) = -(Gradient_Primitive(iPoint,3,0)-Gradient_Primitive(iPoint,1,2)); - } - - /*--- Strain Magnitude ---*/ - - AD::StartPreacc(); - AD::SetPreaccIn(Gradient_Primitive[iPoint], nDim+1, nDim); - - su2double Div = 0.0; - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Div += Gradient_Primitive(iPoint,iDim+1,iDim); - - StrainMag(iPoint) = 0.0; - - /*--- Add diagonal part ---*/ - - for (unsigned long iDim = 0; iDim < nDim; iDim++) { - StrainMag(iPoint) += pow(Gradient_Primitive(iPoint,iDim+1,iDim) - 1.0/3.0*Div, 2.0); - } - if (nDim == 2) { - StrainMag(iPoint) += pow(1.0/3.0*Div, 2.0); - } - - /*--- Add off diagonals ---*/ - - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,1,1) + Gradient_Primitive(iPoint,2,0)), 2); - - if (nDim == 3) { - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,1,2) + Gradient_Primitive(iPoint,3,0)), 2); - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,2,2) + Gradient_Primitive(iPoint,3,1)), 2); - } - - StrainMag(iPoint) = sqrt(2.0*StrainMag(iPoint)); - - AD::SetPreaccOut(StrainMag(iPoint)); - AD::EndPreacc(); - } - return false; -} - - bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel) { unsigned short iVar; bool check_dens = false, check_temp = false, physical = true; - /*--- Store the density from the previous iteration. ---*/ - - Density_Old(iPoint) = GetDensity(iPoint); - /*--- Set the value of the pressure ---*/ SetPressure(iPoint); diff --git a/SU2_CFD/src/variables/CNSVariable.cpp b/SU2_CFD/src/variables/CNSVariable.cpp index 082e0d8d7417..d85f6502dada 100644 --- a/SU2_CFD/src/variables/CNSVariable.cpp +++ b/SU2_CFD/src/variables/CNSVariable.cpp @@ -44,59 +44,6 @@ CNSVariable::CNSVariable(su2double density, const su2double *velocity, su2double Max_Lambda_Visc.resize(nPoint) = su2double(0.0); } -bool CNSVariable::SetVorticity_StrainMag() { - - SU2_OMP_FOR_STAT(256) - for (unsigned long iPoint = 0; iPoint < nPoint; ++iPoint) { - - /*--- Vorticity ---*/ - - Vorticity(iPoint,0) = 0.0; Vorticity(iPoint,1) = 0.0; - - Vorticity(iPoint,2) = Gradient_Primitive(iPoint,2,0)-Gradient_Primitive(iPoint,1,1); - - if (nDim == 3) { - Vorticity(iPoint,0) = Gradient_Primitive(iPoint,3,1)-Gradient_Primitive(iPoint,2,2); - Vorticity(iPoint,1) = -(Gradient_Primitive(iPoint,3,0)-Gradient_Primitive(iPoint,1,2)); - } - - /*--- Strain Magnitude ---*/ - - AD::StartPreacc(); - AD::SetPreaccIn(Gradient_Primitive[iPoint], nDim+1, nDim); - - su2double Div = 0.0; - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Div += Gradient_Primitive(iPoint,iDim+1,iDim); - - StrainMag(iPoint) = 0.0; - - /*--- Add diagonal part ---*/ - - for (unsigned long iDim = 0; iDim < nDim; iDim++) { - StrainMag(iPoint) += pow(Gradient_Primitive(iPoint,iDim+1,iDim) - 1.0/3.0*Div, 2.0); - } - if (nDim == 2) { - StrainMag(iPoint) += pow(1.0/3.0*Div, 2.0); - } - - /*--- Add off diagonals ---*/ - - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,1,1) + Gradient_Primitive(iPoint,2,0)), 2); - - if (nDim == 3) { - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,1,2) + Gradient_Primitive(iPoint,3,0)), 2); - StrainMag(iPoint) += 2.0*pow(0.5*(Gradient_Primitive(iPoint,2,2) + Gradient_Primitive(iPoint,3,1)), 2); - } - - StrainMag(iPoint) = sqrt(2.0*StrainMag(iPoint)); - - AD::SetPreaccOut(StrainMag(iPoint)); - AD::EndPreacc(); - } - return false; -} - void CNSVariable::SetRoe_Dissipation_NTS(unsigned long iPoint, su2double val_delta, su2double val_const_DES){ diff --git a/SU2_CFD/src/variables/CVariable.cpp b/SU2_CFD/src/variables/CVariable.cpp index 57f4ea60d11e..d852d0e210e2 100644 --- a/SU2_CFD/src/variables/CVariable.cpp +++ b/SU2_CFD/src/variables/CVariable.cpp @@ -110,8 +110,6 @@ void CVariable::Restore_BGSSolution_k() { parallelCopy(Solution_BGS_k.size(), Solution_BGS_k.data(), Solution.data()); } -void CVariable::SetUnd_LaplZero() { parallelSet(Undivided_Laplacian.size(), 0.0, Undivided_Laplacian.data()); } - void CVariable::SetExternalZero() { parallelSet(External.size(), 0.0, External.data()); } void CVariable::RegisterSolution(bool input, bool push_index) { From d858f703aaa97da6dde379eb78577b60733f9cce Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 18:05:53 +0000 Subject: [PATCH 159/326] fluxes and sources --- SU2_CFD/include/solvers/CEulerSolver.hpp | 16 +- .../include/solvers/CFVMFlowSolverBase.hpp | 16 ++ .../include/solvers/CFVMFlowSolverBase.inl | 59 +++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 6 + SU2_CFD/include/solvers/CIncNSSolver.hpp | 45 +++-- SU2_CFD/include/solvers/CNSSolver.hpp | 40 +++-- SU2_CFD/include/solvers/CSolver.hpp | 23 --- SU2_CFD/include/solvers/CTurbSASolver.hpp | 31 ++-- SU2_CFD/src/solvers/CEulerSolver.cpp | 25 ++- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 156 +++++++++++++----- SU2_CFD/src/solvers/CIncNSSolver.cpp | 58 +------ SU2_CFD/src/solvers/CNSSolver.cpp | 61 +------ SU2_CFD/src/solvers/CTurbSASolver.cpp | 2 +- 13 files changed, 268 insertions(+), 270 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 5eb2935751d4..329024d59b1f 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -350,20 +350,6 @@ class CEulerSolver : public CFVMFlowSolverBase { CConfig *config, unsigned short iMesh) final; - /*! - * \brief Compute the viscous contribution for a particular edge. - * \note The convective residual methods include a call to this for each edge, - * this allows convective and viscous loops to be "fused". - * \param[in] iEdge - Edge for which the flux and Jacobians are to be computed. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - */ - inline virtual void Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, - CNumerics *numerics, CConfig *config) { } - using CSolver::Viscous_Residual; /*--- Silence warning ---*/ - /*! * \brief Recompute the extrapolated quantities, after MUSCL reconstruction, * in a more thermodynamically consistent way. @@ -1627,7 +1613,7 @@ class CEulerSolver : public CFVMFlowSolverBase { void PrintVerificationError(const CConfig* config) const final; /*! - * \brief The Euler and NS solvers support MPI+OpenMP (except the BC bits). + * \brief The Euler and NS solvers support MPI+OpenMP. */ inline bool GetHasHybridParallel() const final { return true; } diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 2b86aae343ed..e55ea0509ca8 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -249,6 +249,22 @@ class CFVMFlowSolverBase : public CSolver { */ inline virtual void InstantiateEdgeNumerics(const CSolver* const* solvers, const CConfig* config) {} + /*! + * \brief Compute the viscous contribution for a particular edge. + * \note The convective residual methods include a call to this for each edge, + * this allows convective and viscous loops to be "fused". + * \param[in] iEdge - Edge for which the flux and Jacobians are to be computed. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + */ + inline virtual void Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, + CNumerics *numerics, CConfig *config) { } + void Viscous_Residual_impl(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, + CNumerics *numerics, CConfig *config); + using CSolver::Viscous_Residual; /*--- Silence warning ---*/ + /*! * \brief Generic implementation to compute the time step based on CFL and conv/visc eigenvalues. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index d2ccebcb9676..dfa2522e16ab 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -541,6 +541,65 @@ void CFVMFlowSolverBase::SetPrimitive_Limiter(CGeometry* geometry, const C nPrimVarGrad, primitives, gradient, primMin, primMax, limiter); } +template +void CFVMFlowSolverBase::Viscous_Residual_impl(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, + CNumerics *numerics, CConfig *config) { + + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || + (config->GetKind_Turb_Model() == SST_SUST); + + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); + + /*--- Points, coordinates and normal vector in edge ---*/ + + auto iPoint = geometry->edges->GetNode(iEdge,0); + auto jPoint = geometry->edges->GetNode(iEdge,1); + + numerics->SetCoord(geometry->nodes->GetCoord(iPoint), + geometry->nodes->GetCoord(jPoint)); + + numerics->SetNormal(geometry->edges->GetNormal(iEdge)); + + /*--- Primitive and secondary variables. ---*/ + + numerics->SetPrimitive(nodes->GetPrimitive(iPoint), + nodes->GetPrimitive(jPoint)); + + numerics->SetSecondary(nodes->GetSecondary(iPoint), + nodes->GetSecondary(jPoint)); + + /*--- Gradients. ---*/ + + numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), + nodes->GetGradient_Primitive(jPoint)); + + /*--- Turbulent kinetic energy. ---*/ + + if (tkeNeeded) + numerics->SetTurbKineticEnergy(turbNodes->GetSolution(iPoint,0), + turbNodes->GetSolution(jPoint,0)); + + /*--- Compute and update residual ---*/ + + auto residual = numerics->ComputeResidual(config); + + if (ReducerStrategy) { + EdgeFluxes.SubtractBlock(iEdge, residual); + if (implicit) + Jacobian.UpdateBlocksSub(iEdge, residual.jacobian_i, residual.jacobian_j); + } + else { + LinSysRes.SubtractBlock(iPoint, residual); + LinSysRes.AddBlock(jPoint, residual); + + if (implicit) + Jacobian.UpdateBlocksSub(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); + } + +} + template void CFVMFlowSolverBase::ComputeVerificationError(CGeometry* geometry, CConfig* config) { /*--- The errors only need to be computed on the finest grid. ---*/ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index b1ad55a25642..801c6fe5d86c 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -375,6 +375,7 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetVelocity_FreeStream()[iDim], 2); - numerics->SetVelocity2_Inf(sqvel); + numerics->SetVelocity2_Inf(GeometryToolbox::SquaredNorm(nDim, config->GetVelocity_FreeStream())); } /*--- Grid movement ---*/ @@ -2623,8 +2619,7 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain SU2_OMP_BARRIER /*--- Add counter results for all ranks. ---*/ - SU2_OMP_MASTER - { + SU2_OMP_MASTER { counter_local = ErrorCounter; SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); config->SetNonphysical_Reconstr(ErrorCounter); @@ -5009,10 +5004,10 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, unsigned long iVertex, iPoint, Point_Normal; su2double *GridVel; - su2double Area, UnitNormal[3] = {0.0,0.0,0.0}; - su2double Density, Pressure, Energy, Velocity[3] = {0.0,0.0,0.0}; - su2double Density_Bound, Pressure_Bound, Vel_Bound[3] = {0.0,0.0,0.0}; - su2double Density_Infty, Pressure_Infty, Vel_Infty[3] = {0.0,0.0,0.0}; + su2double Area, UnitNormal[MAXNDIM] = {0.0}; + su2double Density, Pressure, Energy, Velocity[MAXNDIM] = {0.0}; + su2double Density_Bound, Pressure_Bound, Vel_Bound[MAXNDIM] = {0.0}; + su2double Density_Infty, Pressure_Infty, Vel_Infty[MAXNDIM] = {0.0}; su2double SoundSpeed, Entropy, Velocity2, Vn; su2double SoundSpeed_Bound, Entropy_Bound, Vel2_Bound, Vn_Bound; su2double SoundSpeed_Infty, Entropy_Infty, Vel2_Infty, Vn_Infty, Qn_Infty; diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 3f3e24c4f08d..e4895a2ce0c6 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -811,21 +811,24 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i cout << NonDimTableOut.str(); } - - } void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { - unsigned long iPoint, Point_Fine; - unsigned short iMesh, iChildren, iVar; - su2double Area_Children, Area_Parent, *Solution_Fine, *Solution; - const bool restart = (config->GetRestart() || config->GetRestart_Flow()); const bool rans = (config->GetKind_Turb_Model() != NONE); const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == DT_STEPPING_2ND)); + /*--- Start OpenMP parallel region. ---*/ + + SU2_OMP_PARALLEL { + + unsigned long iPoint, Point_Fine; + unsigned short iMesh, iChildren, iVar; + su2double Area_Children, Area_Parent; + const su2double *Solution_Fine; + /*--- Check if a verification solution is to be computed. ---*/ if ((VerificationSolution) && (TimeIter == 0) && !restart) { @@ -833,6 +836,7 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { /*--- Loop over all grid points. ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { /* Set the pointers to the coordinates and solution of this DOF. */ @@ -852,11 +856,11 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve if (restart && (TimeIter == 0)) { - Solution = new su2double[nVar]; for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - for (iVar = 0; iVar < nVar; iVar++) Solution[iVar] = 0.0; + su2double Solution[MAXNVAR] = {0.0}; for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); @@ -870,18 +874,16 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve solver_container[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); solver_container[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); } - delete [] Solution; /*--- Interpolate the turblence variable also, if needed ---*/ if (rans) { unsigned short nVar_Turb = solver_container[MESH_0][TURB_SOL]->GetnVar(); - Solution = new su2double[nVar_Turb]; for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - for (iVar = 0; iVar < nVar_Turb; iVar++) Solution[iVar] = 0.0; + su2double Solution[MAXNVAR] = {0.0}; for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); @@ -896,9 +898,7 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve solver_container[iMesh][TURB_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION_EDDY); solver_container[iMesh][TURB_SOL]->Postprocessing(geometry[iMesh], solver_container[iMesh], config, iMesh); } - delete [] Solution; } - } /*--- The value of the solution for the first iteration of the dual time ---*/ @@ -906,6 +906,9 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve if (dual_time && (TimeIter == 0 || (restart && TimeIter == config->GetRestart_Iter()))) { PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); } + + } // end SU2_OMP_PARALLEL + } void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, @@ -1080,14 +1083,21 @@ void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contain void CIncEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) { - CNumerics* numerics = numerics_container[CONV_TERM]; + CNumerics* numerics = numerics_container[CONV_TERM + omp_get_thread_num()*MAX_TERMS]; - unsigned long iEdge, iPoint, jPoint; + unsigned long iPoint, jPoint; bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool jst_scheme = ((config->GetKind_Centered_Flow() == JST) && (iMesh == MESH_0)); - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { + /*--- Loop over edge colors. ---*/ + for (auto color : EdgeColoring) + { + /*--- Chunk size is at least OMP_MIN_SIZE and a multiple of the color group size. ---*/ + SU2_OMP_FOR_DYN(nextMultiple(OMP_MIN_SIZE, color.groupSize)) + for(auto k = 0ul; k < color.size; ++k) { + + auto iEdge = color.indices[k]; /*--- Points in edge, set normal vectors, and number of neighbors ---*/ @@ -1120,16 +1130,33 @@ void CIncEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_co auto residual = numerics->ComputeResidual(config); - /*--- Update convective and artificial dissipation residuals ---*/ - - LinSysRes.AddBlock(iPoint, residual); - LinSysRes.SubtractBlock(jPoint, residual); + /*--- Update residual value ---*/ - /*--- Store implicit contributions from the residual calculation. ---*/ + if (ReducerStrategy) { + EdgeFluxes.SetBlock(iEdge, residual); + if (implicit) + Jacobian.SetBlocks(iEdge, residual.jacobian_i, residual.jacobian_j); + } + else { + LinSysRes.AddBlock(iPoint, residual); + LinSysRes.SubtractBlock(jPoint, residual); - if (implicit) { - Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); + /*--- Set implicit computation ---*/ + if (implicit) + Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); } + + /*--- Viscous contribution. ---*/ + + Viscous_Residual(iEdge, geometry, solver_container, + numerics_container[VISC_TERM + omp_get_thread_num()*MAX_TERMS], config); + } + } // end color loop + + if (ReducerStrategy) { + SumEdgeFluxes(geometry); + if (implicit) + Jacobian.SetDiagonalAsColumnSum(); } } @@ -1137,23 +1164,31 @@ void CIncEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_co void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { - CNumerics* numerics = numerics_container[CONV_TERM]; + CNumerics* numerics = numerics_container[CONV_TERM + omp_get_thread_num()*MAX_TERMS]; /*--- Static arrays of MUSCL-reconstructed primitives and secondaries (thread safety). ---*/ su2double Primitive_i[MAXNVAR] = {0.0}, Primitive_j[MAXNVAR] = {0.0}; - unsigned long iEdge, iPoint, jPoint, counter_local = 0, counter_global = 0; + unsigned long iPoint, jPoint, counter_local = 0; unsigned short iDim, iVar; - unsigned long InnerIter = config->GetInnerIter(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; + SU2_OMP_MASTER + ErrorCounter = 0; - /*--- Loop over all the edges ---*/ + const unsigned long InnerIter = config->GetInnerIter(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + const bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { + /*--- Loop over edge colors. ---*/ + for (auto color : EdgeColoring) + { + /*--- Chunk size is at least OMP_MIN_SIZE and a multiple of the color group size. ---*/ + SU2_OMP_FOR_DYN(nextMultiple(OMP_MIN_SIZE, color.groupSize)) + for(auto k = 0ul; k < color.size; ++k) { + + auto iEdge = color.indices[k]; /*--- Points in edge and normal vectors ---*/ @@ -1265,23 +1300,48 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Update residual value ---*/ - LinSysRes.AddBlock(iPoint, residual); - LinSysRes.SubtractBlock(jPoint, residual); - - /*--- Set implicit Jacobians ---*/ + if (ReducerStrategy) { + EdgeFluxes.SetBlock(iEdge, residual); + if (implicit) + Jacobian.SetBlocks(iEdge, residual.jacobian_i, residual.jacobian_j); + } + else { + LinSysRes.AddBlock(iPoint, residual); + LinSysRes.SubtractBlock(jPoint, residual); - if (implicit) { - Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); + /*--- Set implicit computation ---*/ + if (implicit) + Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); } + + /*--- Viscous contribution. ---*/ + + Viscous_Residual(iEdge, geometry, solver_container, + numerics_container[VISC_TERM + omp_get_thread_num()*MAX_TERMS], config); + } + } // end color loop + + if (ReducerStrategy) { + SumEdgeFluxes(geometry); + if (implicit) + Jacobian.SetDiagonalAsColumnSum(); } /*--- Warning message about non-physical reconstructions. ---*/ - if (config->GetComm_Level() == COMM_FULL) { - if (iMesh == MESH_0) { - SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - config->SetNonphysical_Reconstr(counter_global); + if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { + /*--- Add counter results for all threads. ---*/ + SU2_OMP_ATOMIC + ErrorCounter += counter_local; + SU2_OMP_BARRIER + + /*--- Add counter results for all ranks. ---*/ + SU2_OMP_MASTER { + counter_local = ErrorCounter; + SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + config->SetNonphysical_Reconstr(ErrorCounter); } + SU2_OMP_BARRIER } } @@ -1289,7 +1349,8 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { - CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM]; + /*--- Pick one numerics object per thread. ---*/ + CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM + omp_get_thread_num()*MAX_TERMS]; unsigned short iVar; unsigned long iPoint; @@ -1307,6 +1368,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Loop over all points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Load the conservative variables ---*/ @@ -1338,6 +1400,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Loop over all points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Load the conservative variables ---*/ @@ -1369,6 +1432,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Loop over all points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Load the primitive variables ---*/ @@ -1404,6 +1468,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (viscous) { + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPoint; iPoint++) { su2double yCoord = geometry->nodes->GetCoord(iPoint, 1); @@ -1433,6 +1498,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- loop over points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Conservative variables w/o reconstruction ---*/ @@ -1485,8 +1551,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (radiation) { - CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; + CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Store the radiation source term ---*/ @@ -1535,6 +1602,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Get control volume size. ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 305f45fdccf7..ac182499e675 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -99,6 +99,12 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container } +void CIncNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, + CNumerics *numerics, CConfig *config) { + + Viscous_Residual_impl(iEdge, geometry, solver_container, numerics, config); +} + unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { unsigned long iPoint, nonPhysicalPoints = 0; @@ -139,58 +145,6 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c } -void CIncNSSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, - CConfig *config, unsigned short iMesh, unsigned short iRKStep) { - - CNumerics* numerics = numerics_container[VISC_TERM]; - - unsigned long iPoint, jPoint, iEdge; - - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - /*--- Points, coordinates and normal vector in edge ---*/ - - iPoint = geometry->edges->GetNode(iEdge,0); - jPoint = geometry->edges->GetNode(iEdge,1); - numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(jPoint)); - numerics->SetNormal(geometry->edges->GetNormal(iEdge)); - - /*--- Primitive and secondary variables ---*/ - - numerics->SetPrimitive(nodes->GetPrimitive(iPoint), - nodes->GetPrimitive(jPoint)); - - /*--- Gradient and limiters ---*/ - - numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - nodes->GetGradient_Primitive(jPoint)); - - /*--- Turbulent kinetic energy ---*/ - - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) - numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), - solver_container[TURB_SOL]->GetNodes()->GetSolution(jPoint,0)); - - /*--- Compute and update residual ---*/ - - auto residual = numerics->ComputeResidual(config); - - LinSysRes.SubtractBlock(iPoint, residual); - LinSysRes.AddBlock(jPoint, residual); - - /*--- Implicit part ---*/ - - if (implicit) { - Jacobian.UpdateBlocksSub(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); - } - - } - -} - void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *config, unsigned short val_marker, unsigned short kind_boundary) { diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index cebd1caf8603..847ffe46707b 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -201,64 +201,7 @@ unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, cons void CNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { - const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || - (config->GetKind_Turb_Model() == SST_SUST); - - CVariable* turbNodes = nullptr; - if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); - - /*--- Points, coordinates and normal vector in edge ---*/ - - auto iPoint = geometry->edges->GetNode(iEdge,0); - auto jPoint = geometry->edges->GetNode(iEdge,1); - - numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(jPoint)); - - numerics->SetNormal(geometry->edges->GetNormal(iEdge)); - - /*--- Primitive and secondary variables. ---*/ - - numerics->SetPrimitive(nodes->GetPrimitive(iPoint), - nodes->GetPrimitive(jPoint)); - - numerics->SetSecondary(nodes->GetSecondary(iPoint), - nodes->GetSecondary(jPoint)); - - /*--- Gradients. ---*/ - - numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - nodes->GetGradient_Primitive(jPoint)); - - /*--- Turbulent kinetic energy. ---*/ - - if (tkeNeeded) - numerics->SetTurbKineticEnergy(turbNodes->GetSolution(iPoint,0), - turbNodes->GetSolution(jPoint,0)); - - /*--- Wall shear stress values (wall functions) ---*/ - - numerics->SetTauWall(nodes->GetTauWall(iPoint), - nodes->GetTauWall(iPoint)); - - /*--- Compute and update residual ---*/ - - auto residual = numerics->ComputeResidual(config); - - if (ReducerStrategy) { - EdgeFluxes.SubtractBlock(iEdge, residual); - if (implicit) - Jacobian.UpdateBlocksSub(iEdge, residual.jacobian_i, residual.jacobian_j); - } - else { - LinSysRes.SubtractBlock(iPoint, residual); - LinSysRes.AddBlock(jPoint, residual); - - if (implicit) - Jacobian.UpdateBlocksSub(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); - } - + Viscous_Residual_impl(iEdge, geometry, solver_container, numerics, config); } void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *config) { @@ -838,7 +781,7 @@ void CNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver BC_Isothermal_Wall_Generic(geometry, solver_container, conv_numerics, nullptr, config, val_marker, true); } -void CNSSolver::SetTauWall_WF(CGeometry *geometry, CSolver **solver_container, CConfig *config) { +void CNSSolver::SetTauWall_WF(CGeometry *geometry, CSolver **solver_container, const CConfig *config) { const su2double Gas_Constant = config->GetGas_ConstantND(); const su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index dcebd9edca34..79966c4ee24c 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -1577,7 +1577,7 @@ void CTurbSASolver::BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_ } void CTurbSASolver::SetNuTilde_WF(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + CNumerics *visc_numerics, const CConfig *config, unsigned short val_marker) { const su2double Gas_Constant = config->GetGas_ConstantND(); const su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; From bbfd9c055a1b046d4a4a4512c95091a9649fd452 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 18:20:12 +0000 Subject: [PATCH 160/326] BetaInc2 --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 45 +++++++++++-------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index e4895a2ce0c6..6ce2fa667d88 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -951,9 +951,7 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ /*--- Update the beta value based on the maximum velocity. ---*/ - SU2_OMP_MASTER SetBeta_Parameter(geometry, solver_container, config, iMesh); - SU2_OMP_BARRIER /*--- Compute properties needed for mass flow BCs. ---*/ @@ -1740,43 +1738,40 @@ void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **sol void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh) { - - su2double epsilon2 = config->GetBeta_Factor(); - su2double epsilon2_default = 4.1; - su2double maxVel2 = 0.0; - su2double Beta = 1.0; - - unsigned long iPoint; + static su2double MaxVel2; + const su2double epsilon2_default = 4.1; /*--- For now, only the finest mesh level stores the Beta for all levels. ---*/ if (iMesh == MESH_0) { + MaxVel2 = 0.0; + su2double maxVel2 = 0.0; - for (iPoint = 0; iPoint < nPoint; iPoint++) { - - /*--- Store the local maximum of the squared velocity in the field. ---*/ - - if (nodes->GetVelocity2(iPoint) > maxVel2) - maxVel2 = nodes->GetVelocity2(iPoint); - - } + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) + maxVel2 = max(maxVel2, nodes->GetVelocity2(iPoint)); - /*--- Communicate the max globally to give a conservative estimate. ---*/ + SU2_OMP_CRITICAL + MaxVel2 = max(MaxVel2, maxVel2); - su2double myMaxVel2 = maxVel2; maxVel2 = 0.0; - SU2_MPI::Allreduce(&myMaxVel2, &maxVel2, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_OMP_BARRIER - Beta = max(1e-10,maxVel2); - config->SetMax_Vel2(Beta); + SU2_OMP_MASTER { + maxVel2 = MaxVel2; + SU2_MPI::Allreduce(&maxVel2, &MaxVel2, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + config->SetMax_Vel2(max(1e-10, MaxVel2)); + } + SU2_OMP_BARRIER } /*--- Allow an override if user supplies a large epsilon^2. ---*/ - epsilon2 = max(epsilon2_default,epsilon2); + su2double BetaInc2 = max(epsilon2_default, config->GetBeta_Factor()) * config->GetMax_Vel2(); - for (iPoint = 0; iPoint < nPoint; iPoint++) - nodes->SetBetaInc2(iPoint,epsilon2*config->GetMax_Vel2()); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) + nodes->SetBetaInc2(iPoint, BetaInc2); } From fc4cfd100f107622ad3feda4ab89c2accc6aa136 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 24 Jan 2021 22:14:28 +0000 Subject: [PATCH 161/326] add incompressible hybrid regressions --- TestCases/hybrid_regression.py | 127 ++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 387e03ad7123..d4b80f5459ba 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -289,6 +289,88 @@ def main(): hb_rans_preconditioning.new_output = False test_list.append(hb_rans_preconditioning) + ############################# + ### Incompressible Euler ### + ############################# + + # NACA0012 Hydrofoil + inc_euler_naca0012 = TestCase('inc_euler_naca0012') + inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" + inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" + inc_euler_naca0012.test_iter = 20 + inc_euler_naca0012.test_vals = [-4.858287, -3.810487, 0.491850, 0.007002] + inc_euler_naca0012.new_output = True + test_list.append(inc_euler_naca0012) + + # C-D nozzle with pressure inlet and mass flow outlet + inc_nozzle = TestCase('inc_nozzle') + inc_nozzle.cfg_dir = "incomp_euler/nozzle" + inc_nozzle.cfg_file = "inv_nozzle.cfg" + inc_nozzle.test_iter = 20 + inc_nozzle.test_vals = [-5.971283, -4.911145, -0.000201, 0.121631] + inc_nozzle.new_output = True + test_list.append(inc_nozzle) + + ############################# + ### Incompressible N-S ### + ############################# + + # Laminar cylinder + inc_lam_cylinder = TestCase('inc_lam_cylinder') + inc_lam_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" + inc_lam_cylinder.test_iter = 10 + inc_lam_cylinder.test_vals = [-4.004277, -3.227956, 0.003852, 7.626578] + inc_lam_cylinder.new_output = True + test_list.append(inc_lam_cylinder) + + # Buoyancy-driven cavity + inc_buoyancy = TestCase('inc_buoyancy') + inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" + inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" + inc_buoyancy.test_iter = 20 + inc_buoyancy.test_vals = [-4.436657, 0.507847, 0.000000, 0.000000] + inc_buoyancy.new_output = True + test_list.append(inc_buoyancy) + + # Laminar heated cylinder with polynomial fluid model + inc_poly_cylinder = TestCase('inc_poly_cylinder') + inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" + inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" + inc_poly_cylinder.test_iter = 20 + inc_poly_cylinder.test_vals = [-8.108218, -2.158606, 0.019142, 1.902461] + inc_poly_cylinder.new_output = True + test_list.append(inc_poly_cylinder) + + # X-coarse laminar bend as a mixed element CGNS test + inc_lam_bend = TestCase('inc_lam_bend') + inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" + inc_lam_bend.cfg_file = "lam_bend.cfg" + inc_lam_bend.test_iter = 10 + inc_lam_bend.test_vals = [-3.450879, -3.083720, -0.020699, -0.168420] + test_list.append(inc_lam_bend) + + ############################ + ### Incompressible RANS ### + ############################ + + # NACA0012, SA + inc_turb_naca0012 = TestCase('inc_turb_naca0012') + inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012.cfg_file = "naca0012.cfg" + inc_turb_naca0012.test_iter = 20 + inc_turb_naca0012.test_vals = [-4.788495, -11.040511, 0.000023, 0.309503] + inc_turb_naca0012.new_output = True + test_list.append(inc_turb_naca0012) + + # NACA0012, SST_SUST + inc_turb_naca0012_sst_sust = TestCase('inc_turb_naca0012_sst_sust') + inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" + inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" + inc_turb_naca0012_sst_sust.test_iter = 20 + inc_turb_naca0012_sst_sust.test_vals = [-7.276273, 0.145895, 0.000021, 0.312004] + test_list.append(inc_turb_naca0012_sst_sust) + ###################################### ### Moving Wall ### ###################################### @@ -349,6 +431,24 @@ def main(): ddes_flatplate.unsteady = True test_list.append(ddes_flatplate) + # unsteady pitching NACA0015, SA + unst_inc_turb_naca0015_sa = TestCase('unst_inc_turb_naca0015_sa') + unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" + unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" + unst_inc_turb_naca0015_sa.test_iter = 1 + unst_inc_turb_naca0015_sa.test_vals = [-3.007635, -6.879789, 1.445300, 0.419281] + unst_inc_turb_naca0015_sa.unsteady = True + test_list.append(unst_inc_turb_naca0015_sa) + + # unsteady pitching NACA0012, Euler, Deforming + unst_deforming_naca0012 = TestCase('unst_deforming_naca0012') + unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" + unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" + unst_deforming_naca0012.test_iter = 5 + unst_deforming_naca0012.test_vals = [-3.665128, -3.793593, -3.716506, -3.148308] + unst_deforming_naca0012.unsteady = True + test_list.append(unst_deforming_naca0012) + ###################################### ### NICFD ### ###################################### @@ -491,6 +591,15 @@ def main(): bars_SST_2D.multizone = True test_list.append(bars_SST_2D) + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 3 columns + slinc_steady.multizone = True + test_list.append(slinc_steady) + ########################## ### FEA - FSI ### ########################## @@ -562,6 +671,22 @@ def main(): mms_fvm_ns.test_vals = [-2.851428, 2.192348, 0.000000, 0.000000] test_list.append(mms_fvm_ns) + # FVM, incompressible, euler + mms_fvm_inc_euler = TestCase('mms_fvm_inc_euler') + mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" + mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" + mms_fvm_inc_euler.test_iter = 20 + mms_fvm_inc_euler.test_vals = [-9.128345, -9.441741, 0.000000, 0.000000] + test_list.append(mms_fvm_inc_euler) + + # FVM, incompressible, laminar N-S + mms_fvm_inc_ns = TestCase('mms_fvm_inc_ns') + mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" + mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" + mms_fvm_inc_ns.test_iter = 20 + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] + test_list.append(mms_fvm_inc_ns) + ###################################### ### RUN TESTS ### ###################################### @@ -576,7 +701,7 @@ def main(): # Tests summary print('==================================================================') - print('Summary of the parallel tests') + print('Summary of the hybrid parallel tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): From 1892518d36a1279ad7f7da82da098842e57493d6 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 25 Jan 2021 14:51:09 +0100 Subject: [PATCH 162/326] Removed py_su2_nastran test case --- TestCases/py_su2_nastran/fluid.cfg | 194 ------- TestCases/py_su2_nastran/fsi.cfg | 37 -- TestCases/py_su2_nastran/modal.f06 | 830 ----------------------------- TestCases/py_su2_nastran/modal.pch | 510 ------------------ TestCases/py_su2_nastran/solid.cfg | 38 -- TestCases/tutorials.py | 12 - 6 files changed, 1621 deletions(-) delete mode 100644 TestCases/py_su2_nastran/fluid.cfg delete mode 100644 TestCases/py_su2_nastran/fsi.cfg delete mode 100644 TestCases/py_su2_nastran/modal.f06 delete mode 100644 TestCases/py_su2_nastran/modal.pch delete mode 100644 TestCases/py_su2_nastran/solid.cfg diff --git a/TestCases/py_su2_nastran/fluid.cfg b/TestCases/py_su2_nastran/fluid.cfg deleted file mode 100644 index 39e63931adae..000000000000 --- a/TestCases/py_su2_nastran/fluid.cfg +++ /dev/null @@ -1,194 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unsteady FSI of a NACA 0012 % -% Author: Nicola Fonzi, Vittorio Cavalieri % -% Institution: Politecnico di Milano % -% Date: Dec 10, 2020 % -% File Version 7.0.8 "Blackbird" (or newer) % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -% Physical governing equations (EULER, NAVIER_STOKES, NS_PLASMA) -% -SOLVER= RANS -% -% Specify turbulent model (NONE, SA, SA_NEG, SST) -KIND_TURB_MODEL= SST -% -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) -MATH_PROBLEM= DIRECT -% -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -TIME_DOMAIN = YES -% -% Numerical Method for Unsteady simulation(NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -TIME_STEP= 1e-3 -% -% Maximum Number of physical time steps. -TIME_ITER= 4000 -MAX_TIME = 4.0 -% -% Number of internal iterations (dual time method) -INNER_ITER= 50 -% -% Restart after the transient phase has passed -RESTART_SOL = NO -% -% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% -% -% Mach number (non-dimensional, based on the free-stream values) -MACH_NUMBER= 0.1 -% Angle of attack (degrees, only for compressible flows) -AOA= 0.0 -% -% De-Dimensionalization -REF_DIMENSIONALIZATION = DIMENSIONAL -% -FREESTREAM_TEMPERATURE= 273.0 -% -% Reynolds number (non-dimensional, based on the free-stream values) -REYNOLDS_NUMBER= 4e+6 -% -% Reynolds length (1 m by default) -REYNOLDS_LENGTH= 1.0 -% -% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% -% -% Reference origin for moment computation -REF_ORIGIN_MOMENT_X = 0.25 -REF_ORIGIN_MOMENT_Y = 0.00 -REF_ORIGIN_MOMENT_Z = 0.00 -% -% Reference length for pitching, rolling, and yawing non-dimensional moment -REF_LENGTH= 1.0 -% -% Reference area for force coefficients (0 implies automatic calculation) -REF_AREA= 1.0 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -% Navier-Stokes wall boundary marker(s) (NONE = no marker) -MARKER_HEATFLUX= ( airfoil, 0.0 ) -% -% Farfield boundary marker(s) (NONE = no marker) -MARKER_FAR= ( farfield ) -% -% Marker(s) of the surface to be plotted or designed -MARKER_PLOTTING= ( airfoil ) -% -% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated -MARKER_MONITORING= ( airfoil ) -%-------------- Coupling conditions -------------------------------------------% -% -DEFORM_MESH = YES -MARKER_DEFORM_MESH = ( airfoil ) -DEFORM_STIFFNESS_TYPE = WALL_DISTANCE -DEFORM_LINEAR_SOLVER_ITER= 200 -MARKER_FLUID_LOAD = ( airfoil ) -DEFORM_CONSOLE_OUTPUT= YES -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) -NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -% -% Courant-Friedrichs-Lewy condition of the finest grid -CFL_NUMBER= 20.0 -% -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% -% Linear solver for the implicit formulation (BCGSTAB, FGMRES) -LINEAR_SOLVER= FGMRES -% -% Min error of the linear solver for the implicit formulation -LINEAR_SOLVER_ERROR= 1E-8 -% -% Max number of iterations of the linear solver for the implicit formulation -LINEAR_SOLVER_ITER= 10 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) -CONV_NUM_METHOD_FLOW= JST -% -JST_SENSOR_COEFF= ( 0.5, 0.01 ) -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -% Convective numerical method (SCALAR_UPWIND) -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) -% -MUSCL_TURB= NO -% -% Time discretization (EULER_IMPLICIT) -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Convergence criteria (CAUCHY, RESIDUAL) -CONV_CRITERIA = RESIDUAL -% Field to apply Cauchy Criterion to -CONV_FIELD= RMS_DENSITY -% Min value of the residual (log10 of the residual) -CONV_RESIDUAL_MINVAL= -9.0 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -% -% Mesh input file -MESH_FILENAME= airfoil.su2 -% -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= SU2 -% -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= restart_flow.dat -% -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= restart_adj.dat -% -% Output file format (PARAVIEW, TECPLOT, STL) -TABULAR_FORMAT= CSV -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Output file restart flow -RESTART_FILENAME= restart_flow.dat -% -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat -% -% Output file flow (w/o extension) variables -VOLUME_FILENAME= flow -% -% Output file surface flow coefficient (w/o extension) -SURFACE_FILENAME= surface_flow -% -% Writing solution file frequency -OUTPUT_WRT_FREQ = 10 -% -HISTORY_WRT_FREQ_INNER=1 -SCREEN_WRT_FREQ_INNER =1 -% Writing convergence history frequency% Writing convergence history frequency (dual time, only written to screen) -HISTORY_WRT_FREQ_TIME=1 -SCREEN_WRT_FREQ_TIME =1 -% -SCREEN_OUTPUT=(TIME_ITER, INNER_ITER, DRAG, LIFT, RMS_DENSITY, REL_RMS_DENSITY, CAUCHY_TAVG_DRAG, CAUCHY_TAVG_LIFT) -HISTORY_OUTPUT=(ITER,REL_RMS_RES,RMS_RES, AERO_COEFF) -% diff --git a/TestCases/py_su2_nastran/fsi.cfg b/TestCases/py_su2_nastran/fsi.cfg deleted file mode 100644 index ff6b0723f41a..000000000000 --- a/TestCases/py_su2_nastran/fsi.cfg +++ /dev/null @@ -1,37 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unsteady FSI of a NACA 0012 % -% Author: Nicola Fonzi, Vittorio Cavalieri % -% Institution: Politecnico di Milano % -% Date: Dec 10, 2020 % -% File Version 7.0.8 "Blackbird" (or newer) % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%% -% INTEGER VALUES -%%%%%%%%%%%%%%%%%%%%%%% -NDIM = 2 -RESTART_ITER = 329 -NB_FSI_ITER = 20 -%%%%%%%%%%%%%%%%%%%%%%% -% FLOAT VALUES -%%%%%%%%%%%%%%%%%%%%%%% -RBF_RADIUS = 0.5 -AITKEN_PARAM = 0.4 -UNST_TIMESTEP = 0.001 -UNST_TIME = 4.0 -TIME_TRESHOLD = -1 -FSI_TOLERANCE = 0.000001 -%%%%%%%%%%%%%%%%%%%%%%% -% STRING VALUES -%%%%%%%%%%%%%%%%%%%%%%% -CFD_CONFIG_FILE_NAME = fluid.cfg -CSD_SOLVER = AEROELASTIC -CSD_CONFIG_FILE_NAME = solid.cfg -RESTART_SOL = NO -MATCHING_MESH = NO -MESH_INTERP_METHOD = RBF -DISP_PRED = SECOND_ORDER -AITKEN_RELAX = DYNAMIC -TIME_MARCHING = YES diff --git a/TestCases/py_su2_nastran/modal.f06 b/TestCases/py_su2_nastran/modal.f06 deleted file mode 100644 index 4d6bde725c3c..000000000000 --- a/TestCases/py_su2_nastran/modal.f06 +++ /dev/null @@ -1,830 +0,0 @@ -1 - - - - - Warning: This computer program is protected by copyright law and international treaties. - Unauthorized use, reproduction or distribution of this computer program, or any portion of it, may - result in severe civil and criminal penalties. - Copyright (C) 2018 MSC Software Corporation and its licensors. All rights reserved. - - - * * * * * * * * * * * * * * * * * * * * - * * * * * * * * * * * * * * * * * * * * - * * * * - * * MSC Software * * - * * CORP * * - * * * * - * * M S C N a s t r a n * * - * * * * - * * S T U D E N T E D I T I O N * * - * * * * - * * Version 2019.0.0-CL621679 * * - * * * * - * * * * - * * * * - * * DEC 18, 2018 * * - * * * * - * * Intel * * - * *MODEL Xeon/2257 (DESKTOP-1VDF0SS * * - * * Windows 10 Home 6.2 9200 * * - * * Compiled for 8664 (SINGLE Mode) * * - * * * * - * * * * * * * * * * * * * * * * * * * * - * * * * * * * * * * * * * * * * * * * * - - - - This Student Edition version is - valid until NOV 30, 2020. - - - This program is being distributed as part of the MSC Software Student Edition. Use of this program - or its results at a commercial installation, for commercial purposes, or for production work - I S S T R I C T L Y P R O H I B I T E D. - ==================================== FOR EDUCATIONAL USE ONLY ===================================== - - -1News file - (November 7, 2018) - - Welcome to MSC Nastran 2019.0 - - - MSC Nastran brings powerful new features and enhancements for engineering - solutions. - - Dynamics - - RFORCE and GRAV loads can now be optionally applied to a subset of - the model - - SOL 128 (Nonlinear Harmonics) Rotordynamics Enhancements - - Option to reset initial conditions - - Nonlinear load output - - Output for multiple harmonics - - Support for continuation procedure for frequency-independent analysis - - Pyramid Element - - The linear and quadratic pyramid element is available in linear - solutions: statics, modes, buckling, frequency and transient dynamics, - linear contact, acoustics, fatigue, rotordynamics, aeroelasticity and - design optimization - - The element is also available in SOL 400 for linear, nlstatics, - nltransient and linear perturbation solutions - - Assembly - - Module Instantiation: Allow copy of a primary Module to create - a secondary Module at a new position by translation, rotation and mirror - - Contact - - Support geometry adjustment of initial stress free in S2S Contact - - Support model check output in S2S Contact - - Allow user input minimum angle between segments on BCPARA - - SOL 400 Implicit Nonlinear Analysis - - Support Automatic SGLUE setup for permanent glued contact with large - deformation - - Reduce the debug output when using "NLOPRM NLDBG(N3DSUM)" - - Support MONPNT1, MONPNT3, MONSUM, MONSUM1, and MONSUMT in NLSTAT - and NLTRAN - - SOL 700 Explicit Nonlinear Analysis - - Support failure of ACS surface and DMP of ACS algorithm - - Support Occupant Safety, including Articulated Total Body (ATB), - Initial Metric Method (IMM) and Air bag fabric material model (MATFAB) - - Support Viscoelastic Material (MATVE), Localized Cohesive friction, and - User Defined Services (UDS) - - High Performance Computing (HPC) -1 - Improved performance and scalability of acoustic coupling reduction - with ACMS for large models - - Improved performance for ACMS Phase 1 for large solid models - - Improved performance (up to 10X) in the RANDOM module - - New DMP implementation for Panel Participation factor calculation - (PFCALC) with linear parallel scaling - - Performance enhancements for FASTFR through shared-memory - parallelization (SMP) of frequency processing - - - Results HDF5 Database - - Support outputs of Aerodynamic solution SOL144, 145 and 146 results - - Support Modal effective mass, Modules, Contact Check and - Global contact body data - - Support Bar/Beam end loads under the shear stress effect of 2D elements - - - Documentation - The complete documentation set is provided in a separate installer and - when installed is available at: MSC_DOC_DIR/doc/pdf_nastran directory. - Where MSC_DOC_DIR is the directory where documentation was installed - This help set has cross references between documents, links to how-to - videos, and example files. - - Individual MSC Nastran documents are available for download from the - Simcompanion Website at: - http://simcompanion.mscsoftware.com/ - - These documents were updated for the MSC Nastran 2019 Release - - 1. MSC Nastran 2019.0 Installation and Operations Guide - 2. MSC Nastran 2019.0 Quick Reference Guide - 3. MSC Nastran 2019.0 Release Guide - 4. MSC Nastran 2019.0 Linear Statics Analysis User's Guide - 5. MSC Nastran 2019.0 Dynamic Analysis User's Guide - 6. MSC Nastran 2019.0 Superelements User's Guide - 7. MSC Nastran 2019.0 Rotordynamics User's Guide - 8. MSC Nastran 2019.0 Demonstration Problems Manual - 9. MSC Nastran 2019.0 Nastran Embedded Fatigue User's Guide - 10. MSC Nastran 2019.0 Design Sensitivity and Optimization - 11. MSC Nastran 2019.0 Nonlinear User's Guide SOL 400 - 12. MSC Nastran 2019.0 DMAP Programmer's Guide - 13. MSC Nastran 2019.0 High Performance Computing User's Guide - 14. MSC Nastran 2019.0 DEMATD Guide - 15. MSC Nastran 2019.0 Explicit Nonlinear (SOL 700) User's Guide - - Please refer to MSC_DOC_DIR/doc/pdf_nastran/nastran_library.pdf - for the complete document set: - - -1 Additional information about the release can be found at the MSC Nastran - Product Support page: http://simcompanion.mscsoftware.com - - The support page provides links to these valuable information: - * A searchable Knowledge Base containing examples and answers to thousands - of frequently asked questions written by MSC Software subject-matter - experts. - * Peer-to-peer Discussion Forums enabling you to post questions for your - MSC Software products and receive answers from other users worldwide. - * A list of known issues with the product and any workarounds. - * Instructions on how to contact technical support - * A mechanism for sending us product feedback or enhancement requests. - * Hardware and software requirements. - * Examples and Tutorials - * and much more. - - For information on training, please visit our Training web site - - http://www.mscsoftware.com/Contents/Services/Training/ - -1 **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 1 - -0 N A S T R A N F I L E A N D S Y S T E M P A R A M E T E R E C H O -0 - - - NASTRAN BUFFSIZE=8193 $(C:/MSC.SOFTWARE/MSC_NASTRAN_AND_PATRAN_STUDENT_EDITIONS/ - INIT MASTER(S) - NASTRAN SYSTEM(319)=1 -1 **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 2 - -0 N A S T R A N E X E C U T I V E C O N T R O L E C H O -0 - - - ID MODEL,FEMAP - SOL SEMODES - CEND -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 3 - -0 -0 C A S E C O N T R O L E C H O - COMMAND - COUNT - 1 TITLE = MSC/MD NASTRAN MODES ANALYSIS SET - 2 ECHO = SORT - 3 DISPLACEMENT(PRINT,PUNCH) = ALL - 4 METHOD = 1 - 5 SPC = 1 - 6 BEGIN BULK -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 4 - -0 - S O R T E D B U L K D A T A E C H O - ENTRY - COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . - 1- CELAS2 2 33422.341000 2 0. - 2- CELAS2 3 20591.971000 6 0. - 3- CONM2 1 16 0 162.702 0. 0. 0. + - 4- + 0. 0. 0. 0. 0. 7.626657 - 5- CORD2C 1 0 0. 0. 0. 0. 0. 1. + - 6- + 1. 0. 1. - 7- CORD2S 2 0 0. 0. 0. 0. 0. 1. + - 8- + 1. 0. 1. - 9- EIGRL 1 10 0 MASS - 10- GRID 1 0 0. 0. 0. 0 - 11- GRID 2 0 .025 0. 0. 0 - 12- GRID 3 0 .05 0. 0. 0 - 13- GRID 4 0 .075 0. 0. 0 - 14- GRID 5 0 .1 0. 0. 0 - 15- GRID 6 0 .125 0. 0. 0 - 16- GRID 7 0 .15 0. 0. 0 - 17- GRID 8 0 .175 0. 0. 0 - 18- GRID 9 0 .2 0. 0. 0 - 19- GRID 10 0 .225 0. 0. 0 - 20- GRID 11 0 .25 0. 0. 0 - 21- GRID 12 0 .275 0. 0. 0 - 22- GRID 13 0 .3 0. 0. 0 - 23- GRID 14 0 .325 0. 0. 0 - 24- GRID 15 0 .35 0. 0. 0 - 25- GRID 16 0 .375 0. 0. 0 - 26- GRID 17 0 .4 0. 0. 0 - 27- GRID 18 0 .425 0. 0. 0 - 28- GRID 19 0 .45 0. 0. 0 - 29- GRID 20 0 .475 0. 0. 0 - 30- GRID 21 0 .5 0. 0. 0 - 31- GRID 22 0 .525 0. 0. 0 - 32- GRID 23 0 .55 0. 0. 0 - 33- GRID 24 0 .575 0. 0. 0 - 34- GRID 25 0 .6 0. 0. 0 - 35- GRID 26 0 .625 0. 0. 0 - 36- GRID 27 0 .65 0. 0. 0 - 37- GRID 28 0 .675 0. 0. 0 - 38- GRID 29 0 .7 0. 0. 0 - 39- GRID 30 0 .725 0. 0. 0 - 40- GRID 31 0 .75 0. 0. 0 - 41- GRID 32 0 .775 0. 0. 0 - 42- GRID 33 0 .8 0. 0. 0 - 43- GRID 34 0 .825 0. 0. 0 - 44- GRID 35 0 .85 0. 0. 0 - 45- GRID 36 0 .875 0. 0. 0 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 5 - -0 - S O R T E D B U L K D A T A E C H O - ENTRY - COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . - 46- GRID 37 0 .9 0. 0. 0 - 47- GRID 38 0 .925 0. 0. 0 - 48- GRID 39 0 .95 0. 0. 0 - 49- GRID 40 0 .975 0. 0. 0 - 50- GRID 41 0 1. 0. 0. 0 - 51- GRID 42 0 0. .06 0. 0 - 52- GRID 43 0 .025 .06 0. 0 - 53- GRID 44 0 .05 .06 0. 0 - 54- GRID 45 0 .075 .06 0. 0 - 55- GRID 46 0 .1 .06 0. 0 - 56- GRID 47 0 .125 .06 0. 0 - 57- GRID 48 0 .15 .06 0. 0 - 58- GRID 49 0 .175 .06 0. 0 - 59- GRID 50 0 .2 .06 0. 0 - 60- GRID 51 0 .225 .06 0. 0 - 61- GRID 52 0 .25 .06 0. 0 - 62- GRID 53 0 .275 .06 0. 0 - 63- GRID 54 0 .3 .06 0. 0 - 64- GRID 55 0 .325 .06 0. 0 - 65- GRID 56 0 .35 .06 0. 0 - 66- GRID 57 0 .375 .06 0. 0 - 67- GRID 58 0 .4 .06 0. 0 - 68- GRID 59 0 .425 .06 0. 0 - 69- GRID 60 0 .45 .06 0. 0 - 70- GRID 61 0 .475 .06 0. 0 - 71- GRID 62 0 .5 .06 0. 0 - 72- GRID 63 0 .525 .06 0. 0 - 73- GRID 64 0 .55 .06 0. 0 - 74- GRID 65 0 .575 .06 0. 0 - 75- GRID 66 0 .6 .06 0. 0 - 76- GRID 67 0 .625 .06 0. 0 - 77- GRID 68 0 .65 .06 0. 0 - 78- GRID 69 0 .675 .06 0. 0 - 79- GRID 70 0 .7 .06 0. 0 - 80- GRID 71 0 .725 .06 0. 0 - 81- GRID 72 0 .75 .06 0. 0 - 82- GRID 73 0 .775 .06 0. 0 - 83- GRID 74 0 .8 .06 0. 0 - 84- GRID 75 0 .825 .06 0. 0 - 85- GRID 76 0 .85 .06 0. 0 - 86- GRID 77 0 .875 .06 0. 0 - 87- GRID 78 0 .9 .06 0. 0 - 88- GRID 79 0 .925 .06 0. 0 - 89- GRID 80 0 .95 .06 0. 0 - 90- GRID 81 0 .975 .06 0. 0 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 6 - -0 - S O R T E D B U L K D A T A E C H O - ENTRY - COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . - 91- GRID 82 0 1. .06 0. 0 - 92- GRID 83 0 0. -.06 0. 0 - 93- GRID 84 0 .025 -.06 0. 0 - 94- GRID 85 0 .05 -.06 0. 0 - 95- GRID 86 0 .075 -.06 0. 0 - 96- GRID 87 0 .1 -.06 0. 0 - 97- GRID 88 0 .125 -.06 0. 0 - 98- GRID 89 0 .15 -.06 0. 0 - 99- GRID 90 0 .175 -.06 0. 0 - 100- GRID 91 0 .2 -.06 0. 0 - 101- GRID 92 0 .225 -.06 0. 0 - 102- GRID 93 0 .25 -.06 0. 0 - 103- GRID 94 0 .275 -.06 0. 0 - 104- GRID 95 0 .3 -.06 0. 0 - 105- GRID 96 0 .325 -.06 0. 0 - 106- GRID 97 0 .35 -.06 0. 0 - 107- GRID 98 0 .375 -.06 0. 0 - 108- GRID 99 0 .4 -.06 0. 0 - 109- GRID 100 0 .425 -.06 0. 0 - 110- GRID 101 0 .45 -.06 0. 0 - 111- GRID 102 0 .475 -.06 0. 0 - 112- GRID 103 0 .5 -.06 0. 0 - 113- GRID 104 0 .525 -.06 0. 0 - 114- GRID 105 0 .55 -.06 0. 0 - 115- GRID 106 0 .575 -.06 0. 0 - 116- GRID 107 0 .6 -.06 0. 0 - 117- GRID 108 0 .625 -.06 0. 0 - 118- GRID 109 0 .65 -.06 0. 0 - 119- GRID 110 0 .675 -.06 0. 0 - 120- GRID 111 0 .7 -.06 0. 0 - 121- GRID 112 0 .725 -.06 0. 0 - 122- GRID 113 0 .75 -.06 0. 0 - 123- GRID 114 0 .775 -.06 0. 0 - 124- GRID 115 0 .8 -.06 0. 0 - 125- GRID 116 0 .825 -.06 0. 0 - 126- GRID 117 0 .85 -.06 0. 0 - 127- GRID 118 0 .875 -.06 0. 0 - 128- GRID 119 0 .9 -.06 0. 0 - 129- GRID 120 0 .925 -.06 0. 0 - 130- GRID 121 0 .95 -.06 0. 0 - 131- GRID 122 0 .975 -.06 0. 0 - 132- GRID 123 0 1. -.06 0. 0 - 133- GRID 1000 0 .25 0. 0. 0 - 134- PARAM AUTOSPC NO - 135- PARAM GRDPNT 0 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 7 - -0 - S O R T E D B U L K D A T A E C H O - ENTRY - COUNT . 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 . - 136- PARAM OGEOM NO - 137- PARAM POST -1 - 138- PARAM PRGPST YES - 139- RBE2 4 1000 123456 1 2 3 4 5 + - 140- + 6 7 8 9 10 12 13 14 + - 141- + 15 16 17 18 19 20 21 22 + - 142- + 23 24 25 26 27 28 29 30 + - 143- + 31 32 33 34 35 36 37 38 + - 144- + 39 40 41 42 43 44 45 46 + - 145- + 47 48 49 50 51 52 53 54 + - 146- + 55 56 57 58 59 60 61 62 + - 147- + 63 64 65 66 67 68 69 70 + - 148- + 71 72 73 74 75 76 77 78 + - 149- + 79 80 81 82 83 84 85 86 + - 150- + 87 88 89 90 91 92 93 94 + - 151- + 95 96 97 98 99 100 101 102 + - 152- + 103 104 105 106 107 108 109 110 + - 153- + 111 112 113 114 115 116 117 118 + - 154- + 119 120 121 122 123 11 - 155- SET1 1 1 2 3 4 5 6 7 + - 156- + 8 9 10 11 12 13 14 15 + - 157- + 16 17 18 19 20 21 22 23 + - 158- + 24 25 26 27 28 29 30 31 + - 159- + 32 33 34 35 36 37 38 39 + - 160- + 40 41 42 43 44 45 46 47 + - 161- + 48 49 50 51 52 53 54 55 + - 162- + 56 57 58 59 60 61 62 63 + - 163- + 64 65 66 67 68 69 70 71 + - 164- + 72 73 74 75 76 77 78 79 + - 165- + 80 81 82 83 84 85 86 87 + - 166- + 88 89 90 91 92 93 94 95 + - 167- + 96 97 98 99 100 101 102 103 + - 168- + 104 105 106 107 108 109 110 111 + - 169- + 112 113 114 115 116 117 118 119 + - 170- + 120 121 122 123 - 171- SPC1 1 1345 1000 - ENDDATA - TOTAL COUNT= 172 - INPUT BULK DATA ENTRY COUNT = 177 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 8 - -0 - M O D E L S U M M A R Y BULK = 0 - ENTRY NAME NUMBER OF ENTRIES - ---------- ----------------- - CELAS2 2 - CONM2 1 - CORD2C 1 - CORD2S 1 - EIGRL 1 - GRID 124 - PARAM 5 - RBE2 1 - SET1 1 - SPC1 1 - - ^^^ - ^^^ >>> IFP OPERATIONS COMPLETE <<< - ^^^ - *** USER INFORMATION MESSAGE 4109 (OUTPX2) - THE LABEL IS XXXXXXXX FOR FORTRAN UNIT 12 - (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 7 WORDS.) - (NUMBER OF FORTRAN RECORDS WRITTEN = 8 RECORDS.) - (TOTAL DATA WRITTEN FOR LABEL = 17 WORDS.) -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 9 - -0 - O U T P U T F R O M G R I D P O I N T W E I G H T G E N E R A T O R -0 REFERENCE POINT = 0 - M O - * 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 6.101325E+01 * - * 0.000000E+00 0.000000E+00 1.627020E+02 0.000000E+00 -6.101325E+01 0.000000E+00 * - * 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 0.000000E+00 -6.101325E+01 0.000000E+00 2.287997E+01 0.000000E+00 * - * 0.000000E+00 6.101325E+01 0.000000E+00 0.000000E+00 0.000000E+00 3.050663E+01 * - S - * 1.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 1.000000E+00 0.000000E+00 * - * 0.000000E+00 0.000000E+00 1.000000E+00 * - DIRECTION - MASS AXIS SYSTEM (S) MASS X-C.G. Y-C.G. Z-C.G. - X 1.627020E+02 0.000000E+00 0.000000E+00 0.000000E+00 - Y 1.627020E+02 3.750000E-01 0.000000E+00 0.000000E+00 - Z 1.627020E+02 3.750000E-01 0.000000E+00 0.000000E+00 - I(S) - * 0.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 0.000000E+00 7.626657E+00 * - I(Q) - * 0.000000E+00 * - * 0.000000E+00 * - * 7.626657E+00 * - Q - * 1.000000E+00 0.000000E+00 0.000000E+00 * - * 0.000000E+00 1.000000E+00 0.000000E+00 * - * 0.000000E+00 0.000000E+00 1.000000E+00 * - -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 10 - -0 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 11 - -0 -0 RESULTANTS ABOUT ORIGIN OF SUPERELEMENT BASIC COORDINATE SYSTEM IN SUPERELEMENT BASIC SYSTEM COORDINATES. - -0 OLOAD RESULTANT - SUBCASE/ LOAD - DAREA ID TYPE T1 T2 T3 R1 R2 R3 -0 1 FX 0.000000E+00 ---- ---- ---- 0.000000E+00 0.000000E+00 - FY ---- 0.000000E+00 ---- 0.000000E+00 ---- 0.000000E+00 - FZ ---- ---- 0.000000E+00 0.000000E+00 0.000000E+00 ---- - MX ---- ---- ---- 0.000000E+00 ---- ---- - MY ---- ---- ---- ---- 0.000000E+00 ---- - MZ ---- ---- ---- ---- ---- 0.000000E+00 - TOTALS 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 - *** USER INFORMATION MESSAGE 5458 (REIG) - QL HOUSEHOLDER METHOD IS AUTOMATICALLY SELECTED . - User information: - Based upon automatic selection criteria the eigensolution was changed - to this method. To turn off this automatic selection, please set - system cell 359 to 0. In the case of an original Lanczos method - selection, setting the NE field to zero on the READ DMAP line will - also turn off this automatic option. -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 12 - -0 - - R E A L E I G E N V A L U E S - MODE EXTRACTION EIGENVALUE RADIANS CYCLES GENERALIZED GENERALIZED - NO. ORDER MASS STIFFNESS - 1 1 1.999443E+02 1.414017E+01 2.250478E+00 1.000000E+00 1.999443E+02 - 2 2 2.773949E+03 5.266829E+01 8.382419E+00 1.000000E+00 2.773949E+03 -*** User Information: Select OptionX for OUTPUT2 Datablock OUG1 - *** USER INFORMATION MESSAGE 4114 (OUTPX2) - DATA BLOCK OUG1 WRITTEN ON FORTRAN UNIT 12 IN BINARY (LTLEND) FORMAT USING NDDL DESCRIPTION FOR OUG1, TRL = - 101 0 1984 0 0 0 5 - NAME OF DATA BLOCK WRITTEN ON FORTRAN UNIT IS OUG1 - (MAXIMUM POSSIBLE FORTRAN RECORD SIZE = 16386 WORDS.) - (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 992 WORDS.) - (NUMBER OF FORTRAN RECORDS WRITTEN = 30 RECORDS.) - (TOTAL DATA WRITTEN FOR DATA BLOCK = 2317 WORDS.) -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 13 - -0 - EIGENVALUE = 1.999443E+02 - CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 1 G 0.0 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 - 2 G 0.0 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 - 3 G 0.0 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 - 4 G 0.0 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 - 5 G 0.0 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 - 6 G 0.0 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 - 7 G 0.0 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 - 8 G 0.0 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 - 9 G 0.0 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 - 10 G 0.0 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 - 11 G 0.0 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 - 12 G 0.0 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 - 13 G 0.0 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 - 14 G 0.0 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 - 15 G 0.0 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 - 16 G 0.0 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 - 17 G 0.0 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 - 18 G 0.0 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 - 19 G 0.0 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 - 20 G 0.0 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 - 21 G 0.0 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 - 22 G 0.0 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 - 23 G 0.0 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 - 24 G 0.0 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 - 25 G 0.0 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 - 26 G 0.0 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 - 27 G 0.0 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 - 28 G 0.0 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 - 29 G 0.0 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 - 30 G 0.0 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 - 31 G 0.0 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 - 32 G 0.0 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 - 33 G 0.0 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 - 34 G 0.0 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 - 35 G 0.0 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 - 36 G 0.0 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 - 37 G 0.0 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 - 38 G 0.0 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 - 39 G 0.0 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 - 40 G 0.0 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 - 41 G 0.0 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 - 42 G 1.002122E-03 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 - 43 G 1.002122E-03 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 - 44 G 1.002122E-03 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 - 45 G 1.002122E-03 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 - 46 G 1.002122E-03 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 - 47 G 1.002122E-03 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 - 48 G 1.002122E-03 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 - 49 G 1.002122E-03 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 - 50 G 1.002122E-03 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 14 - -0 - EIGENVALUE = 1.999443E+02 - CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 51 G 1.002122E-03 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 - 52 G 1.002122E-03 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 - 53 G 1.002122E-03 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 - 54 G 1.002122E-03 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 - 55 G 1.002122E-03 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 - 56 G 1.002122E-03 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 - 57 G 1.002122E-03 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 - 58 G 1.002122E-03 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 - 59 G 1.002122E-03 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 - 60 G 1.002122E-03 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 - 61 G 1.002122E-03 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 - 62 G 1.002122E-03 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 - 63 G 1.002122E-03 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 - 64 G 1.002122E-03 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 - 65 G 1.002122E-03 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 - 66 G 1.002122E-03 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 - 67 G 1.002122E-03 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 - 68 G 1.002122E-03 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 - 69 G 1.002122E-03 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 - 70 G 1.002122E-03 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 - 71 G 1.002122E-03 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 - 72 G 1.002122E-03 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 - 73 G 1.002122E-03 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 - 74 G 1.002122E-03 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 - 75 G 1.002122E-03 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 - 76 G 1.002122E-03 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 - 77 G 1.002122E-03 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 - 78 G 1.002122E-03 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 - 79 G 1.002122E-03 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 - 80 G 1.002122E-03 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 - 81 G 1.002122E-03 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 - 82 G 1.002122E-03 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 - 83 G -1.002122E-03 -7.205104E-02 0.0 0.0 0.0 -1.670203E-02 - 84 G -1.002122E-03 -7.246859E-02 0.0 0.0 0.0 -1.670203E-02 - 85 G -1.002122E-03 -7.288614E-02 0.0 0.0 0.0 -1.670203E-02 - 86 G -1.002122E-03 -7.330369E-02 0.0 0.0 0.0 -1.670203E-02 - 87 G -1.002122E-03 -7.372124E-02 0.0 0.0 0.0 -1.670203E-02 - 88 G -1.002122E-03 -7.413879E-02 0.0 0.0 0.0 -1.670203E-02 - 89 G -1.002122E-03 -7.455634E-02 0.0 0.0 0.0 -1.670203E-02 - 90 G -1.002122E-03 -7.497389E-02 0.0 0.0 0.0 -1.670203E-02 - 91 G -1.002122E-03 -7.539145E-02 0.0 0.0 0.0 -1.670203E-02 - 92 G -1.002122E-03 -7.580900E-02 0.0 0.0 0.0 -1.670203E-02 - 93 G -1.002122E-03 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 - 94 G -1.002122E-03 -7.664410E-02 0.0 0.0 0.0 -1.670203E-02 - 95 G -1.002122E-03 -7.706165E-02 0.0 0.0 0.0 -1.670203E-02 - 96 G -1.002122E-03 -7.747920E-02 0.0 0.0 0.0 -1.670203E-02 - 97 G -1.002122E-03 -7.789675E-02 0.0 0.0 0.0 -1.670203E-02 - 98 G -1.002122E-03 -7.831430E-02 0.0 0.0 0.0 -1.670203E-02 - 99 G -1.002122E-03 -7.873185E-02 0.0 0.0 0.0 -1.670203E-02 - 100 G -1.002122E-03 -7.914940E-02 0.0 0.0 0.0 -1.670203E-02 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 15 - -0 - EIGENVALUE = 1.999443E+02 - CYCLES = 2.250478E+00 R E A L E I G E N V E C T O R N O . 1 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 101 G -1.002122E-03 -7.956695E-02 0.0 0.0 0.0 -1.670203E-02 - 102 G -1.002122E-03 -7.998450E-02 0.0 0.0 0.0 -1.670203E-02 - 103 G -1.002122E-03 -8.040206E-02 0.0 0.0 0.0 -1.670203E-02 - 104 G -1.002122E-03 -8.081961E-02 0.0 0.0 0.0 -1.670203E-02 - 105 G -1.002122E-03 -8.123716E-02 0.0 0.0 0.0 -1.670203E-02 - 106 G -1.002122E-03 -8.165471E-02 0.0 0.0 0.0 -1.670203E-02 - 107 G -1.002122E-03 -8.207226E-02 0.0 0.0 0.0 -1.670203E-02 - 108 G -1.002122E-03 -8.248981E-02 0.0 0.0 0.0 -1.670203E-02 - 109 G -1.002122E-03 -8.290736E-02 0.0 0.0 0.0 -1.670203E-02 - 110 G -1.002122E-03 -8.332491E-02 0.0 0.0 0.0 -1.670203E-02 - 111 G -1.002122E-03 -8.374246E-02 0.0 0.0 0.0 -1.670203E-02 - 112 G -1.002122E-03 -8.416001E-02 0.0 0.0 0.0 -1.670203E-02 - 113 G -1.002122E-03 -8.457756E-02 0.0 0.0 0.0 -1.670203E-02 - 114 G -1.002122E-03 -8.499511E-02 0.0 0.0 0.0 -1.670203E-02 - 115 G -1.002122E-03 -8.541266E-02 0.0 0.0 0.0 -1.670203E-02 - 116 G -1.002122E-03 -8.583022E-02 0.0 0.0 0.0 -1.670203E-02 - 117 G -1.002122E-03 -8.624777E-02 0.0 0.0 0.0 -1.670203E-02 - 118 G -1.002122E-03 -8.666532E-02 0.0 0.0 0.0 -1.670203E-02 - 119 G -1.002122E-03 -8.708287E-02 0.0 0.0 0.0 -1.670203E-02 - 120 G -1.002122E-03 -8.750042E-02 0.0 0.0 0.0 -1.670203E-02 - 121 G -1.002122E-03 -8.791797E-02 0.0 0.0 0.0 -1.670203E-02 - 122 G -1.002122E-03 -8.833552E-02 0.0 0.0 0.0 -1.670203E-02 - 123 G -1.002122E-03 -8.875307E-02 0.0 0.0 0.0 -1.670203E-02 - 1000 G 0.0 -7.622655E-02 0.0 0.0 0.0 -1.670203E-02 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 16 - -0 - EIGENVALUE = 2.773949E+03 - CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 1 G 0.0 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 - 2 G 0.0 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 - 3 G 0.0 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 - 4 G 0.0 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 - 5 G 0.0 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 - 6 G 0.0 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 - 7 G 0.0 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 - 8 G 0.0 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 - 9 G 0.0 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 - 10 G 0.0 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 - 11 G 0.0 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 - 12 G 0.0 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 - 13 G 0.0 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 - 14 G 0.0 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 - 15 G 0.0 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 - 16 G 0.0 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 - 17 G 0.0 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 - 18 G 0.0 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 - 19 G 0.0 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 - 20 G 0.0 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 - 21 G 0.0 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 - 22 G 0.0 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 - 23 G 0.0 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 - 24 G 0.0 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 - 25 G 0.0 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 - 26 G 0.0 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 - 27 G 0.0 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 - 28 G 0.0 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 - 29 G 0.0 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 - 30 G 0.0 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 - 31 G 0.0 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 - 32 G 0.0 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 - 33 G 0.0 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 - 34 G 0.0 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 - 35 G 0.0 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 - 36 G 0.0 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 - 37 G 0.0 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 - 38 G 0.0 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 - 39 G 0.0 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 - 40 G 0.0 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 - 41 G 0.0 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 - 42 G 2.170309E-02 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 - 43 G 2.170309E-02 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 - 44 G 2.170309E-02 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 - 45 G 2.170309E-02 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 - 46 G 2.170309E-02 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 - 47 G 2.170309E-02 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 - 48 G 2.170309E-02 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 - 49 G 2.170309E-02 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 - 50 G 2.170309E-02 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 17 - -0 - EIGENVALUE = 2.773949E+03 - CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 51 G 2.170309E-02 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 - 52 G 2.170309E-02 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 - 53 G 2.170309E-02 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 - 54 G 2.170309E-02 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 - 55 G 2.170309E-02 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 - 56 G 2.170309E-02 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 - 57 G 2.170309E-02 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 - 58 G 2.170309E-02 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 - 59 G 2.170309E-02 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 - 60 G 2.170309E-02 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 - 61 G 2.170309E-02 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 - 62 G 2.170309E-02 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 - 63 G 2.170309E-02 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 - 64 G 2.170309E-02 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 - 65 G 2.170309E-02 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 - 66 G 2.170309E-02 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 - 67 G 2.170309E-02 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 - 68 G 2.170309E-02 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 - 69 G 2.170309E-02 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 - 70 G 2.170309E-02 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 - 71 G 2.170309E-02 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 - 72 G 2.170309E-02 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 - 73 G 2.170309E-02 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 - 74 G 2.170309E-02 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 - 75 G 2.170309E-02 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 - 76 G 2.170309E-02 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 - 77 G 2.170309E-02 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 - 78 G 2.170309E-02 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 - 79 G 2.170309E-02 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 - 80 G 2.170309E-02 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 - 81 G 2.170309E-02 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 - 82 G 2.170309E-02 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 - 83 G -2.170309E-02 1.392604E-01 0.0 0.0 0.0 -3.617182E-01 - 84 G -2.170309E-02 1.302175E-01 0.0 0.0 0.0 -3.617182E-01 - 85 G -2.170309E-02 1.211745E-01 0.0 0.0 0.0 -3.617182E-01 - 86 G -2.170309E-02 1.121316E-01 0.0 0.0 0.0 -3.617182E-01 - 87 G -2.170309E-02 1.030886E-01 0.0 0.0 0.0 -3.617182E-01 - 88 G -2.170309E-02 9.404566E-02 0.0 0.0 0.0 -3.617182E-01 - 89 G -2.170309E-02 8.500270E-02 0.0 0.0 0.0 -3.617182E-01 - 90 G -2.170309E-02 7.595975E-02 0.0 0.0 0.0 -3.617182E-01 - 91 G -2.170309E-02 6.691679E-02 0.0 0.0 0.0 -3.617182E-01 - 92 G -2.170309E-02 5.787383E-02 0.0 0.0 0.0 -3.617182E-01 - 93 G -2.170309E-02 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 - 94 G -2.170309E-02 3.978792E-02 0.0 0.0 0.0 -3.617182E-01 - 95 G -2.170309E-02 3.074496E-02 0.0 0.0 0.0 -3.617182E-01 - 96 G -2.170309E-02 2.170201E-02 0.0 0.0 0.0 -3.617182E-01 - 97 G -2.170309E-02 1.265905E-02 0.0 0.0 0.0 -3.617182E-01 - 98 G -2.170309E-02 3.616096E-03 0.0 0.0 0.0 -3.617182E-01 - 99 G -2.170309E-02 -5.426860E-03 0.0 0.0 0.0 -3.617182E-01 - 100 G -2.170309E-02 -1.446982E-02 0.0 0.0 0.0 -3.617182E-01 -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 18 - -0 - EIGENVALUE = 2.773949E+03 - CYCLES = 8.382419E+00 R E A L E I G E N V E C T O R N O . 2 - - POINT ID. TYPE T1 T2 T3 R1 R2 R3 - 101 G -2.170309E-02 -2.351277E-02 0.0 0.0 0.0 -3.617182E-01 - 102 G -2.170309E-02 -3.255573E-02 0.0 0.0 0.0 -3.617182E-01 - 103 G -2.170309E-02 -4.159868E-02 0.0 0.0 0.0 -3.617182E-01 - 104 G -2.170309E-02 -5.064164E-02 0.0 0.0 0.0 -3.617182E-01 - 105 G -2.170309E-02 -5.968460E-02 0.0 0.0 0.0 -3.617182E-01 - 106 G -2.170309E-02 -6.872755E-02 0.0 0.0 0.0 -3.617182E-01 - 107 G -2.170309E-02 -7.777051E-02 0.0 0.0 0.0 -3.617182E-01 - 108 G -2.170309E-02 -8.681347E-02 0.0 0.0 0.0 -3.617182E-01 - 109 G -2.170309E-02 -9.585642E-02 0.0 0.0 0.0 -3.617182E-01 - 110 G -2.170309E-02 -1.048994E-01 0.0 0.0 0.0 -3.617182E-01 - 111 G -2.170309E-02 -1.139423E-01 0.0 0.0 0.0 -3.617182E-01 - 112 G -2.170309E-02 -1.229853E-01 0.0 0.0 0.0 -3.617182E-01 - 113 G -2.170309E-02 -1.320282E-01 0.0 0.0 0.0 -3.617182E-01 - 114 G -2.170309E-02 -1.410712E-01 0.0 0.0 0.0 -3.617182E-01 - 115 G -2.170309E-02 -1.501142E-01 0.0 0.0 0.0 -3.617182E-01 - 116 G -2.170309E-02 -1.591571E-01 0.0 0.0 0.0 -3.617182E-01 - 117 G -2.170309E-02 -1.682001E-01 0.0 0.0 0.0 -3.617182E-01 - 118 G -2.170309E-02 -1.772430E-01 0.0 0.0 0.0 -3.617182E-01 - 119 G -2.170309E-02 -1.862860E-01 0.0 0.0 0.0 -3.617182E-01 - 120 G -2.170309E-02 -1.953289E-01 0.0 0.0 0.0 -3.617182E-01 - 121 G -2.170309E-02 -2.043719E-01 0.0 0.0 0.0 -3.617182E-01 - 122 G -2.170309E-02 -2.134149E-01 0.0 0.0 0.0 -3.617182E-01 - 123 G -2.170309E-02 -2.224578E-01 0.0 0.0 0.0 -3.617182E-01 - 1000 G 0.0 4.883088E-02 0.0 0.0 0.0 -3.617182E-01 - *** USER INFORMATION MESSAGE 4110 (OUTPX2) - END-OF-DATA SIMULATION ON FORTRAN UNIT 12 - (MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 1 WORDS.) - (NUMBER OF FORTRAN RECORDS WRITTEN = 1 RECORDS.) - (TOTAL DATA WRITTEN FOR EOF MARKER = 1 WORDS.) -1 MSC/MD NASTRAN MODES ANALYSIS SET **STUDENT EDITION* OCTOBER 9, 2020 MSC Nastran 12/18/18 PAGE 19 - -0 - * * * * D B D I C T P R I N T * * * * SUBDMAP = PRTSUM , DMAP STATEMENT NO. 71 - - - -0 * * * * A N A L Y S I S S U M M A R Y T A B L E * * * * -0 SEID PEID PROJ VERS APRCH SEMG SEMR SEKR SELG SELR MODES DYNRED SOLLIN PVALID SOLNL LOOPID DESIGN CYCLE SENSITIVITY - -------------------------------------------------------------------------------------------------------------------------- - 0 0 1 1 ' ' T T T T T T F T 0 F -1 0 F -0SEID = SUPERELEMENT ID. - PEID = PRIMARY SUPERELEMENT ID OF IMAGE SUPERELEMENT. - PROJ = PROJECT ID NUMBER. - VERS = VERSION ID. - APRCH = BLANK FOR STRUCTURAL ANALYSIS. HEAT FOR HEAT TRANSFER ANALYSIS. - SEMG = STIFFNESS AND MASS MATRIX GENERATION STEP. - SEMR = MASS MATRIX REDUCTION STEP (INCLUDES EIGENVALUE SOLUTION FOR MODES). - SEKR = STIFFNESS MATRIX REDUCTION STEP. - SELG = LOAD MATRIX GENERATION STEP. - SELR = LOAD MATRIX REDUCTION STEP. - MODES = T (TRUE) IF NORMAL MODES OR BUCKLING MODES CALCULATED. - DYNRED = T (TRUE) MEANS GENERALIZED DYNAMIC AND/OR COMPONENT MODE REDUCTION PERFORMED. - SOLLIN = T (TRUE) IF LINEAR SOLUTION EXISTS IN DATABASE. - PVALID = P-DISTRIBUTION ID OF P-VALUE FOR P-ELEMENTS - LOOPID = THE LAST LOOPID VALUE USED IN THE NONLINEAR ANALYSIS. USEFUL FOR RESTARTS. - SOLNL = T (TRUE) IF NONLINEAR SOLUTION EXISTS IN DATABASE. - DESIGN CYCLE = THE LAST DESIGN CYCLE (ONLY VALID IN OPTIMIZATION). - SENSITIVITY = SENSITIVITY MATRIX GENERATION FLAG. - - No PARAM values were set in the Control File. - -1 * * * END OF JOB * * * - - - No Symbolic Replacement variables or values were specified. - diff --git a/TestCases/py_su2_nastran/modal.pch b/TestCases/py_su2_nastran/modal.pch deleted file mode 100644 index eefecb3e91c1..000000000000 --- a/TestCases/py_su2_nastran/modal.pch +++ /dev/null @@ -1,510 +0,0 @@ -$TITLE = MSC/MD NASTRAN MODES ANALYSIS SET 1 -$SUBTITLE= 2 -$LABEL = 3 -$EIGENVECTOR 4 -$REAL OUTPUT 5 -$SUBCASE ID = 1 6 -$EIGENVALUE = 1.9994435E+02 MODE = 1 7 - 1 G 0.000000E+00 -7.205104E-02 0.000000E+00 8 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 9 - 2 G 0.000000E+00 -7.246859E-02 0.000000E+00 10 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 11 - 3 G 0.000000E+00 -7.288614E-02 0.000000E+00 12 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 13 - 4 G 0.000000E+00 -7.330369E-02 0.000000E+00 14 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 15 - 5 G 0.000000E+00 -7.372124E-02 0.000000E+00 16 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 17 - 6 G 0.000000E+00 -7.413879E-02 0.000000E+00 18 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 19 - 7 G 0.000000E+00 -7.455634E-02 0.000000E+00 20 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 21 - 8 G 0.000000E+00 -7.497389E-02 0.000000E+00 22 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 23 - 9 G 0.000000E+00 -7.539145E-02 0.000000E+00 24 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 25 - 10 G 0.000000E+00 -7.580900E-02 0.000000E+00 26 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 27 - 11 G 0.000000E+00 -7.622655E-02 0.000000E+00 28 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 29 - 12 G 0.000000E+00 -7.664410E-02 0.000000E+00 30 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 31 - 13 G 0.000000E+00 -7.706165E-02 0.000000E+00 32 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 33 - 14 G 0.000000E+00 -7.747920E-02 0.000000E+00 34 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 35 - 15 G 0.000000E+00 -7.789675E-02 0.000000E+00 36 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 37 - 16 G 0.000000E+00 -7.831430E-02 0.000000E+00 38 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 39 - 17 G 0.000000E+00 -7.873185E-02 0.000000E+00 40 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 41 - 18 G 0.000000E+00 -7.914940E-02 0.000000E+00 42 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 43 - 19 G 0.000000E+00 -7.956695E-02 0.000000E+00 44 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 45 - 20 G 0.000000E+00 -7.998450E-02 0.000000E+00 46 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 47 - 21 G 0.000000E+00 -8.040206E-02 0.000000E+00 48 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 49 - 22 G 0.000000E+00 -8.081961E-02 0.000000E+00 50 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 51 - 23 G 0.000000E+00 -8.123716E-02 0.000000E+00 52 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 53 - 24 G 0.000000E+00 -8.165471E-02 0.000000E+00 54 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 55 - 25 G 0.000000E+00 -8.207226E-02 0.000000E+00 56 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 57 - 26 G 0.000000E+00 -8.248981E-02 0.000000E+00 58 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 59 - 27 G 0.000000E+00 -8.290736E-02 0.000000E+00 60 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 61 - 28 G 0.000000E+00 -8.332491E-02 0.000000E+00 62 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 63 - 29 G 0.000000E+00 -8.374246E-02 0.000000E+00 64 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 65 - 30 G 0.000000E+00 -8.416001E-02 0.000000E+00 66 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 67 - 31 G 0.000000E+00 -8.457756E-02 0.000000E+00 68 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 69 - 32 G 0.000000E+00 -8.499511E-02 0.000000E+00 70 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 71 - 33 G 0.000000E+00 -8.541266E-02 0.000000E+00 72 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 73 - 34 G 0.000000E+00 -8.583022E-02 0.000000E+00 74 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 75 - 35 G 0.000000E+00 -8.624777E-02 0.000000E+00 76 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 77 - 36 G 0.000000E+00 -8.666532E-02 0.000000E+00 78 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 79 - 37 G 0.000000E+00 -8.708287E-02 0.000000E+00 80 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 81 - 38 G 0.000000E+00 -8.750042E-02 0.000000E+00 82 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 83 - 39 G 0.000000E+00 -8.791797E-02 0.000000E+00 84 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 85 - 40 G 0.000000E+00 -8.833552E-02 0.000000E+00 86 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 87 - 41 G 0.000000E+00 -8.875307E-02 0.000000E+00 88 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 89 - 42 G 1.002122E-03 -7.205104E-02 0.000000E+00 90 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 91 - 43 G 1.002122E-03 -7.246859E-02 0.000000E+00 92 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 93 - 44 G 1.002122E-03 -7.288614E-02 0.000000E+00 94 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 95 - 45 G 1.002122E-03 -7.330369E-02 0.000000E+00 96 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 97 - 46 G 1.002122E-03 -7.372124E-02 0.000000E+00 98 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 99 - 47 G 1.002122E-03 -7.413879E-02 0.000000E+00 100 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 101 - 48 G 1.002122E-03 -7.455634E-02 0.000000E+00 102 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 103 - 49 G 1.002122E-03 -7.497389E-02 0.000000E+00 104 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 105 - 50 G 1.002122E-03 -7.539145E-02 0.000000E+00 106 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 107 - 51 G 1.002122E-03 -7.580900E-02 0.000000E+00 108 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 109 - 52 G 1.002122E-03 -7.622655E-02 0.000000E+00 110 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 111 - 53 G 1.002122E-03 -7.664410E-02 0.000000E+00 112 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 113 - 54 G 1.002122E-03 -7.706165E-02 0.000000E+00 114 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 115 - 55 G 1.002122E-03 -7.747920E-02 0.000000E+00 116 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 117 - 56 G 1.002122E-03 -7.789675E-02 0.000000E+00 118 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 119 - 57 G 1.002122E-03 -7.831430E-02 0.000000E+00 120 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 121 - 58 G 1.002122E-03 -7.873185E-02 0.000000E+00 122 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 123 - 59 G 1.002122E-03 -7.914940E-02 0.000000E+00 124 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 125 - 60 G 1.002122E-03 -7.956695E-02 0.000000E+00 126 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 127 - 61 G 1.002122E-03 -7.998450E-02 0.000000E+00 128 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 129 - 62 G 1.002122E-03 -8.040206E-02 0.000000E+00 130 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 131 - 63 G 1.002122E-03 -8.081961E-02 0.000000E+00 132 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 133 - 64 G 1.002122E-03 -8.123716E-02 0.000000E+00 134 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 135 - 65 G 1.002122E-03 -8.165471E-02 0.000000E+00 136 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 137 - 66 G 1.002122E-03 -8.207226E-02 0.000000E+00 138 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 139 - 67 G 1.002122E-03 -8.248981E-02 0.000000E+00 140 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 141 - 68 G 1.002122E-03 -8.290736E-02 0.000000E+00 142 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 143 - 69 G 1.002122E-03 -8.332491E-02 0.000000E+00 144 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 145 - 70 G 1.002122E-03 -8.374246E-02 0.000000E+00 146 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 147 - 71 G 1.002122E-03 -8.416001E-02 0.000000E+00 148 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 149 - 72 G 1.002122E-03 -8.457756E-02 0.000000E+00 150 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 151 - 73 G 1.002122E-03 -8.499511E-02 0.000000E+00 152 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 153 - 74 G 1.002122E-03 -8.541266E-02 0.000000E+00 154 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 155 - 75 G 1.002122E-03 -8.583022E-02 0.000000E+00 156 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 157 - 76 G 1.002122E-03 -8.624777E-02 0.000000E+00 158 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 159 - 77 G 1.002122E-03 -8.666532E-02 0.000000E+00 160 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 161 - 78 G 1.002122E-03 -8.708287E-02 0.000000E+00 162 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 163 - 79 G 1.002122E-03 -8.750042E-02 0.000000E+00 164 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 165 - 80 G 1.002122E-03 -8.791797E-02 0.000000E+00 166 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 167 - 81 G 1.002122E-03 -8.833552E-02 0.000000E+00 168 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 169 - 82 G 1.002122E-03 -8.875307E-02 0.000000E+00 170 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 171 - 83 G -1.002122E-03 -7.205104E-02 0.000000E+00 172 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 173 - 84 G -1.002122E-03 -7.246859E-02 0.000000E+00 174 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 175 - 85 G -1.002122E-03 -7.288614E-02 0.000000E+00 176 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 177 - 86 G -1.002122E-03 -7.330369E-02 0.000000E+00 178 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 179 - 87 G -1.002122E-03 -7.372124E-02 0.000000E+00 180 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 181 - 88 G -1.002122E-03 -7.413879E-02 0.000000E+00 182 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 183 - 89 G -1.002122E-03 -7.455634E-02 0.000000E+00 184 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 185 - 90 G -1.002122E-03 -7.497389E-02 0.000000E+00 186 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 187 - 91 G -1.002122E-03 -7.539145E-02 0.000000E+00 188 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 189 - 92 G -1.002122E-03 -7.580900E-02 0.000000E+00 190 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 191 - 93 G -1.002122E-03 -7.622655E-02 0.000000E+00 192 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 193 - 94 G -1.002122E-03 -7.664410E-02 0.000000E+00 194 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 195 - 95 G -1.002122E-03 -7.706165E-02 0.000000E+00 196 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 197 - 96 G -1.002122E-03 -7.747920E-02 0.000000E+00 198 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 199 - 97 G -1.002122E-03 -7.789675E-02 0.000000E+00 200 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 201 - 98 G -1.002122E-03 -7.831430E-02 0.000000E+00 202 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 203 - 99 G -1.002122E-03 -7.873185E-02 0.000000E+00 204 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 205 - 100 G -1.002122E-03 -7.914940E-02 0.000000E+00 206 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 207 - 101 G -1.002122E-03 -7.956695E-02 0.000000E+00 208 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 209 - 102 G -1.002122E-03 -7.998450E-02 0.000000E+00 210 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 211 - 103 G -1.002122E-03 -8.040206E-02 0.000000E+00 212 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 213 - 104 G -1.002122E-03 -8.081961E-02 0.000000E+00 214 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 215 - 105 G -1.002122E-03 -8.123716E-02 0.000000E+00 216 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 217 - 106 G -1.002122E-03 -8.165471E-02 0.000000E+00 218 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 219 - 107 G -1.002122E-03 -8.207226E-02 0.000000E+00 220 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 221 - 108 G -1.002122E-03 -8.248981E-02 0.000000E+00 222 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 223 - 109 G -1.002122E-03 -8.290736E-02 0.000000E+00 224 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 225 - 110 G -1.002122E-03 -8.332491E-02 0.000000E+00 226 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 227 - 111 G -1.002122E-03 -8.374246E-02 0.000000E+00 228 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 229 - 112 G -1.002122E-03 -8.416001E-02 0.000000E+00 230 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 231 - 113 G -1.002122E-03 -8.457756E-02 0.000000E+00 232 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 233 - 114 G -1.002122E-03 -8.499511E-02 0.000000E+00 234 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 235 - 115 G -1.002122E-03 -8.541266E-02 0.000000E+00 236 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 237 - 116 G -1.002122E-03 -8.583022E-02 0.000000E+00 238 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 239 - 117 G -1.002122E-03 -8.624777E-02 0.000000E+00 240 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 241 - 118 G -1.002122E-03 -8.666532E-02 0.000000E+00 242 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 243 - 119 G -1.002122E-03 -8.708287E-02 0.000000E+00 244 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 245 - 120 G -1.002122E-03 -8.750042E-02 0.000000E+00 246 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 247 - 121 G -1.002122E-03 -8.791797E-02 0.000000E+00 248 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 249 - 122 G -1.002122E-03 -8.833552E-02 0.000000E+00 250 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 251 - 123 G -1.002122E-03 -8.875307E-02 0.000000E+00 252 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 253 - 1000 G 0.000000E+00 -7.622655E-02 0.000000E+00 254 --CONT- 0.000000E+00 0.000000E+00 -1.670203E-02 255 -$TITLE = MSC/MD NASTRAN MODES ANALYSIS SET 256 -$SUBTITLE= 257 -$LABEL = 258 -$EIGENVECTOR 259 -$REAL OUTPUT 260 -$SUBCASE ID = 1 261 -$EIGENVALUE = 2.7739492E+03 MODE = 2 262 - 1 G 0.000000E+00 1.392604E-01 0.000000E+00 263 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 264 - 2 G 0.000000E+00 1.302175E-01 0.000000E+00 265 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 266 - 3 G 0.000000E+00 1.211745E-01 0.000000E+00 267 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 268 - 4 G 0.000000E+00 1.121316E-01 0.000000E+00 269 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 270 - 5 G 0.000000E+00 1.030886E-01 0.000000E+00 271 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 272 - 6 G 0.000000E+00 9.404566E-02 0.000000E+00 273 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 274 - 7 G 0.000000E+00 8.500270E-02 0.000000E+00 275 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 276 - 8 G 0.000000E+00 7.595975E-02 0.000000E+00 277 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 278 - 9 G 0.000000E+00 6.691679E-02 0.000000E+00 279 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 280 - 10 G 0.000000E+00 5.787383E-02 0.000000E+00 281 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 282 - 11 G 0.000000E+00 4.883088E-02 0.000000E+00 283 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 284 - 12 G 0.000000E+00 3.978792E-02 0.000000E+00 285 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 286 - 13 G 0.000000E+00 3.074496E-02 0.000000E+00 287 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 288 - 14 G 0.000000E+00 2.170201E-02 0.000000E+00 289 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 290 - 15 G 0.000000E+00 1.265905E-02 0.000000E+00 291 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 292 - 16 G 0.000000E+00 3.616096E-03 0.000000E+00 293 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 294 - 17 G 0.000000E+00 -5.426860E-03 0.000000E+00 295 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 296 - 18 G 0.000000E+00 -1.446982E-02 0.000000E+00 297 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 298 - 19 G 0.000000E+00 -2.351277E-02 0.000000E+00 299 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 300 - 20 G 0.000000E+00 -3.255573E-02 0.000000E+00 301 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 302 - 21 G 0.000000E+00 -4.159868E-02 0.000000E+00 303 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 304 - 22 G 0.000000E+00 -5.064164E-02 0.000000E+00 305 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 306 - 23 G 0.000000E+00 -5.968460E-02 0.000000E+00 307 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 308 - 24 G 0.000000E+00 -6.872755E-02 0.000000E+00 309 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 310 - 25 G 0.000000E+00 -7.777051E-02 0.000000E+00 311 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 312 - 26 G 0.000000E+00 -8.681347E-02 0.000000E+00 313 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 314 - 27 G 0.000000E+00 -9.585642E-02 0.000000E+00 315 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 316 - 28 G 0.000000E+00 -1.048994E-01 0.000000E+00 317 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 318 - 29 G 0.000000E+00 -1.139423E-01 0.000000E+00 319 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 320 - 30 G 0.000000E+00 -1.229853E-01 0.000000E+00 321 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 322 - 31 G 0.000000E+00 -1.320282E-01 0.000000E+00 323 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 324 - 32 G 0.000000E+00 -1.410712E-01 0.000000E+00 325 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 326 - 33 G 0.000000E+00 -1.501142E-01 0.000000E+00 327 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 328 - 34 G 0.000000E+00 -1.591571E-01 0.000000E+00 329 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 330 - 35 G 0.000000E+00 -1.682001E-01 0.000000E+00 331 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 332 - 36 G 0.000000E+00 -1.772430E-01 0.000000E+00 333 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 334 - 37 G 0.000000E+00 -1.862860E-01 0.000000E+00 335 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 336 - 38 G 0.000000E+00 -1.953289E-01 0.000000E+00 337 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 338 - 39 G 0.000000E+00 -2.043719E-01 0.000000E+00 339 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 340 - 40 G 0.000000E+00 -2.134149E-01 0.000000E+00 341 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 342 - 41 G 0.000000E+00 -2.224578E-01 0.000000E+00 343 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 344 - 42 G 2.170309E-02 1.392604E-01 0.000000E+00 345 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 346 - 43 G 2.170309E-02 1.302175E-01 0.000000E+00 347 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 348 - 44 G 2.170309E-02 1.211745E-01 0.000000E+00 349 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 350 - 45 G 2.170309E-02 1.121316E-01 0.000000E+00 351 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 352 - 46 G 2.170309E-02 1.030886E-01 0.000000E+00 353 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 354 - 47 G 2.170309E-02 9.404566E-02 0.000000E+00 355 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 356 - 48 G 2.170309E-02 8.500270E-02 0.000000E+00 357 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 358 - 49 G 2.170309E-02 7.595975E-02 0.000000E+00 359 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 360 - 50 G 2.170309E-02 6.691679E-02 0.000000E+00 361 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 362 - 51 G 2.170309E-02 5.787383E-02 0.000000E+00 363 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 364 - 52 G 2.170309E-02 4.883088E-02 0.000000E+00 365 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 366 - 53 G 2.170309E-02 3.978792E-02 0.000000E+00 367 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 368 - 54 G 2.170309E-02 3.074496E-02 0.000000E+00 369 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 370 - 55 G 2.170309E-02 2.170201E-02 0.000000E+00 371 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 372 - 56 G 2.170309E-02 1.265905E-02 0.000000E+00 373 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 374 - 57 G 2.170309E-02 3.616096E-03 0.000000E+00 375 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 376 - 58 G 2.170309E-02 -5.426860E-03 0.000000E+00 377 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 378 - 59 G 2.170309E-02 -1.446982E-02 0.000000E+00 379 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 380 - 60 G 2.170309E-02 -2.351277E-02 0.000000E+00 381 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 382 - 61 G 2.170309E-02 -3.255573E-02 0.000000E+00 383 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 384 - 62 G 2.170309E-02 -4.159868E-02 0.000000E+00 385 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 386 - 63 G 2.170309E-02 -5.064164E-02 0.000000E+00 387 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 388 - 64 G 2.170309E-02 -5.968460E-02 0.000000E+00 389 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 390 - 65 G 2.170309E-02 -6.872755E-02 0.000000E+00 391 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 392 - 66 G 2.170309E-02 -7.777051E-02 0.000000E+00 393 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 394 - 67 G 2.170309E-02 -8.681347E-02 0.000000E+00 395 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 396 - 68 G 2.170309E-02 -9.585642E-02 0.000000E+00 397 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 398 - 69 G 2.170309E-02 -1.048994E-01 0.000000E+00 399 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 400 - 70 G 2.170309E-02 -1.139423E-01 0.000000E+00 401 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 402 - 71 G 2.170309E-02 -1.229853E-01 0.000000E+00 403 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 404 - 72 G 2.170309E-02 -1.320282E-01 0.000000E+00 405 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 406 - 73 G 2.170309E-02 -1.410712E-01 0.000000E+00 407 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 408 - 74 G 2.170309E-02 -1.501142E-01 0.000000E+00 409 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 410 - 75 G 2.170309E-02 -1.591571E-01 0.000000E+00 411 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 412 - 76 G 2.170309E-02 -1.682001E-01 0.000000E+00 413 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 414 - 77 G 2.170309E-02 -1.772430E-01 0.000000E+00 415 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 416 - 78 G 2.170309E-02 -1.862860E-01 0.000000E+00 417 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 418 - 79 G 2.170309E-02 -1.953289E-01 0.000000E+00 419 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 420 - 80 G 2.170309E-02 -2.043719E-01 0.000000E+00 421 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 422 - 81 G 2.170309E-02 -2.134149E-01 0.000000E+00 423 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 424 - 82 G 2.170309E-02 -2.224578E-01 0.000000E+00 425 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 426 - 83 G -2.170309E-02 1.392604E-01 0.000000E+00 427 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 428 - 84 G -2.170309E-02 1.302175E-01 0.000000E+00 429 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 430 - 85 G -2.170309E-02 1.211745E-01 0.000000E+00 431 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 432 - 86 G -2.170309E-02 1.121316E-01 0.000000E+00 433 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 434 - 87 G -2.170309E-02 1.030886E-01 0.000000E+00 435 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 436 - 88 G -2.170309E-02 9.404566E-02 0.000000E+00 437 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 438 - 89 G -2.170309E-02 8.500270E-02 0.000000E+00 439 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 440 - 90 G -2.170309E-02 7.595975E-02 0.000000E+00 441 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 442 - 91 G -2.170309E-02 6.691679E-02 0.000000E+00 443 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 444 - 92 G -2.170309E-02 5.787383E-02 0.000000E+00 445 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 446 - 93 G -2.170309E-02 4.883088E-02 0.000000E+00 447 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 448 - 94 G -2.170309E-02 3.978792E-02 0.000000E+00 449 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 450 - 95 G -2.170309E-02 3.074496E-02 0.000000E+00 451 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 452 - 96 G -2.170309E-02 2.170201E-02 0.000000E+00 453 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 454 - 97 G -2.170309E-02 1.265905E-02 0.000000E+00 455 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 456 - 98 G -2.170309E-02 3.616096E-03 0.000000E+00 457 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 458 - 99 G -2.170309E-02 -5.426860E-03 0.000000E+00 459 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 460 - 100 G -2.170309E-02 -1.446982E-02 0.000000E+00 461 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 462 - 101 G -2.170309E-02 -2.351277E-02 0.000000E+00 463 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 464 - 102 G -2.170309E-02 -3.255573E-02 0.000000E+00 465 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 466 - 103 G -2.170309E-02 -4.159868E-02 0.000000E+00 467 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 468 - 104 G -2.170309E-02 -5.064164E-02 0.000000E+00 469 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 470 - 105 G -2.170309E-02 -5.968460E-02 0.000000E+00 471 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 472 - 106 G -2.170309E-02 -6.872755E-02 0.000000E+00 473 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 474 - 107 G -2.170309E-02 -7.777051E-02 0.000000E+00 475 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 476 - 108 G -2.170309E-02 -8.681347E-02 0.000000E+00 477 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 478 - 109 G -2.170309E-02 -9.585642E-02 0.000000E+00 479 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 480 - 110 G -2.170309E-02 -1.048994E-01 0.000000E+00 481 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 482 - 111 G -2.170309E-02 -1.139423E-01 0.000000E+00 483 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 484 - 112 G -2.170309E-02 -1.229853E-01 0.000000E+00 485 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 486 - 113 G -2.170309E-02 -1.320282E-01 0.000000E+00 487 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 488 - 114 G -2.170309E-02 -1.410712E-01 0.000000E+00 489 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 490 - 115 G -2.170309E-02 -1.501142E-01 0.000000E+00 491 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 492 - 116 G -2.170309E-02 -1.591571E-01 0.000000E+00 493 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 494 - 117 G -2.170309E-02 -1.682001E-01 0.000000E+00 495 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 496 - 118 G -2.170309E-02 -1.772430E-01 0.000000E+00 497 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 498 - 119 G -2.170309E-02 -1.862860E-01 0.000000E+00 499 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 500 - 120 G -2.170309E-02 -1.953289E-01 0.000000E+00 501 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 502 - 121 G -2.170309E-02 -2.043719E-01 0.000000E+00 503 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 504 - 122 G -2.170309E-02 -2.134149E-01 0.000000E+00 505 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 506 - 123 G -2.170309E-02 -2.224578E-01 0.000000E+00 507 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 508 - 1000 G 0.000000E+00 4.883088E-02 0.000000E+00 509 --CONT- 0.000000E+00 0.000000E+00 -3.617182E-01 510 diff --git a/TestCases/py_su2_nastran/solid.cfg b/TestCases/py_su2_nastran/solid.cfg deleted file mode 100644 index d14658a017c6..000000000000 --- a/TestCases/py_su2_nastran/solid.cfg +++ /dev/null @@ -1,38 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unsteady FSI of a NACA 0012 % -% Author: Nicola Fonzi, Vittorio Cavalieri % -% Institution: Politecnico di Milano % -% Date: Dec 10, 2020 % -% File Version 7.0.8 "Blackbird" (or newer) % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%% -% INTEGER VALUES -%%%%%%%%%%%%%%%%%%%%%%% -NMODES = 2 -%%%%%%%%%%%%%%%%%%%%%%% -% STRING VALUES -%%%%%%%%%%%%%%%%%%%%%%% -% -MESH_FILE = modal.f06 -PUNCH_FILE = modal.pch -MOVING_MARKER = airfoil -TIME_MARCHING = YES -RESTART_SOL = NO -% -% -% -%%%%%%%%%%%%%%%%%%%%%%% -% FLOAT VALUES -%%%%%%%%%%%%%%%%%%%%%%% -% -MODAL_DAMPING = 0.0 -DELTA_T = 0.001 -RHO = 0.5 -%%%%%%%%%%%%%%%%%%%%%%% -% Initial conditions for the modes -%%%%%%%%%%%%%%%%%%%%%%% -% 5 degrees and no plunge -INITIAL_MODES = {0:-0.1501,1:-0.2343} diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 9d12771f3afe..27d2d6125f97 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -213,18 +213,6 @@ def main(): tutorial_design_multiobj.no_restart = True test_list.append(tutorial_design_multiobj) - # Multi Objective Design - testcase_su2_nastran = TestCase('py_su2_nastran') - testcase_su2_nastran.cfg_dir = "TestCases/py_su2_nastran" - testcase_su2_nastran.cfg_file = "fsi.cfg" - testcase_su2_nastran.test_iter = 4 - testcase_su2_nastran.test_vals = [0.006316, -0.114296, -2.522122, 0.000000] #last 4 columns - testcase_su2_nastran.su2_exec = "mpirun -np 2 python3 install/bin/fsi_computation.py --parallel -f" - testcase_su2_nastran.timeout = 1600 - testcase_su2_nastran.tol = 0.00001 - testcase_su2_nastran.no_restart = True - test_list.append(testcase_su2_nastran) - ###################################### ### RUN TESTS ### ###################################### From 9459d3980c5246ddb6c5272df7bd44944d8177c4 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 25 Jan 2021 15:32:15 +0100 Subject: [PATCH 163/326] Grid velocities printed also for deform_mesh case --- Common/src/geometry/CGeometry.cpp | 3 +- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 3 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 6 +-- SU2_CFD/src/output/CNEMOCompOutput.cpp | 4 +- config_template.cfg | 49 ++++++++++++------------ 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 8cfc74f5c24c..6bff4f440a9d 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -2520,7 +2520,7 @@ void CGeometry::UpdateGeometry(CGeometry **geometry_container, CConfig *config) geometry_container[MESH_0]->InitiateComms(geometry_container[MESH_0], config, COORDINATES); geometry_container[MESH_0]->CompleteComms(geometry_container[MESH_0], config, COORDINATES); - if (config->GetGrid_Movement() || config->GetDynamic_Grid()){ + if (config->GetDynamic_Grid()){ geometry_container[MESH_0]->InitiateComms(geometry_container[MESH_0], config, GRID_VELOCITY); geometry_container[MESH_0]->CompleteComms(geometry_container[MESH_0], config, GRID_VELOCITY); } @@ -3961,4 +3961,3 @@ void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeo } } } - diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index 90c33b69f7ad..0bdbb0080622 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -372,7 +372,7 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ /// END_GROUP // Grid velocity - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); if (nDim == 3 ) @@ -537,4 +537,3 @@ bool CAdjFlowIncOutput::SetUpdate_Averages(CConfig *config){ // return (config->GetUnsteady_Simulation() != STEADY && !dualtime); } - diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index b39647a11aa9..b5ebcc58621d 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -60,7 +60,7 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp requestedVolumeFields.emplace_back("COORDINATES"); requestedVolumeFields.emplace_back("SOLUTION"); requestedVolumeFields.emplace_back("PRIMITIVE"); - if (config->GetGrid_Movement()) requestedVolumeFields.emplace_back("GRID_VELOCITY"); + if (config->GetDynamic_Grid()) requestedVolumeFields.emplace_back("GRID_VELOCITY"); nRequestedVolumeFields = requestedVolumeFields.size(); } @@ -383,7 +383,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("P1-RAD", "Radiative_Energy(P1)", "SOLUTION", "Radiative Energy"); // Grid velocity - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); if (nDim == 3 ) @@ -537,7 +537,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("P1-RAD", iPoint, Node_Rad->GetSolution(iPoint,0)); } - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ SetVolumeOutputValue("GRID_VELOCITY-X", iPoint, Node_Geo->GetGridVel(iPoint)[0]); SetVolumeOutputValue("GRID_VELOCITY-Y", iPoint, Node_Geo->GetGridVel(iPoint)[1]); if (nDim == 3) diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 763f9006af56..ef4e13f88eda 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -328,7 +328,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("MASSFRAC_" + std::to_string(iSpecies), "MassFrac_" + std::to_string(iSpecies), "AUXILIARY", "MassFrac_" + std::to_string(iSpecies)); // Grid velocity - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); if (nDim == 3 ) @@ -471,7 +471,7 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv break; } - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ SetVolumeOutputValue("GRID_VELOCITY-X", iPoint, Node_Geo->GetGridVel(iPoint)[0]); SetVolumeOutputValue("GRID_VELOCITY-Y", iPoint, Node_Geo->GetGridVel(iPoint)[1]); if (nDim == 3) diff --git a/config_template.cfg b/config_template.cfg index bcb6f59b9674..937c13a8cb1f 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -53,11 +53,11 @@ DISCARD_INFILES= NO % % System of measurements (SI, US) % International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, +% Newtons = kg m/s^2, Pascals = N/m^2, % Density = kg/m^3, Speed = m/s, % Equiv. Area = m^2 ) -% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, -% psf = lbf/ft^2, Density = slug/ft^3, +% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, +% psf = lbf/ft^2, Density = slug/ft^3, % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= SI % @@ -79,7 +79,7 @@ OUTER_ITER= 1 % Maximum number of time iterations TIME_ITER= 1 % -% Convergence field +% Convergence field CONV_FIELD= DRAG % % Min value of the residual (log10 of the residual) @@ -100,7 +100,7 @@ RESTART_ITER= 0 %% Time convergence monitoring WINDOW_CAUCHY_CRIT = YES % -% List of time convergence fields +% List of time convergence fields CONV_WINDOW_FIELD = (TAVG_DRAG, TAVG_LIFT) % % Time Convergence Monitoring starts at Iteration WINDOW_START_ITER + CONV_WINDOW_STARTITER @@ -135,7 +135,7 @@ UNST_CFL_NUMBER= 0.0 % Time iteration to start the windowed time average in a direct run WINDOW_START_ITER = 500 % -% Window used for reverse sweep and direct run. Options (SQUARE, HANN, HANN_SQUARE, BUMP) Square is default. +% Window used for reverse sweep and direct run. Options (SQUARE, HANN, HANN_SQUARE, BUMP) Square is default. WINDOW_FUNCTION = SQUARE % % ------------------------------- DES Parameters ------------------------------% @@ -216,8 +216,8 @@ INC_DENSITY_INIT= 1.2886 % Initial velocity for incompressible flows (1.0,0,0 m/s by default) INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) % -% Initial temperature for incompressible flows that include the -% energy equation (288.15 K by default). Value is ignored if +% Initial temperature for incompressible flows that include the +% energy equation (288.15 K by default). Value is ignored if % INC_ENERGY_EQUATION is false. INC_TEMPERATURE_INIT= 288.15 % @@ -232,7 +232,7 @@ INC_DENSITY_REF= 1.0 % Reference velocity for incompressible flows (1.0 m/s by default) INC_VELOCITY_REF= 1.0 % -% Reference temperature for incompressible flows that include the +% Reference temperature for incompressible flows that include the % energy equation (1.0 K by default) INC_TEMPERATURE_REF = 1.0 % @@ -321,11 +321,11 @@ CRITICAL_PRESSURE= 3588550.0 % Acentri factor (0.035 (air)) ACENTRIC_FACTOR= 0.035 % -% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). +% Specific heat at constant pressure, Cp (1004.703 J/kg*K (air)). % Incompressible fluids with energy eqn. (CONSTANT_DENSITY, INC_IDEAL_GAS) and the heat equation. SPECIFIC_HEAT_CP= 1004.703 % -% Thermal expansion coefficient (0.00347 K^-1 (air)) +% Thermal expansion coefficient (0.00347 K^-1 (air)) % Used with Boussinesq approx. (incompressible, BOUSSINESQ density model only) THERMAL_EXPANSION_COEFF= 0.00347 % @@ -370,7 +370,7 @@ MU_POLYCOEFFS= (0.0, 0.0, 0.0, 0.0, 0.0) % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% % -% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, % POLYNOMIAL_CONDUCTIVITY). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % @@ -428,7 +428,7 @@ PLUNGING_OMEGA= 0.0 0.0 0.0 % Plunging amplitude (m or ft) in x, y, & z directions PLUNGING_AMPL= 0.0 0.0 0.0 % -% Type of dynamic surface movement (NONE, DEFORMING, +% Type of dynamic surface movement (NONE, DEFORMING, % MOVING_WALL, FLUID_STRUCTURE, FLUID_STRUCTURE_STATIC, % AEROELASTIC, EXTERNAL, EXTERNAL_ROTATION, % AEROELASTIC_RIGID_MOTION) @@ -470,7 +470,7 @@ MOVE_MOTION_ORIGIN = 0 % If BUFFET objective/constraint is specified, the objective is given by % the integrated sensor normalized by reference area % -% See doi: 10.2514/1.J055172 +% See doi: 10.2514/1.J055172 % % Evaluate buffet sensor on Navier-Stokes markers (NO, YES) BUFFET_MONITORING= NO @@ -786,7 +786,7 @@ ENGINE_INFLOW_TYPE= FAN_FACE_MACH % Format: (engine inflow marker, fan face Mach, ... ) MARKER_ENGINE_INFLOW= ( NONE ) % -% Engine exhaust boundary marker(s) with the following formats (NONE = no marker) +% Engine exhaust boundary marker(s) with the following formats (NONE = no marker) % Format: (engine exhaust marker, total nozzle temp, total nozzle pressure, ... ) MARKER_ENGINE_EXHAUST= ( NONE ) % @@ -863,7 +863,7 @@ SPATIAL_FOURIER= NO CATALYTIC_WALL= ( NONE ) % ------------------------ WALL ROUGHNESS DEFINITION --------------------------% -% The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. +% The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. % This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE. WALL_ROUGHNESS = (wall1, ks1, wall2, ks2) %WALL_ROUGHNESS = (wall1, ks1, wall2, 0.0) %is also allowed @@ -901,7 +901,7 @@ NUM_METHOD_GRAD= GREEN_GAUSS % Numerical method for spatial gradients to be used for MUSCL reconstruction % Options are (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES, LEAST_SQUARES). Default value is -% NONE and the method specified in NUM_METHOD_GRAD is used. +% NONE and the method specified in NUM_METHOD_GRAD is used. NUM_METHOD_GRAD_RECON = LEAST_SQUARES % % CFL number (initial value for the adaptive CFL number) @@ -930,7 +930,7 @@ RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % FORCE_X, FORCE_Y, FORCE_Z, THRUST, % TORQUE, TOTAL_HEATFLUX, % MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, +% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, % SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) % For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. OBJECTIVE_FUNCTION= DRAG @@ -1256,7 +1256,7 @@ ADAPT_BOUNDARY= YES % Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, % FFD_SETTING, FFD_NACELLE, % FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, % FFD_TWIST_2D, HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE) DV_KIND= FFD_SETTING % @@ -1319,6 +1319,7 @@ DEFORM_MESH= YES % % Moving markers which deform the mesh MARKER_DEFORM_MESH = ( airfoil ) +MARKER_DEFORM_MESH_SYM_PLANE = ( wall ) % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % @@ -1477,14 +1478,14 @@ VOLUME_OUTPUT= (COORDINATES, SOLUTION, PRIMITIVE) SCREEN_WRT_FREQ_INNER= 1 % SCREEN_WRT_FREQ_OUTER= 1 -% +% SCREEN_WRT_FREQ_TIME= 1 % % Writing frequency for history output HISTORY_WRT_FREQ_INNER= 1 % HISTORY_WRT_FREQ_OUTER= 1 -% +% HISTORY_WRT_FREQ_TIME= 1 % % Writing frequency for volume/surface output @@ -1510,9 +1511,9 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Output tabular file format (TECPLOT, CSV) TABULAR_FORMAT= TECPLOT % -% Files to output +% Files to output % Possible formats : (TECPLOT, TECPLOT_BINARY, SURFACE_TECPLOT, -% SURFACE_TECPLOT_BINARY, CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_BINARY, SURFACE_PARAVIEW, +% SURFACE_TECPLOT_BINARY, CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_BINARY, SURFACE_PARAVIEW, % SURFACE_PARAVIEW_BINARY, MESH, RESTART_BINARY, RESTART_ASCII, CGNS, STL) % default : (RESTART, PARAVIEW, SURFACE_PARAVIEW) OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) @@ -1556,7 +1557,7 @@ REORIENT_ELEMENTS= YES % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions -% DRAG, LIFT, SIDEFORCE, EFFICIENCY, BUFFET, +% DRAG, LIFT, SIDEFORCE, EFFICIENCY, BUFFET, % FORCE_X, FORCE_Y, FORCE_Z, % MOMENT_X, MOMENT_Y, MOMENT_Z, % THRUST, TORQUE, FIGURE_OF_MERIT, From defcfe7721ebba5e56e19e43a2c35f43c2eafcf4 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 25 Jan 2021 15:32:51 +0100 Subject: [PATCH 164/326] Fixed restart and applied defaults --- SU2_PY/FSI_tools/FSIInterface.py | 4 ---- SU2_PY/FSI_tools/FSI_config.py | 6 ++++++ SU2_PY/SU2_Nastran/pysu2_nastran.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 9c18eb3e3473..d3d10cc58191 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1924,10 +1924,6 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): #If restart if FSI_config['RESTART_SOL'] == 'YES': TimeIterTreshold = -1 - self.MPIPrint("Reading the modal amplitudes at time n-1") - if myid in self.solidSolverProcessors: - SolidSolver.setRestart('nM1') - SolidSolver.setRestart('n') self.getSolidInterfaceDisplacement(SolidSolver) self.displacementPredictor(FSI_config, SolidSolver, deltaT) # We need now to update the solution because both restarter functions (solid and fluid) diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index f41374a4cadd..f9bba78037d5 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -56,6 +56,7 @@ def __init__(self,FileName): self.ConfigFileName = FileName self._ConfigContent = {} self.readConfig() + self.applyDefaults() def __str__(self): tempString = str() @@ -119,3 +120,8 @@ def readConfig(self): if case(): print(this_param + " is an invalid option !") break + + def applyDefaults(self): + if self._ConfigContent["CSD_SOLVER"] == "IMPOSED": + self._ConfigContent["AITKEN_RELAX"] = "STATIC" + self._ConfigContent["AITKEN_PARAM"] = 1.0 diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 36f7ab87d5ef..99fcf8cfc583 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -309,6 +309,9 @@ def __init__(self, config_fileName, ImposedMotion): header = header + '\n' histFile.write(header) histFile.close() + else: + self.__setRestart('nM1') + self.__setRestart('n') def __readConfig(self): """ @@ -840,7 +843,7 @@ def setInitialDisplacements(self): self.__computeInterfacePosVel(True) - def setRestart(self, timeIter): + def __setRestart(self, timeIter): if timeIter == 'nM1': #read the Structhistory to obtain the mode amplitudes with open('StructHistoryModal.dat','r') as file: From f3c2ef6c5b1bf8d331e22d7a2a4604bcda320405 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 25 Jan 2021 15:48:16 +0100 Subject: [PATCH 165/326] Grid velocities for compressible case output --- SU2_CFD/src/output/CFlowCompOutput.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index c3f823ee1cbf..e07c53d3eb6e 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -58,7 +58,7 @@ CFlowCompOutput::CFlowCompOutput(CConfig *config, unsigned short nDim) : CFlowOu requestedVolumeFields.emplace_back("COORDINATES"); requestedVolumeFields.emplace_back("SOLUTION"); requestedVolumeFields.emplace_back("PRIMITIVE"); - if (config->GetGrid_Movement()) requestedVolumeFields.emplace_back("GRID_VELOCITY"); + if (config->GetDynamic_Grid()) requestedVolumeFields.emplace_back("GRID_VELOCITY"); nRequestedVolumeFields = requestedVolumeFields.size(); } @@ -315,7 +315,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ } // Grid velocity - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); if (nDim == 3 ) @@ -469,7 +469,7 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv break; } - if (config->GetGrid_Movement()){ + if (config->GetDynamic_Grid()){ SetVolumeOutputValue("GRID_VELOCITY-X", iPoint, Node_Geo->GetGridVel(iPoint)[0]); SetVolumeOutputValue("GRID_VELOCITY-Y", iPoint, Node_Geo->GetGridVel(iPoint)[1]); if (nDim == 3) From 813ff067f109a874e8336f5e852aaab0f2cdff0b Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 25 Jan 2021 16:52:25 +0000 Subject: [PATCH 166/326] option to consider only the surface of a reference geometry --- Common/include/CConfig.hpp | 12 +++++--- Common/src/CConfig.cpp | 6 ++-- SU2_CFD/include/variables/CFEAVariable.hpp | 9 +----- SU2_CFD/include/variables/CVariable.hpp | 7 +---- SU2_CFD/src/solvers/CFEASolver.cpp | 32 +++++++++++++--------- TestCases/disc_adj_fea/configAD_fem.cfg | 4 ++- TestCases/disc_adj_fsi/configFEA.cfg | 2 ++ 7 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3985d25e88ab..3aa76c0faa40 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -849,7 +849,7 @@ class CConfig { su2double Knowles_B, /*!< \brief Knowles material model constant B. */ Knowles_N; /*!< \brief Knowles material model constant N. */ bool DE_Effects; /*!< Application of DE effects to FE analysis */ - bool RefGeom; /*!< Read a reference geometry for optimization purposes. */ + bool RefGeom, RefGeomSurf; /*!< Read a reference geometry for optimization purposes. */ unsigned long refNodeID; /*!< \brief Global ID for the reference node (optimization). */ string RefGeom_FEMFileName; /*!< \brief File name for reference geometry. */ unsigned short RefGeom_FileFormat; /*!< \brief Mesh input format. */ @@ -2045,11 +2045,15 @@ class CConfig { su2double GetRefNode_Penalty(void) const { return RefNode_Penalty; } /*! - * \brief Decide whether it's necessary to read a reference geometry. - * \return TRUE if it's necessary to read a reference geometry, FALSE otherwise. - */ + * \brief Decide whether it's necessary to read a reference geometry. + */ bool GetRefGeom(void) const { return RefGeom; } + /*! + * \brief Consider only the surface of the reference geometry. + */ + bool GetRefGeomSurf(void) const { return RefGeomSurf; } + /*! * \brief Get the name of the file with the reference geometry of the structural problem. * \return Name of the file with the reference geometry of the structural problem. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 5d28ae540a90..45bc96adf6d6 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2237,10 +2237,12 @@ void CConfig::SetConfig_Options() { addBoolOption("REFERENCE_GEOMETRY", RefGeom, false); /*!\brief REFERENCE_GEOMETRY_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_GEOMETRY_PENALTY", RefGeom_Penalty, 1E6); - /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart structure input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n Default: solution_flow.dat \ingroup Config */ + /*!\brief REFERENCE_GEOMETRY_FILENAME \n DESCRIPTION: Reference geometry filename \n Default: reference_geometry.dat \ingroup Config */ addStringOption("REFERENCE_GEOMETRY_FILENAME", RefGeom_FEMFileName, string("reference_geometry.dat")); - /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Reference geometry format \n DEFAULT: SU2 \ingroup Config*/ addEnumOption("REFERENCE_GEOMETRY_FORMAT", RefGeom_FileFormat, Input_Ref_Map, SU2_REF); + /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. \ingroup Config*/ + addBoolOption("REFERENCE_GEOMETRY_SURFACE", RefGeomSurf, false); /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ addDoubleOption("TOTAL_DV_PENALTY", DV_Penalty, 0); diff --git a/SU2_CFD/include/variables/CFEAVariable.hpp b/SU2_CFD/include/variables/CFEAVariable.hpp index c5890fad7b37..a400e09ff3a7 100644 --- a/SU2_CFD/include/variables/CFEAVariable.hpp +++ b/SU2_CFD/include/variables/CFEAVariable.hpp @@ -367,14 +367,7 @@ class CFEAVariable : public CVariable { /*! * \brief Get the pointer to the reference geometry */ - inline su2double *GetReference_Geometry(unsigned long iPoint) final { return Reference_Geometry[iPoint]; } - - /*! - * \brief Get the value of the reference geometry for the coordinate iVar - */ - inline su2double GetReference_Geometry(unsigned long iPoint, unsigned long iVar) const final { - return Reference_Geometry(iPoint,iVar); - } + inline const su2double* GetReference_Geometry(unsigned long iPoint) const final { return Reference_Geometry[iPoint]; } /*! * \brief Register the variables in the solution time_n array as input/output variable. diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 4accd4ee4580..33295cccf535 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2308,7 +2308,7 @@ class CVariable { /*! * \brief A virtual member. */ - inline virtual su2double *GetReference_Geometry(unsigned long iPoint) {return nullptr; } + inline virtual const su2double* GetReference_Geometry(unsigned long iPoint) const { return nullptr; } /*! * \brief A virtual member. @@ -2325,11 +2325,6 @@ class CVariable { */ inline virtual su2double GetPrestretch(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! - * \brief A virtual member. - */ - inline virtual su2double GetReference_Geometry(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! * \brief A virtual member. Get the value of the undeformed coordinates. * \param[in] iDim - Index of Mesh_Coord[nDim] diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index c25fcd582ebd..8e22242e3999 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2986,19 +2986,25 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ { su2double obj_fun_local = 0.0; - SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - - /*--- Retrieve the value of the reference geometry ---*/ - su2double reference_geometry = nodes->GetReference_Geometry(iPoint,iVar); - - /*--- Retrieve the value of the current solution ---*/ - su2double current_solution = nodes->GetSolution(iPoint,iVar); - - /*--- The objective function is the sum of the difference between solution and difference, squared ---*/ - obj_fun_local += pow(current_solution - reference_geometry, 2); + if (!config->GetRefGeomSurf()) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + obj_fun_local += SquaredDistance(nVar, nodes->GetReference_Geometry(iPoint), nodes->GetSolution(iPoint)); + } + } + else { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == LOAD_BOUNDARY) || + (config->GetMarker_All_KindBC(iMarker) == LOAD_DIR_BOUNDARY) || + (config->GetMarker_All_KindBC(iMarker) == FLOWLOAD_BOUNDARY)) { + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (unsigned long iVertex = 0; iVertex < geometry->GetnVertex(iMarker); ++iVertex) { + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->nodes->GetDomain(iPoint)) + obj_fun_local += SquaredDistance(nVar, nodes->GetReference_Geometry(iPoint), nodes->GetSolution(iPoint)); + } + } } } atomicAdd(obj_fun_local, objective_function); diff --git a/TestCases/disc_adj_fea/configAD_fem.cfg b/TestCases/disc_adj_fea/configAD_fem.cfg index 2877dfcbf041..b6e96e135901 100644 --- a/TestCases/disc_adj_fea/configAD_fem.cfg +++ b/TestCases/disc_adj_fea/configAD_fem.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.0 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY @@ -22,6 +22,8 @@ REFERENCE_GEOMETRY = YES REFERENCE_GEOMETRY_FILENAME = reference_geometry.dat REFERENCE_GEOMETRY_FORMAT = SU2 REFERENCE_GEOMETRY_PENALTY = 1E6 +% Consider only the surface +REFERENCE_GEOMETRY_SURFACE = NO READ_BINARY_RESTART=NO diff --git a/TestCases/disc_adj_fsi/configFEA.cfg b/TestCases/disc_adj_fsi/configFEA.cfg index 15d744400f95..a06a39fac287 100644 --- a/TestCases/disc_adj_fsi/configFEA.cfg +++ b/TestCases/disc_adj_fsi/configFEA.cfg @@ -24,6 +24,8 @@ ELECTRIC_FIELD_MOD = 20E5 REFERENCE_GEOMETRY = YES REFERENCE_GEOMETRY_FILENAME = reference_geometry.dat REFERENCE_GEOMETRY_FORMAT = SU2 +% Consider only the surface +REFERENCE_GEOMETRY_SURFACE = NO READ_BINARY_RESTART=NO From 72f1ff6082d5c197f3759ee6f7e655697d1fde0d Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 25 Jan 2021 21:58:25 +0100 Subject: [PATCH 167/326] Better handling of multiple imposed motions --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 99fcf8cfc583..d3a82503448f 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -285,7 +285,7 @@ def __init__(self, config_fileName, ImposedMotion): self.markers = {} self.refsystems = [] self.ImposedMotionToSet = True - self.ImposedMotionFunction = [] + self.ImposedMotionFunction = {} print("\n") print(" Reading the mesh ".center(80,"-")) @@ -765,10 +765,11 @@ def __temporalIteration(self,time): self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot else: - for imode in self.Config["IMPOSED_MODES"].keys(): - if self.ImposedMotionToSet: - self.ImposedMotionFunction.append(ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode])) + if self.ImposedMotionToSet: + for imode in self.Config["IMPOSED_MODES"].keys(): + self.ImposedMotionFunction[imode] = ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode]) self.ImposedMotionToSet = False + for imode in self.Config["IMPOSED_MODES"].keys(): self.q[imode] = self.ImposedMotionFunction[imode].GetDispl(time) self.qdot[imode] = self.ImposedMotionFunction[imode].GetVel(time) self.qddot[imode] = self.ImposedMotionFunction[imode].GetAcc(time) From 3fafae77a447c07a9ae5582eec5ad84ef115f3b9 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 26 Jan 2021 13:02:33 +0100 Subject: [PATCH 168/326] Add OUTPUT_PRECISION config option for history and SU2_DOT for gradient validation. --- Common/include/CConfig.hpp | 7 +++++++ Common/src/CConfig.cpp | 2 ++ SU2_CFD/src/output/COutput.cpp | 2 +- SU2_DOT/src/SU2_DOT.cpp | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c642dad7cdc3..ca2917f110ac 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -732,6 +732,7 @@ class CConfig { unsigned short Geo_Description; /*!< \brief Description of the geometry. */ unsigned short Mesh_FileFormat; /*!< \brief Mesh input format. */ unsigned short Tab_FileFormat; /*!< \brief Format of the output files. */ + unsigned short output_precision; /*!< \brief .precision(value) for SU2_DOT and HISTORY output */ unsigned short ActDisk_Jump; /*!< \brief Format of the output files. */ unsigned long StartWindowIteration; /*!< \brief Starting Iteration for long time Windowing apporach . */ unsigned short nCFL_AdaptParam; /*!< \brief Number of CFL parameters provided in config. */ @@ -5226,6 +5227,12 @@ class CConfig { */ unsigned short GetTabular_FileFormat(void) const { return Tab_FileFormat; } + /*! + * \brief Get the output precision to be used in .precision(value). + * \return Output precision. + */ + unsigned short GetOutput_Precision(void) const { return output_precision; } + /*! * \brief Get the format of the output solution. * \return Format of the output solution. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index e1e12398b5bd..d287796db100 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1950,6 +1950,8 @@ void CConfig::SetConfig_Options() { /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_CSV); + /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. */ + addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 6); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 541489766c0c..9d849e47a470 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1253,7 +1253,7 @@ void COutput::PrepareHistoryFile(CConfig *config){ historyFileTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); historyFileTable->SetPrintHeaderTopLine(false); historyFileTable->SetPrintHeaderBottomLine(false); - historyFileTable->SetPrecision(10); + historyFileTable->SetPrecision(config->GetOutput_Precision()); /*--- Add the header to the history file. ---*/ diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 25774cef706a..bac4d2f7fe83 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -292,6 +292,7 @@ int main(int argc, char *argv[]) { } ofstream Gradient_file; + Gradient_file.precision(config_container[ZONE_0]->GetOutput_Precision()); /*--- For multizone computations the gradient contributions are summed up and written into one file. ---*/ for (iZone = 0; iZone < nZone; iZone++){ From 3aa4b12e73f0eb1d39b3a0eaa42c5f299c936ae3 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 26 Jan 2021 13:03:35 +0100 Subject: [PATCH 169/326] Remove temp py output for finite differences --- SU2_PY/SU2/eval/functions.py | 2 -- SU2_PY/SU2/io/tools.py | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/SU2_PY/SU2/eval/functions.py b/SU2_PY/SU2/eval/functions.py index 9f850698f6d2..b501159da884 100644 --- a/SU2_PY/SU2/eval/functions.py +++ b/SU2_PY/SU2/eval/functions.py @@ -316,8 +316,6 @@ def aerodynamics( config, state=None ): for key in state['FUNCTIONS']: funcs[key] = state['FUNCTIONS'][key] - print('funcs output') - print(funcs) return funcs #: def aerodynamics() diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index 370f4ed98c15..9201256340c8 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -162,8 +162,7 @@ def read_history( History_filename, nZones = 1): var = field + '[' + key.split('[')[1] history_data[var] = plot_data[key] - print('history_data output') - print(history_data) + return history_data #: def read_history() From 256ecc528221f00b214eda25d379eeb793a33f49 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 26 Jan 2021 13:04:32 +0100 Subject: [PATCH 170/326] Little loop changes --- SU2_CFD/src/solvers/CIncNSSolver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index c4fbab010b8e..415030861133 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -119,7 +119,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); /*--- Compute recoverd pressure and temperature for all points ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++) { + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; @@ -258,7 +258,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); norm2_translation = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0u; iDim < nDim; iDim++) { norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); } } @@ -343,7 +343,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Dot product ---*/ dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0u; iDim < nDim; iDim++) { dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; } From 665681f7d1d5bf40a881dd2959c18b767f757223 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 26 Jan 2021 14:20:05 +0100 Subject: [PATCH 171/326] little change for output precision --- SU2_CFD/src/output/COutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 9d849e47a470..84d739ee2a96 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1253,7 +1253,7 @@ void COutput::PrepareHistoryFile(CConfig *config){ historyFileTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); historyFileTable->SetPrintHeaderTopLine(false); historyFileTable->SetPrintHeaderBottomLine(false); - historyFileTable->SetPrecision(config->GetOutput_Precision()); + historyFileTable->SetPrecision(config->OptionIsSet("OUTPUT_PRECISION") ? config->GetOutput_Precision() : 10); /*--- Add the header to the history file. ---*/ From 89e0fb831401180123f00c4728fc5172d62a0b9a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 26 Jan 2021 15:39:16 +0100 Subject: [PATCH 172/326] Fix error due to merge. Changes in CIncEulerSolver::Preprocessing --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 5a19a30914ea..0851949c96b4 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -940,8 +940,10 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); /*--- Compute integrated Heatflux and massflow, TK:: Euler equations not implemented yet, probalby wasted here ---*/ - if(rank==MASTER_NODE) cout << "EulerPrepsocessing GetStreamwise_Periodic_Properties." << endl; - if (config->GetKind_Streamwise_Periodic()) GetStreamwise_Periodic_Properties(geometry, config, iMesh); + if (config->GetKind_Streamwise_Periodic()) { + if(rank==MASTER_NODE) cout << "EulerPrepsocessing GetStreamwise_Periodic_Properties." << endl; + GetStreamwise_Periodic_Properties(geometry, config, iMesh); + } /*--- Initialize the Jacobian matrix and residual, not needed for the reducer strategy * as we set blocks (including diagonal ones) and completely overwrite. ---*/ @@ -1293,10 +1295,6 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); - /*--- Initialize the source residual to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; - if (streamwise_periodic) { /*--- Loop over all points ---*/ From 30b255448b0664ac6dc9ae2e33766ee48a7c33a6 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 26 Jan 2021 22:20:42 +0000 Subject: [PATCH 173/326] simplify a few things --- SU2_CFD/src/solvers/CFEASolver.cpp | 204 ++++++----------------------- 1 file changed, 40 insertions(+), 164 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 8e22242e3999..84893bf9f96b 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -337,23 +337,16 @@ void CFEASolver::HybridParallelInitialization(CGeometry* geometry) { void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { - unsigned long iElem; - unsigned long index; - unsigned long elProperties[4]; + const auto iZone = config->GetiZone(); + const auto nZone = geometry->GetnZone(); - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); - - bool topology_mode = config->GetTopology_Optimization(); - - string filename; - ifstream properties_file; + const bool topology_mode = config->GetTopology_Optimization(); element_properties = new CProperty*[nElement]; /*--- Restart the solution from file information ---*/ - filename = config->GetFEA_FileName(); + auto filename = config->GetFEA_FileName(); /*--- If multizone, append zone name ---*/ if (nZone > 1) @@ -361,7 +354,8 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { if (rank == MASTER_NODE) cout << "Filename: " << filename << "." << endl; - properties_file.open(filename.data(), ios::in); + ifstream properties_file; + properties_file.open(filename); /*--- In case there is no file, all elements get the same property (0) ---*/ @@ -374,7 +368,7 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { SU2_MPI::Error("Topology mode requires an element-based properties file.",CURRENT_FUNCTION); } - for (iElem = 0; iElem < nElement; iElem++){ + for (auto iElem = 0ul; iElem < nElement; iElem++){ element_properties[iElem] = new CElementProperty(FEA_TERM, 0, 0, 0); } @@ -385,24 +379,15 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { element_based = true; - /*--- In case this is a parallel simulation, we need to perform the - Global2Local index transformation first. ---*/ + /*--- In case this is a parallel simulation, we need to perform the Global2Local index transformation first. ---*/ - long *Global2Local = new long[geometry->GetGlobal_nElemDomain()]; + unordered_map Global2Local; - /*--- First, set all indices to a negative value by default ---*/ - - for (iElem = 0; iElem < geometry->GetGlobal_nElemDomain(); iElem++) - Global2Local[iElem] = -1; - - /*--- Now fill array with the transform values only for the points in the rank (including halos) ---*/ - - for (iElem = 0; iElem < nElement; iElem++) + for (auto iElem = 0ul; iElem < nElement; iElem++) Global2Local[geometry->elem[iElem]->GetGlobalIndex()] = iElem; /*--- Read all lines in the restart file ---*/ - long iElem_Local; unsigned long iElem_Global_Local = 0, iElem_Global = 0; string text_line; /*--- The first line is the header ---*/ @@ -420,9 +405,13 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { Otherwise, the local index for this node on the current processor will be returned and used to instantiate the vars. ---*/ - iElem_Local = Global2Local[iElem_Global]; + auto it = Global2Local.find(iElem_Global); + + if (it != Global2Local.end()) { - if (iElem_Local >= 0) { + auto iElem_Local = it->second; + + unsigned long elProperties[4], index; if (config->GetAdvanced_FEAElementBased() || topology_mode){ point_line >> index >> elProperties[0] >> elProperties[1] >> elProperties[2] >> elProperties[3]; @@ -454,34 +443,18 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); } - /*--- Close the restart file ---*/ - - properties_file.close(); - - /*--- Free memory needed for the transformation ---*/ - - delete [] Global2Local; - } } void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { - unsigned long iPoint; - unsigned long index; - - unsigned short iVar; - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); - - string filename; - ifstream prestretch_file; - + const auto iZone = config->GetiZone(); + const auto nZone = geometry->GetnZone(); /*--- Restart the solution from file information ---*/ - filename = config->GetPrestretch_FEMFileName(); + auto filename = config->GetPrestretch_FEMFileName(); /*--- If multizone, append zone name ---*/ if (nZone > 1) @@ -489,7 +462,8 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { if (rank == MASTER_NODE) cout << "Filename: " << filename << "." << endl; - prestretch_file.open(filename.data(), ios::in); + ifstream prestretch_file; + prestretch_file.open(filename); /*--- In case there is no file ---*/ @@ -497,20 +471,15 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { SU2_MPI::Error(string("There is no FEM prestretch reference file ") + filename, CURRENT_FUNCTION); } - /*--- In case this is a parallel simulation, we need to perform the - Global2Local index transformation first. ---*/ - - map Global2Local; - map::const_iterator MI; + /*--- Make a global to local map that also covers halo nodes (the one in geometry does not). ---*/ - /*--- Now fill array with the transform values only for local points ---*/ + unordered_map Global2Local; - for (iPoint = 0; iPoint < nPointDomain; iPoint++) + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) Global2Local[geometry->nodes->GetGlobalIndex(iPoint)] = iPoint; /*--- Read all lines in the restart file ---*/ - long iPoint_Local; unsigned long iPoint_Global_Local = 0, iPoint_Global = 0; string text_line; /*--- The first line is the header ---*/ @@ -523,17 +492,20 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ - MI = Global2Local.find(iPoint_Global); - if (MI != Global2Local.end()) { + auto it = Global2Local.find(iPoint_Global); + + if (it != Global2Local.end()) { - iPoint_Local = Global2Local[iPoint_Global]; + auto iPoint_Local = it->second; su2double Sol[MAXNVAR] = {0.0}; + unsigned long index; if (nDim == 2) point_line >> Sol[0] >> Sol[1] >> index; if (nDim == 3) point_line >> Sol[0] >> Sol[1] >> Sol[2] >> index; - for (iVar = 0; iVar < nVar; iVar++) nodes->SetPrestretch(iPoint_Local,iVar, Sol[iVar]); + for (unsigned short iVar = 0; iVar < nVar; iVar++) + nodes->SetPrestretch(iPoint_Local, iVar, Sol[iVar]); iPoint_Global_Local++; } @@ -542,99 +514,28 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { /*--- Detect a wrong solution file ---*/ - if (iPoint_Global_Local != nPointDomain) { + if (iPoint_Global_Local != nPoint) { SU2_MPI::Error(string("The solution file ") + filename + string(" doesn't match with the mesh file!\n") + string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); } - /*--- Close the restart file ---*/ - - prestretch_file.close(); - -#ifdef HAVE_MPI - /*--- We need to communicate here the prestretched geometry for the halo nodes. ---*/ - /*--- We avoid creating a new function as this may be reformatted. ---*/ - - unsigned short iMarker, MarkerS, MarkerR; - unsigned long iVertex, nVertexS, nVertexR, nBufferS_Vector, nBufferR_Vector; - su2double *Buffer_Receive_U = nullptr, *Buffer_Send_U = nullptr; - - int send_to, receive_from; - - for (iMarker = 0; iMarker < nMarker; iMarker++) { - - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) { - - MarkerS = iMarker; MarkerR = iMarker+1; - - send_to = config->GetMarker_All_SendRecv(MarkerS)-1; - receive_from = abs(config->GetMarker_All_SendRecv(MarkerR))-1; - - nVertexS = geometry->nVertex[MarkerS]; nVertexR = geometry->nVertex[MarkerR]; - nBufferS_Vector = nVertexS*nVar; nBufferR_Vector = nVertexR*nVar; - - /*--- Allocate Receive and send buffers ---*/ - Buffer_Receive_U = new su2double [nBufferR_Vector]; - Buffer_Send_U = new su2double[nBufferS_Vector]; - - /*--- Copy the solution that should be sent ---*/ - for (iVertex = 0; iVertex < nVertexS; iVertex++) { - iPoint = geometry->vertex[MarkerS][iVertex]->GetNode(); - for (iVar = 0; iVar < nVar; iVar++) - Buffer_Send_U[iVar*nVertexS+iVertex] = nodes->GetPrestretch(iPoint,iVar); - } - - /*--- Send/Receive information using Sendrecv ---*/ - SU2_MPI::Sendrecv(Buffer_Send_U, nBufferS_Vector, MPI_DOUBLE, send_to, 0, - Buffer_Receive_U, nBufferR_Vector, MPI_DOUBLE, receive_from, 0, MPI_COMM_WORLD, nullptr); - - /*--- Deallocate send buffer ---*/ - delete [] Buffer_Send_U; - - /*--- Do the coordinate transformation ---*/ - for (iVertex = 0; iVertex < nVertexR; iVertex++) { - - /*--- Find point and its type of transformation ---*/ - iPoint = geometry->vertex[MarkerR][iVertex]->GetNode(); - - /*--- Store received values back into the variable. ---*/ - for (iVar = 0; iVar < nVar; iVar++) - nodes->SetPrestretch(iPoint, iVar, Buffer_Receive_U[iVar*nVertexR+iVertex]); - - } - - /*--- Deallocate receive buffer ---*/ - delete [] Buffer_Receive_U; - - } - - } -#endif - } void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { - unsigned long iPoint; - - unsigned short iVar; - unsigned short iZone = config->GetiZone(); - unsigned short file_format = config->GetRefGeom_FileFormat(); - - string filename; - ifstream reference_file; - + const auto iZone = config->GetiZone(); + const auto file_format = config->GetRefGeom_FileFormat(); /*--- Restart the solution from file information ---*/ - filename = config->GetRefGeom_FEMFileName(); + auto filename = config->GetRefGeom_FEMFileName(); /*--- If multizone, append zone name ---*/ filename = config->GetMultizone_FileName(filename, iZone, ".csv"); - reference_file.open(filename.data(), ios::in); + ifstream reference_file; + reference_file.open(filename); /*--- In case there is no file ---*/ @@ -644,24 +545,8 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { if (rank == MASTER_NODE) cout << "Filename: " << filename << " and format " << file_format << "." << endl; - /*--- In case this is a parallel simulation, we need to perform the - Global2Local index transformation first. ---*/ - - long *Global2Local = new long[geometry->GetGlobal_nPointDomain()]; - - /*--- First, set all indices to a negative value by default ---*/ - - for (iPoint = 0; iPoint < geometry->GetGlobal_nPointDomain(); iPoint++) - Global2Local[iPoint] = -1; - - /*--- Now fill array with the transform values only for local points ---*/ - - for (iPoint = 0; iPoint < nPointDomain; iPoint++) - Global2Local[geometry->nodes->GetGlobalIndex(iPoint)] = iPoint; - /*--- Read all lines in the restart file ---*/ - long iPoint_Local; unsigned long iPoint_Global_Local = 0, iPoint_Global = 0; string text_line; /*--- The first line is the header ---*/ @@ -677,7 +562,7 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { Otherwise, the local index for this node on the current processor will be returned and used to instantiate the vars. ---*/ - iPoint_Local = Global2Local[iPoint_Global]; + auto iPoint_Local = geometry->GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local >= 0) { @@ -692,7 +577,7 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { Sol[2] = PrintingToolbox::stod(point_line[6]); } - for (iVar = 0; iVar < nVar; iVar++) + for (unsigned short iVar = 0; iVar < nVar; iVar++) nodes->SetReference_Geometry(iPoint_Local, iVar, Sol[iVar]); iPoint_Global_Local++; @@ -707,14 +592,6 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); } - /*--- Close the restart file ---*/ - - reference_file.close(); - - /*--- Free memory needed for the transformation ---*/ - - delete [] Global2Local; - } void CFEASolver::Set_VertexEliminationSchedule(CGeometry *geometry, const vector& markers) { @@ -3387,9 +3264,8 @@ void CFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config) if (rank == MASTER_NODE) { string filename = config->GetTopology_Optim_FileName(); ofstream file; - file.open(filename.c_str()); + file.open(filename); for(iElem=0; iElem Date: Tue, 26 Jan 2021 22:59:28 +0000 Subject: [PATCH 174/326] fix #1175 --- .../include/solvers/CFEM_DG_EulerSolver.hpp | 6 ++ .../include/solvers/CFVMFlowSolverBase.hpp | 7 ++ .../include/solvers/CFVMFlowSolverBase.inl | 92 ++----------------- SU2_CFD/include/solvers/CSolver.hpp | 5 + SU2_CFD/src/output/CFlowOutput.cpp | 24 +---- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 3 +- SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp | 26 +----- 7 files changed, 33 insertions(+), 130 deletions(-) diff --git a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp index bff89172fe9d..0ce24a053d09 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp @@ -92,6 +92,7 @@ class CFEM_DG_EulerSolver : public CSolver { AllBound_CEff_Inv; /*!< \brief Total efficiency (Cl/Cd) (inviscid contribution) for all the boundaries. */ su2double + AeroCoeffForceRef, /*!< \brief Reference force for coefficients */ Total_CL, /*!< \brief Total lift coefficient for all the boundaries. */ Total_CD, /*!< \brief Total drag coefficient for all the boundaries. */ Total_CSF, /*!< \brief Total sideforce coefficient for all the boundaries. */ @@ -1127,6 +1128,11 @@ class CFEM_DG_EulerSolver : public CSolver { */ inline void SetTotal_CL(su2double val_Total_CL) final { Total_CL = val_Total_CL; } + /*! + * \brief Get the reference force used to compute CL, CD, etc. + */ + inline su2double GetAeroCoeffsReferenceForce() const final { return AeroCoeffForceRef; } + /*! * \brief Provide the total (inviscid + viscous) non dimensional lift coefficient. * \return Value of the lift coefficient (inviscid + viscous contribution). diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index e55ea0509ca8..eda991d774d4 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -125,6 +125,8 @@ class CFVMFlowSolverBase : public CSolver { AeroCoeffsArray SurfaceCoeff; /*!< \brief Totals for each monitoring surface. */ AeroCoeffs TotalCoeff; /*!< \brief Totals for all boundaries. */ + su2double AeroCoeffForceRef = 1.0; /*!< \brief Reference force for aerodynamic coefficients. */ + su2double InverseDesign = 0.0; /*!< \brief Inverse design functional for each boundary. */ su2double Total_ComboObj = 0.0; /*!< \brief Total 'combo' objective for all monitored boundaries */ su2double Total_Custom_ObjFunc = 0.0; /*!< \brief Total custom objective function for all the boundaries. */ @@ -1559,6 +1561,11 @@ class CFVMFlowSolverBase : public CSolver { */ inline su2double GetTotal_CEff() const final { return TotalCoeff.CEff; } + /*! + * \brief Get the reference force used to compute CL, CD, etc. + */ + inline su2double GetAeroCoeffsReferenceForce() const final { return AeroCoeffForceRef; } + /*! * \brief Provide the total (inviscid + viscous) non dimensional lift coefficient. * \return Value of the lift coefficient (inviscid + viscous contribution). diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index dfa2522e16ab..531eb3f94859 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1632,7 +1632,8 @@ void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometr } } - factor = 1.0 / (0.5 * RefDensity * RefArea * RefVel2); + AeroCoeffForceRef = 0.5 * RefDensity * RefArea * RefVel2; + factor = 1.0 / AeroCoeffForceRef; /*--- Reference pressure is always the far-field value. ---*/ @@ -1938,57 +1939,18 @@ template void CFVMFlowSolverBase::Momentum_Forces(const CGeometry* geometry, const CConfig* config) { unsigned long iVertex, iPoint; unsigned short iDim, iMarker, Boundary, Monitoring, iMarker_Monitoring; - su2double factor, RefVel2 = 0.0, RefTemp, RefDensity = 0.0, Mach2Vel, Mach_Motion, MassFlow, Density; + su2double MassFlow, Density; const su2double *Normal = nullptr, *Coord = nullptr; string Marker_Tag, Monitoring_Tag; su2double AxiFactor; su2double Alpha = config->GetAoA() * PI_NUMBER / 180.0; su2double Beta = config->GetAoS() * PI_NUMBER / 180.0; - su2double RefArea = config->GetRefArea(); su2double RefLength = config->GetRefLength(); - su2double Gas_Constant = config->GetGas_ConstantND(); auto Origin = config->GetRefOriginMoment(0); bool axisymmetric = config->GetAxisymmetric(); - /// TODO: Move these ifs to specialized functions. - - if (FlowRegime == COMPRESSIBLE) { - /*--- Evaluate reference values for non-dimensionalization. - For dynamic meshes, use the motion Mach number as a reference value - for computing the force coefficients. Otherwise, use the freestream values, - which is the standard convention. ---*/ - - RefTemp = Temperature_Inf; - RefDensity = Density_Inf; - if (dynamic_grid) { - Mach2Vel = sqrt(Gamma * Gas_Constant * RefTemp); - Mach_Motion = config->GetMach_Motion(); - RefVel2 = (Mach_Motion * Mach2Vel) * (Mach_Motion * Mach2Vel); - } else { - RefVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim] * Velocity_Inf[iDim]; - } - } - - if (FlowRegime == INCOMPRESSIBLE) { - /*--- Evaluate reference values for non-dimensionalization. - For dimensional or non-dim based on initial values, use - the far-field state (inf). For a custom non-dim based - on user-provided reference values, use the ref values - to compute the forces. ---*/ - - if ((config->GetRef_Inc_NonDim() == DIMENSIONAL) || (config->GetRef_Inc_NonDim() == INITIAL_VALUES)) { - RefDensity = Density_Inf; - RefVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim] * Velocity_Inf[iDim]; - } else if (config->GetRef_Inc_NonDim() == REFERENCE_VALUES) { - RefDensity = config->GetInc_Density_Ref(); - RefVel2 = config->GetInc_Velocity_Ref() * config->GetInc_Velocity_Ref(); - } - } - - factor = 1.0 / (0.5 * RefDensity * RefArea * RefVel2); + const su2double factor = 1.0 / AeroCoeffForceRef; /*-- Variables initialization ---*/ @@ -2263,8 +2225,8 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr unsigned long iVertex, iPoint, iPointNormal; unsigned short iMarker, iMarker_Monitoring, iDim, jDim; unsigned short T_INDEX = 0, TVE_INDEX = 0, VEL_INDEX = 0; - su2double Viscosity = 0.0, WallDist[3] = {0.0}, Area, TauNormal, RefTemp, RefVel2 = 0.0, dTn, dTven, - RefDensity = 0.0, GradTemperature, Density = 0.0, WallDistMod, FrictionVel, Mach2Vel, Mach_Motion, + su2double Viscosity = 0.0, WallDist[3] = {0.0}, Area, TauNormal, RefVel2 = 0.0, dTn, dTven, + RefDensity = 0.0, GradTemperature, Density = 0.0, WallDistMod, FrictionVel, UnitNormal[3] = {0.0}, TauElem[3] = {0.0}, TauTangent[3] = {0.0}, Tau[3][3] = {{0.0}}, Cp, thermal_conductivity, MaxNorm = 8.0, Grad_Vel[3][3] = {{0.0}}, Grad_Temp[3] = {0.0}, AxiFactor; const su2double *Coord = nullptr, *Coord_Normal = nullptr, *Normal = nullptr; @@ -2273,7 +2235,6 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr su2double Alpha = config->GetAoA() * PI_NUMBER / 180.0; su2double Beta = config->GetAoS() * PI_NUMBER / 180.0; - su2double RefArea = config->GetRefArea(); su2double RefLength = config->GetRefLength(); su2double RefHeatFlux = config->GetHeat_Flux_Ref(); su2double Gas_Constant = config->GetGas_ConstantND(); @@ -2294,44 +2255,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr VEL_INDEX = nSpecies+2; } - /// TODO: Move these ifs to specialized functions. - - if (FlowRegime == COMPRESSIBLE) { - /*--- Evaluate reference values for non-dimensionalization. - For dynamic meshes, use the motion Mach number as a reference value - for computing the force coefficients. Otherwise, use the freestream values, - which is the standard convention. ---*/ - - RefTemp = Temperature_Inf; - RefDensity = Density_Inf; - if (dynamic_grid) { - Mach2Vel = sqrt(Gamma * Gas_Constant * RefTemp); - Mach_Motion = config->GetMach_Motion(); - RefVel2 = (Mach_Motion * Mach2Vel) * (Mach_Motion * Mach2Vel); - } else { - RefVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim] * Velocity_Inf[iDim]; - } - } - - if (FlowRegime == INCOMPRESSIBLE) { - /*--- Evaluate reference values for non-dimensionalization. - For dimensional or non-dim based on initial values, use - the far-field state (inf). For a custom non-dim based - on user-provided reference values, use the ref values - to compute the forces. ---*/ - - if ((config->GetRef_Inc_NonDim() == DIMENSIONAL) || (config->GetRef_Inc_NonDim() == INITIAL_VALUES)) { - RefDensity = Density_Inf; - RefVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim] * Velocity_Inf[iDim]; - } else if (config->GetRef_Inc_NonDim() == REFERENCE_VALUES) { - RefDensity = config->GetInc_Density_Ref(); - RefVel2 = config->GetInc_Velocity_Ref() * config->GetInc_Velocity_Ref(); - } - } - - const su2double factor = 1.0 / (0.5 * RefDensity * RefArea * RefVel2); + const su2double factor = 1.0 / AeroCoeffForceRef; /*--- Variables initialization ---*/ @@ -2452,8 +2376,6 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr /*--- Compute total and maximum heat flux on the wall ---*/ - - /// TODO: Move these ifs to specialized functions. if (!nemo){ diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index c07fb094fb7e..062711cb47b6 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -2516,6 +2516,11 @@ class CSolver { */ inline virtual void SetTotal_CNearFieldOF(su2double val_cnearfieldpress) { } + /*! + * \brief Get the reference force used to compute CL, CD, etc. + */ + inline virtual su2double GetAeroCoeffsReferenceForce() const { return 0; } + /*! * \brief A virtual member. * \return Value of the lift coefficient (inviscid + viscous contribution). diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index f246dd84231e..cdbe056be10a 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1022,7 +1022,7 @@ void CFlowOutput::WriteMetaData(CConfig *config){ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSolver **solver_container){ - unsigned short iDim, iMarker_Monitoring; + unsigned short iMarker_Monitoring; const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); const bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); @@ -2144,26 +2144,8 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo /*--- Reference area and force factors. ---*/ - su2double RefDensity, RefArea, RefVel, Factor, Ref; - RefArea = config->GetRefArea(); - if (compressible) { - RefDensity = solver_container[FLOW_SOL]->GetDensity_Inf(); - RefVel = solver_container[FLOW_SOL]->GetModVelocity_Inf(); - } else { - if ((config->GetRef_Inc_NonDim() == DIMENSIONAL) || - (config->GetRef_Inc_NonDim() == INITIAL_VALUES)) { - RefDensity = solver_container[FLOW_SOL]->GetDensity_Inf(); - RefVel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - RefVel += solver_container[FLOW_SOL]->GetVelocity_Inf(iDim)*solver_container[FLOW_SOL]->GetVelocity_Inf(iDim); - RefVel = sqrt(RefVel); - } else { - RefDensity = config->GetInc_Density_Ref(); - RefVel = config->GetInc_Velocity_Ref(); - } - } - Factor = (0.5*RefDensity*RefArea*RefVel*RefVel); - Ref = config->GetDensity_Ref() * config->GetVelocity_Ref() * config->GetVelocity_Ref() * 1.0 * 1.0; + const su2double Factor = solver_container[FLOW_SOL]->GetAeroCoeffsReferenceForce(); + const su2double Ref = config->GetDensity_Ref() * pow(config->GetVelocity_Ref(),2); Breakdown_file << "NOTE: Multiply forces by the non-dimensional factor: " << Factor << ", and the reference factor: " << Ref << "\n"; Breakdown_file << "to obtain the dimensional force." << "\n" << "\n"; diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index df70ceb8dc43..61f59e45144c 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -6752,7 +6752,8 @@ void CFEM_DG_EulerSolver::Pressure_Forces(const CGeometry* geometry, const CConf RefVel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; } - const su2double factor = 1.0/(0.5*RefDensity*RefArea*RefVel2); + AeroCoeffForceRef = 0.5 * RefDensity * RefArea * RefVel2; + const su2double factor = 1.0 / AeroCoeffForceRef; /*-- Variables initialization ---*/ Total_CD = 0.0; Total_CL = 0.0; Total_CSF = 0.0; Total_CEff = 0.0; diff --git a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp index 8672eb91ec5c..ae08c3450399 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp @@ -209,33 +209,13 @@ void CFEM_DG_NSSolver::Friction_Forces(const CGeometry* geometry, const CConfig* /*--- Get the information of the angle of attack, reference area, etc. ---*/ const su2double Alpha = config->GetAoA()*PI_NUMBER/180.0; const su2double Beta = config->GetAoS()*PI_NUMBER/180.0; - const su2double RefArea = config->GetRefArea(); const su2double RefLength = config->GetRefLength(); - const su2double Gas_Constant = config->GetGas_ConstantND(); auto Origin = config->GetRefOriginMoment(0); - const bool grid_movement = config->GetGrid_Movement(); - -/*--- Evaluate reference values for non-dimensionalization. - For dynamic meshes, use the motion Mach number as a reference value - for computing the force coefficients. Otherwise, use the freestream - values, which is the standard convention. ---*/ - const su2double RefTemp = Temperature_Inf; - const su2double RefDensity = Density_Inf; - const su2double RefHeatFlux = config->GetHeat_Flux_Ref(); - su2double RefVel2; - if (grid_movement) { - const su2double Mach2Vel = sqrt(Gamma*Gas_Constant*RefTemp); - const su2double Mach_Motion = config->GetMach_Motion(); - RefVel2 = (Mach_Motion*Mach2Vel)*(Mach_Motion*Mach2Vel); - } - else { - RefVel2 = 0.0; - for(unsigned short iDim=0; iDimGetHeat_Flux_Ref(); - const su2double factor = 1.0/(0.5*RefDensity*RefArea*RefVel2); + const su2double factor = 1.0 / AeroCoeffForceRef; /*--- Variables initialization ---*/ AllBound_CD_Visc = 0.0; AllBound_CL_Visc = 0.0; AllBound_CSF_Visc = 0.0; From 1d058cc9284094d9ebb551d0541e2355e82e6306 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 27 Jan 2021 13:24:54 +0100 Subject: [PATCH 175/326] Fix Reg test and fix insufficient of #1177 --- Common/include/CConfig.hpp | 3 ++- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 10 +++++----- .../chtPinArray_2d/DA_configMaster.cfg | 2 +- .../streamwise_periodic/chtPinArray_2d/configFluid.cfg | 2 +- .../streamwise_periodic/chtPinArray_2d/configSolid.cfg | 2 +- .../chtPinArray_2d/of_grad_findiff.csv.ref | 4 ++-- .../chtPinArray_3d/configMaster.cfg | 2 +- TestCases/streamwise_periodic_regression.py | 4 ++-- 10 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index ca2917f110ac..e307a9cda2ad 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -6322,7 +6322,8 @@ class CConfig { * \param[in] val_index - Index corresponding to the periodic transformation. * \return The translation vector. */ - const su2double* GetPeriodicTranslation(unsigned short val_index) { return Periodic_Translation[val_index]; } + + const su2double GetPeriodic_Translation(unsigned short iDim, unsigned short val_index = 0) const { return Periodic_Translation[val_index][iDim]; } /*! * \brief Get the rotationally periodic donor marker for boundary val_marker. diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index d1a0f27e43a4..d6670ec44d33 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -681,7 +681,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ Streamwise_Coord_Vector.resize(nDim); for (iDim = 0; iDim < nDim; iDim++) - Streamwise_Coord_Vector[iDim] = config->GetPeriodicTranslation(0)[iDim]; + Streamwise_Coord_Vector[iDim] = config->GetPeriodic_Translation(iDim); /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: dot_prod(t*t) = (|t|_2)^2 ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 0851949c96b4..a1385a7a95c8 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -940,7 +940,7 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ if (outlet) GetOutlet_Properties(geometry, config, iMesh, Output); /*--- Compute integrated Heatflux and massflow, TK:: Euler equations not implemented yet, probalby wasted here ---*/ - if (config->GetKind_Streamwise_Periodic()) { + if (config->GetKind_Streamwise_Periodic() && false) { if(rank==MASTER_NODE) cout << "EulerPrepsocessing GetStreamwise_Periodic_Properties." << endl; GetStreamwise_Periodic_Properties(geometry, config, iMesh); } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 415030861133..e0648ceef21a 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -116,7 +116,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(config->GetPeriodic_Translation(iDim),2); /*--- Compute recoverd pressure and temperature for all points ---*/ for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { @@ -124,7 +124,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) - dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodicTranslation(0)[iDim]); + dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(iDim)); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK:: added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; @@ -259,7 +259,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con norm2_translation = 0.0; for (auto iDim = 0u; iDim < nDim; iDim++) { - norm2_translation += pow(config->GetPeriodicTranslation(0)[iDim],2); + norm2_translation += pow(config->GetPeriodic_Translation(iDim),2); } } @@ -344,10 +344,10 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Dot product ---*/ dot_product = 0.0; for (auto iDim = 0u; iDim < nDim; iDim++) { - dot_product += config->GetPeriodicTranslation(0)[iDim]*Normal[iDim]; + dot_product += config->GetPeriodic_Translation(iDim)*Normal[iDim]; } - Res_Visc[nDim+1] -= scalar_factor*dot_product; + LinSysRes(iPoint, nDim+1) += scalar_factor*dot_product; } // if streamwise_periodic } else { // ISOTHERMAL diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index 512851472b35..c174e2659ac8 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -24,7 +24,7 @@ OUTER_ITER= 3000 % %CHT_ROBIN= NO % -SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1], BGS_ADJ_TEMPERATURE[0]) +SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1]) SCREEN_WRT_FREQ_OUTER= 100 % HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1] ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index 142fa4389f40..9f156eaa9090 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -15,7 +15,7 @@ SOLVER= INC_RANS % KIND_TURB_MODEL= SST % -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OBJECTIVE_FUNCTION= AVG_TEMPERATURE OBJECTIVE_WEIGHT= 0.0 % OPT_OBJECTIVE= NONE diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 912b85f2a0a6..7e9b3f418150 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -13,7 +13,7 @@ % SOLVER= HEAT_EQUATION % -OBJECTIVE_FUNCTION= TOTAL_AVG_TEMPERATURE +OBJECTIVE_FUNCTION= AVG_TEMPERATURE OBJECTIVE_WEIGHT= 1.0 % OPT_OBJECTIVE= AVG_TOTALTEMP diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 5e98f24df347..c13b64a6f0a6 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ -"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_MACH[0]" , "AVG_MASSFLOW[0]", "AVG_NORMALVEL[0]", "AVG_PRESS[0]" , "AVG_TEMP[0]" , "AVG_TOTALPRESS[0]", "AVG_TOTALTEMP[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENTUM_DISTORTION[0]", "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "PRESSURE_DROP[0]", "SECONDARY_OVER_UNIFORMITY[0]", "SECONDARY_STRENGTH[0]", "SIDEFORCE[0]" , "UNIFORMITY[0]" , "AVG_TEMPERATURE[1]", "HEATFLUX_MAX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 399999.9724328518, -1.310000000143141, 5.5510000002640306e-08, 399999.9724328518, 2150.0000002561137, 120.00000424450263, -8545.000000026448, 120.00000424450263, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 3.139999998902354 , 0.0 , 0.0 , 0.0 , 0.0 , -5.41000000076064 , -4.639999999500599 , 0.0 , -13.30000001242837, 959.9999998499698 , 0.0 , -350.00000480067683, 1e-08 +"VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" +0 , 0.0 , 399999.9724328518, 399999.9724328518, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index cc067241cc47..f290f8c908af 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -21,7 +21,7 @@ OUTER_ITER = 15000 % CONV_RESIDUAL_MINVAL= -26 % -SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], PRESSURE_DROP[0], AVG_TEMPERATURE[1] ) +SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) SCREEN_WRT_FREQ_OUTER= 100 % OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK) diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py index 46bd671005b8..ed517940b8df 100755 --- a/TestCases/streamwise_periodic_regression.py +++ b/TestCases/streamwise_periodic_regression.py @@ -101,7 +101,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.451732, -0.008477, 214.707868, 429.350000, 365.670000] #last 7 lines + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.451732, -0.008477, 214.707868, 365.670000] #last 7 lines sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 @@ -117,7 +117,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.054813, -4.137121, -4.054813] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.065832, -4.137121] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 From d5b1be59c585db3553b2332c1f50d9f17082c63b Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Wed, 27 Jan 2021 18:40:45 +0100 Subject: [PATCH 176/326] Temporary fix to restart waiting for complete PR --- SU2_CFD/src/solvers/CEulerSolver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 1629d078f7e6..76c2c05622c2 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -9287,7 +9287,7 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig /*--- For dynamic meshes, read in and store the grid coordinates and grid velocities for each node. ---*/ - if (dynamic_grid && val_update_geo) { + if (dynamic_grid && val_update_geo && !config->GetDeform_Mesh()) { /*--- Read in the next 2 or 3 variables which are the grid velocities ---*/ /*--- If we are restarting the solution from a previously computed static calculation (no grid movement) ---*/ @@ -9313,7 +9313,7 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig /*--- For static FSI problems, grid_movement is 0 but we need to read in and store the grid coordinates for each node (but not the grid velocities, as there are none). ---*/ - if (static_fsi && val_update_geo) { + if (static_fsi && val_update_geo && !config->GetDeform_Mesh()) { /*--- Rewind the index to retrieve the Coords. ---*/ index = counter*Restart_Vars[1]; Coord = &Restart_Data[index]; From 7bd274ace524cf8eb0e33ea255d91a6b37413481 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 27 Jan 2021 20:59:38 +0000 Subject: [PATCH 177/326] fix leak set incomp hybrid regression residuals --- SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp | 2 +- SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- TestCases/hybrid_regression.py | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index eda991d774d4..f7abf3d7d340 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -1036,7 +1036,7 @@ class CFVMFlowSolverBase : public CSolver { StrainMag(iPoint) = sqrt(2.0*StrainMag(iPoint)); AD::SetPreaccOut(StrainMag(iPoint)); - /*--- Max is not differentiable, we so not register for preacc. ---*/ + /*--- Max is not differentiable, so we not register them for preacc. ---*/ strainMax = max(strainMax, StrainMag(iPoint)); omegaMax = max(omegaMax, GeometryToolbox::Norm(3, Vorticity)); diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 33eab6df187c..4c3ba36a6f1f 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -197,7 +197,7 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Initialize External with the objective function gradient. ---*/ - su2double rhs_norm = 0.0; + su2double rhs_norm = 0.0; for (iZone = 0; iZone < nZone; iZone++) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 6ce2fa667d88..491fcf4fbfd0 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -3097,7 +3097,7 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - for (iVar = 0; iVar < nVar; iVar++) Solution[iVar] = 0.0; + su2double Solution[MAXNVAR] = {0.0}; for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index d4b80f5459ba..bf64ec6bc441 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -307,7 +307,7 @@ def main(): inc_nozzle.cfg_dir = "incomp_euler/nozzle" inc_nozzle.cfg_file = "inv_nozzle.cfg" inc_nozzle.test_iter = 20 - inc_nozzle.test_vals = [-5.971283, -4.911145, -0.000201, 0.121631] + inc_nozzle.test_vals = [-5.973103, -4.911802, -0.000195, 0.121643] inc_nozzle.new_output = True test_list.append(inc_nozzle) @@ -329,7 +329,7 @@ def main(): inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" inc_buoyancy.test_iter = 20 - inc_buoyancy.test_vals = [-4.436657, 0.507847, 0.000000, 0.000000] + inc_buoyancy.test_vals = [-4.432484, 0.507522, 0.000000, 0.000000] inc_buoyancy.new_output = True test_list.append(inc_buoyancy) @@ -338,7 +338,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-8.108218, -2.158606, 0.019142, 1.902461] + inc_poly_cylinder.test_vals = [-7.852778, -2.091519, 0.029298, 1.922006] inc_poly_cylinder.new_output = True test_list.append(inc_poly_cylinder) @@ -347,7 +347,7 @@ def main(): inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" inc_lam_bend.cfg_file = "lam_bend.cfg" inc_lam_bend.test_iter = 10 - inc_lam_bend.test_vals = [-3.450879, -3.083720, -0.020699, -0.168420] + inc_lam_bend.test_vals = [-3.438863, -3.102176, -0.017532, -0.193429] test_list.append(inc_lam_bend) ############################ @@ -368,7 +368,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.276273, 0.145895, 0.000021, 0.312004] + inc_turb_naca0012_sst_sust.test_vals = [-7.276424, 0.145861, 0.000003, 0.312011] test_list.append(inc_turb_naca0012_sst_sust) ###################################### @@ -436,7 +436,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.007635, -6.879789, 1.445300, 0.419281] + unst_inc_turb_naca0015_sa.test_vals = [-3.008629, -6.888974, 1.435193, 0.433537] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -596,7 +596,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 3 columns + slinc_steady.test_vals = [19.000000, -1.762730, -2.263278] #last 3 columns slinc_steady.multizone = True test_list.append(slinc_steady) @@ -676,7 +676,7 @@ def main(): mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" mms_fvm_inc_euler.test_iter = 20 - mms_fvm_inc_euler.test_vals = [-9.128345, -9.441741, 0.000000, 0.000000] + mms_fvm_inc_euler.test_vals = [-9.128033, -9.441406, 0.000000, 0.000000] test_list.append(mms_fvm_inc_euler) # FVM, incompressible, laminar N-S From 6118dff3ff88084260442b5246214016dbd3f770 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 27 Jan 2021 21:00:23 +0000 Subject: [PATCH 178/326] fix the Roe kappa thing and some compiler warnings --- SU2_CFD/src/numerics/flow/convection/roe.cpp | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 25199022939d..07256cb790a2 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -219,11 +219,11 @@ CNumerics::ResidualType<> CUpwRoeBase_Flow::ComputeResidual(const CConfig* confi /*--- Initialize residual (flux) and Jacobians ---*/ for (iVar = 0; iVar < nVar; iVar++) - Flux[iVar] = kappa*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); + Flux[iVar] = 0.5*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); if (implicit) { - GetInviscidProjJac(Velocity_i, &Energy_i, Normal, kappa, Jacobian_i); - GetInviscidProjJac(Velocity_j, &Energy_j, Normal, kappa, Jacobian_j); + GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5, Jacobian_i); + GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5, Jacobian_j); } /*--- Finalize in children class ---*/ @@ -316,7 +316,7 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J /*--- Compute wave amplitudes (characteristics) ---*/ - su2double proj_delta_vel = 0.0, delta_vel[3]; + su2double proj_delta_vel = 0.0, delta_vel[3] = {0.0}; for (iDim = 0; iDim < nDim; iDim++) { delta_vel[iDim] = Velocity_j[iDim] - Velocity_i[iDim]; proj_delta_vel += delta_vel[iDim]*UnitNormal[iDim]; @@ -325,7 +325,7 @@ void CUpwL2Roe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J su2double delta_p = Pressure_j - Pressure_i; su2double delta_rho = Density_j - Density_i; - su2double delta_wave[5] = {0.0, 0.0, 0.0, 0.0, 0.0}; + su2double delta_wave[5] = {0.0}; if (nDim == 2) { delta_wave[0] = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[1] = (UnitNormal[1]*delta_vel[0]-UnitNormal[0]*delta_vel[1])*zeta; @@ -389,7 +389,7 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J /*--- Compute wave amplitudes (characteristics) ---*/ - su2double proj_delta_vel = 0.0, delta_vel[3]; + su2double proj_delta_vel = 0.0, delta_vel[3] = {0.0}; for (iDim = 0; iDim < nDim; iDim++) { delta_vel[iDim] = Velocity_j[iDim] - Velocity_i[iDim]; proj_delta_vel += delta_vel[iDim]*UnitNormal[iDim]; @@ -398,7 +398,7 @@ void CUpwLMRoe_Flow::FinalizeResidual(su2double *val_residual, su2double **val_J su2double delta_p = Pressure_j - Pressure_i; su2double delta_rho = Density_j - Density_i; - su2double delta_wave[5] = {0.0, 0.0, 0.0, 0.0, 0.0}; + su2double delta_wave[5] = {0.0}; if (nDim == 2) { delta_wave[0] = delta_rho - delta_p/RoeSoundSpeed2; delta_wave[1] = (UnitNormal[1]*delta_vel[0]-UnitNormal[0]*delta_vel[1]); @@ -930,11 +930,11 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co GetPMatrix_inv(invP_Tensor, &RoeDensity, RoeVelocity, &RoeSoundSpeed, &RoeChi , &RoeKappa, UnitNormal); /*--- Jacobians of the inviscid flux, scaled by - kappa because val_resconv ~ kappa*(fc_i+fc_j)*Normal ---*/ + 0.5 because val_resconv ~ 0.5*(fc_i+fc_j)*Normal ---*/ - GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, Normal, kappa, Jacobian_i); + GetInviscidProjJac(Velocity_i, &Enthalpy_i, &Chi_i, &Kappa_i, Normal, 0.5, Jacobian_i); - GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, Normal, kappa, Jacobian_j); + GetInviscidProjJac(Velocity_j, &Enthalpy_j, &Chi_j, &Kappa_j, Normal, 0.5, Jacobian_j); /*--- Diference variables iPoint and jPoint ---*/ @@ -943,7 +943,7 @@ CNumerics::ResidualType<> CUpwGeneralRoe_Flow::ComputeResidual(const CConfig* co /*--- Roe's Flux approximation ---*/ for (iVar = 0; iVar < nVar; iVar++) { - Flux[iVar] = kappa*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); + Flux[iVar] = 0.5*(ProjFlux_i[iVar]+ProjFlux_j[iVar]); for (jVar = 0; jVar < nVar; jVar++) { Proj_ModJac_Tensor_ij = 0.0; From 30184d383acd2c6a1e781f3827072c6f4ea9d87b Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 27 Jan 2021 21:11:29 +0000 Subject: [PATCH 179/326] fix directdiff compilation with OpenMP --- SU2_CFD/src/solvers/CFEASolver.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 84893bf9f96b..24ad61b4ec1e 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -1318,8 +1318,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, AD::EndPassive(wasActive); } // end iElem loop - SU2_OMP_ATOMIC - StressPenalty += stressPen; + atomicAdd(stressPen, StressPenalty); } // end color loop From 726f4e7ebeb8ede1f719d30d48d1ef3f8a6e79ba Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 28 Jan 2021 21:46:09 +0000 Subject: [PATCH 180/326] one LoadRestart to rule them all --- SU2_CFD/include/solvers/CEulerSolver.hpp | 14 -- .../include/solvers/CFVMFlowSolverBase.hpp | 25 ++ .../include/solvers/CFVMFlowSolverBase.inl | 228 ++++++++++++++++++ SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 10 - SU2_CFD/src/drivers/CMultizoneDriver.cpp | 4 +- SU2_CFD/src/drivers/CSinglezoneDriver.cpp | 2 - SU2_CFD/src/solvers/CEulerSolver.cpp | 209 ---------------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 212 +--------------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 214 ---------------- 9 files changed, 258 insertions(+), 660 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 329024d59b1f..b156f6498d91 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -1057,20 +1057,6 @@ class CEulerSolver : public CFVMFlowSolverBase { */ void UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config) final; - /*! - * \brief Load a solution from a restart file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all of the solvers. - * \param[in] config - Definition of the particular problem. - * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. - */ - void LoadRestart(CGeometry **geometry, - CSolver ***solver, - CConfig *config, - int val_iter, - bool val_update_geo) final; - /*! * \brief Set the initial condition for the Euler Equations. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index f7abf3d7d340..7c8104869205 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -267,6 +267,20 @@ class CFVMFlowSolverBase : public CSolver { CNumerics *numerics, CConfig *config); using CSolver::Viscous_Residual; /*--- Silence warning ---*/ + /*! + * \brief General implementation to load a flow solution from a restart file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all of the solvers. + * \param[in] config - Definition of the particular problem. + * \param[in] iter - Current external iteration number. + * \param[in] update_geo - Flag for updating coords and grid velocity. + * \param[in] RestartSolution - Optional buffer to load restart vars into, + * this allows default values to be given when nVar > nVar_Restart. + * \param[in] nVar_Restart - Number of restart variables, if 0 defaults to nVar. + */ + void LoadRestart_impl(CGeometry **geometry, CSolver ***solver, CConfig *config, int iter, bool update_geo, + su2double* RestartSolution = nullptr, unsigned short nVar_Restart = 0); + /*! * \brief Generic implementation to compute the time step based on CFL and conv/visc eigenvalues. * \param[in] geometry - Geometrical definition of the problem. @@ -1068,6 +1082,17 @@ class CFVMFlowSolverBase : public CSolver { ~CFVMFlowSolverBase(); public: + + /*! + * \brief Load a solution from a restart file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all of the solvers. + * \param[in] config - Definition of the particular problem. + * \param[in] iter - Current external iteration number. + * \param[in] update_geo - Flag for updating coords and grid velocity. + */ + void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int iter, bool update_geo) override; + /*! * \brief Compute the gradient of the primitive variables using Green-Gauss method, * and stores the result in the Gradient_Primitive variable. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 531eb3f94859..ff9a7bcbc01d 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -818,6 +818,234 @@ void CFVMFlowSolverBase::SetUniformInlet(const CConfig* config, unsigned s } } +template +void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ***solver, CConfig *config, + int iter, bool update_geo, su2double* SolutionRestart, + unsigned short nVar_Restart) { + + /*--- Restart the solution from file information ---*/ + + unsigned short iDim, iVar, iMesh, iMeshFine; + unsigned long iPoint, index, iChildren, Point_Fine; + unsigned short turb_model = config->GetKind_Turb_Model(); + su2double Area_Children, Area_Parent; + const su2double* Solution_Fine = nullptr; + const passivedouble* Coord = nullptr; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool static_fsi = ((config->GetTime_Marching() == STEADY) && config->GetFSI_Simulation()); + bool steady_restart = config->GetSteadyRestart(); + bool turbulent = (config->GetKind_Turb_Model() != NONE); + + string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", iter); + + /*--- To make this routine safe to call in parallel most of it can only be executed by one thread. ---*/ + SU2_OMP_MASTER { + + if (nVar_Restart == 0) nVar_Restart = nVar; + + /*--- Skip coordinates ---*/ + + unsigned short skipVars = geometry[MESH_0]->GetnDim(); + + /*--- Store the number of variables for the turbulence model + (that could appear in the restart file before the grid velocities). ---*/ + unsigned short turbVars = 0; + if (turbulent){ + if ((turb_model == SST) || (turb_model == SST_SUST)) turbVars = 2; + else turbVars = 1; + } + + /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ + + if (config->GetRead_Binary_Restart()) { + Read_SU2_Restart_Binary(geometry[MESH_0], config, restart_filename); + } else { + Read_SU2_Restart_ASCII(geometry[MESH_0], config, restart_filename); + } + + /*--- Load data from the restart into correct containers. ---*/ + + unsigned long counter = 0, iPoint_Global = 0; + for (; iPoint_Global < geometry[MESH_0]->GetGlobal_nPointDomain(); iPoint_Global++) { + + /*--- Retrieve local index. If this node from the restart file lives + on the current processor, we will load and instantiate the vars. ---*/ + + auto iPoint_Local = geometry[MESH_0]->GetGlobal_to_Local_Point(iPoint_Global); + + if (iPoint_Local > -1) { + + /*--- We need to store this point's data, so jump to the correct + offset in the buffer of data from the restart file and load it. ---*/ + + index = counter*Restart_Vars[1] + skipVars; + + if (SolutionRestart == nullptr) { + nodes->SetSolution(iPoint_Local, &Restart_Data[index]); + } + else { + /*--- Used as buffer, allows defaults for nVar > nVar_Restart. ---*/ + for (iVar = 0; iVar < nVar_Restart; iVar++) + SolutionRestart[iVar] = Restart_Data[index+iVar]; + nodes->SetSolution(iPoint_Local, SolutionRestart); + } + + /*--- For dynamic meshes, read in and store the + grid coordinates and grid velocities for each node. ---*/ + + if (dynamic_grid && update_geo) { + + /*--- Read in the next 2 or 3 variables which are the grid velocities ---*/ + /*--- If we are restarting the solution from a previously computed static calculation (no grid movement) ---*/ + /*--- the grid velocities are set to 0. This is useful for FSI computations ---*/ + + /*--- Rewind the index to retrieve the Coords. ---*/ + index = counter*Restart_Vars[1]; + Coord = &Restart_Data[index]; + + su2double GridVel[MAXNDIM] = {0.0}; + if (!steady_restart) { + /*--- Move the index forward to get the grid velocities. ---*/ + index += skipVars + nVar_Restart + turbVars; + for (iDim = 0; iDim < nDim; iDim++) { GridVel[iDim] = Restart_Data[index+iDim]; } + } + + for (iDim = 0; iDim < nDim; iDim++) { + geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); + geometry[MESH_0]->nodes->SetGridVel(iPoint_Local, iDim, GridVel[iDim]); + } + } + + /*--- For static FSI problems, grid_movement is 0 but we need to read in and store the + grid coordinates for each node (but not the grid velocities, as there are none). ---*/ + + if (static_fsi && update_geo) { + /*--- Rewind the index to retrieve the Coords. ---*/ + index = counter*Restart_Vars[1]; + Coord = &Restart_Data[index]; + + for (iDim = 0; iDim < nDim; iDim++) { + geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); + } + } + + /*--- Increment the overall counter for how many points have been loaded. ---*/ + counter++; + } + + } + + /*--- Detect a wrong solution file ---*/ + + if (counter != nPointDomain) { + SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + + string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); + } + } // end SU2_OMP_MASTER + SU2_OMP_BARRIER + + /*--- Update the geometry for flows on deforming meshes ---*/ + + if ((dynamic_grid || static_fsi) && update_geo) { + + /*--- Communicate the new coordinates and grid velocities at the halos ---*/ + + geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, COORDINATES); + geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, COORDINATES); + + if (dynamic_grid) { + geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, GRID_VELOCITY); + geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, GRID_VELOCITY); + } + + /*--- Recompute the edges and dual mesh control volumes in the + domain and on the boundaries. ---*/ + + geometry[MESH_0]->SetControlVolume(config, UPDATE); + geometry[MESH_0]->SetBoundControlVolume(config, UPDATE); + geometry[MESH_0]->SetMaxLength(config); + + /*--- Update the multigrid structure after setting up the finest grid, + including computing the grid velocities on the coarser levels. ---*/ + + for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { + iMeshFine = iMesh-1; + geometry[iMesh]->SetControlVolume(config, geometry[iMeshFine], UPDATE); + geometry[iMesh]->SetBoundControlVolume(config, geometry[iMeshFine],UPDATE); + geometry[iMesh]->SetCoord(geometry[iMeshFine]); + if (dynamic_grid) { + geometry[iMesh]->SetRestricted_GridVelocity(geometry[iMeshFine], config); + } + geometry[iMesh]->SetMaxLength(config); + } + } + + /*--- Communicate the loaded solution on the fine grid before we transfer + it down to the coarse levels. We also call the preprocessing routine + on the fine level in order to have all necessary quantities updated, + especially if this is a turbulent simulation (eddy viscosity). ---*/ + + solver[MESH_0][FLOW_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION); + solver[MESH_0][FLOW_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION); + + /*--- For turbulent simulations the flow preprocessing is done by the turbulence solver + * after it loads its variables (they are needed to compute flow primitives). ---*/ + if (!turbulent) { + solver[MESH_0][FLOW_SOL]->Preprocessing(geometry[MESH_0], solver[MESH_0], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false); + } + + /*--- Interpolate the solution down to the coarse multigrid levels ---*/ + + for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { + Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); + su2double Solution_Coarse[MAXNVAR] = {0.0}; + for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { + Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); + Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); + Solution_Fine = solver[iMesh-1][FLOW_SOL]->GetNodes()->GetSolution(Point_Fine); + for (iVar = 0; iVar < nVar; iVar++) { + Solution_Coarse[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; + } + } + solver[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint,Solution_Coarse); + } + + solver[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); + solver[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); + + if (!turbulent) { + solver[iMesh][FLOW_SOL]->Preprocessing(geometry[iMesh], solver[iMesh], config, iMesh, NO_RK_ITER, RUNTIME_FLOW_SYS, false); + } + } + + /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy. ---*/ + if (dual_time && config->GetGrid_Movement() && !config->GetDeform_Mesh() && + (config->GetKind_GridMovement() != RIGID_MOTION)) { + Restart_OldGeometry(geometry[MESH_0], config); + } + + /*--- Go back to single threaded execution. ---*/ + SU2_OMP_MASTER + { + /*--- Delete the class memory that is used to load the restart. ---*/ + + delete [] Restart_Vars; Restart_Vars = nullptr; + delete [] Restart_Data; Restart_Data = nullptr; + + } // end SU2_OMP_MASTER + SU2_OMP_BARRIER + +} + +template +void CFVMFlowSolverBase::LoadRestart(CGeometry **geometry, CSolver ***solver, + CConfig *config, int iter, bool update_geo) { + LoadRestart_impl(geometry, solver, config, iter, update_geo); +} + template void CFVMFlowSolverBase::PushSolutionBackInTime(unsigned long TimeIter, bool restart, bool rans, CSolver*** solver_container, CGeometry** geometry, diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index a902523c0fe6..8906fc36fa68 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -124,16 +124,6 @@ class CNEMOEulerSolver : public CFVMFlowSolverBaseGetPredictor()) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 690fb4637e9e..f82adee95249 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -9219,215 +9219,6 @@ void CEulerSolver::PrintVerificationError(const CConfig *config) const { } } -void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { - - /*--- Restart the solution from file information ---*/ - - unsigned short iDim, iVar, iMesh, iMeshFine; - unsigned long iPoint, index, iChildren, Point_Fine; - unsigned short turb_model = config->GetKind_Turb_Model(); - su2double Area_Children, Area_Parent; - const su2double* Solution_Fine = nullptr; - const passivedouble* Coord = nullptr; - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool static_fsi = ((config->GetTime_Marching() == STEADY) && config->GetFSI_Simulation()); - bool steady_restart = config->GetSteadyRestart(); - bool turbulent = (config->GetKind_Turb_Model() != NONE); - - string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); - - /*--- To make this routine safe to call in parallel most of it can only be executed by one thread. ---*/ - SU2_OMP_MASTER { - - /*--- Skip coordinates ---*/ - - unsigned short skipVars = geometry[MESH_0]->GetnDim(); - - /*--- Store the number of variables for the turbulence model - (that could appear in the restart file before the grid velocities). ---*/ - unsigned short turbVars = 0; - if (turbulent){ - if ((turb_model == SST) || (turb_model == SST_SUST)) turbVars = 2; - else turbVars = 1; - } - - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ - - if (config->GetRead_Binary_Restart()) { - Read_SU2_Restart_Binary(geometry[MESH_0], config, restart_filename); - } else { - Read_SU2_Restart_ASCII(geometry[MESH_0], config, restart_filename); - } - - /*--- Load data from the restart into correct containers. ---*/ - - unsigned long counter = 0, iPoint_Global = 0; - for (; iPoint_Global < geometry[MESH_0]->GetGlobal_nPointDomain(); iPoint_Global++) { - - /*--- Retrieve local index. If this node from the restart file lives - on the current processor, we will load and instantiate the vars. ---*/ - - auto iPoint_Local = geometry[MESH_0]->GetGlobal_to_Local_Point(iPoint_Global); - - if (iPoint_Local > -1) { - - /*--- We need to store this point's data, so jump to the correct - offset in the buffer of data from the restart file and load it. ---*/ - - index = counter*Restart_Vars[1] + skipVars; - for (iVar = 0; iVar < nVar; ++iVar) - nodes->SetSolution(iPoint_Local, iVar, Restart_Data[index+iVar]); - - /*--- For dynamic meshes, read in and store the - grid coordinates and grid velocities for each node. ---*/ - - if (dynamic_grid && val_update_geo) { - - /*--- Read in the next 2 or 3 variables which are the grid velocities ---*/ - /*--- If we are restarting the solution from a previously computed static calculation (no grid movement) ---*/ - /*--- the grid velocities are set to 0. This is useful for FSI computations ---*/ - - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - Coord = &Restart_Data[index]; - - su2double GridVel[MAXNDIM] = {0.0}; - if (!steady_restart) { - /*--- Move the index forward to get the grid velocities. ---*/ - index += skipVars + nVar + turbVars; - for (iDim = 0; iDim < nDim; iDim++) { GridVel[iDim] = Restart_Data[index+iDim]; } - } - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - geometry[MESH_0]->nodes->SetGridVel(iPoint_Local, iDim, GridVel[iDim]); - } - } - - /*--- For static FSI problems, grid_movement is 0 but we need to read in and store the - grid coordinates for each node (but not the grid velocities, as there are none). ---*/ - - if (static_fsi && val_update_geo) { - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - Coord = &Restart_Data[index]; - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - } - } - - /*--- Increment the overall counter for how many points have been loaded. ---*/ - counter++; - } - - } - - /*--- Detect a wrong solution file ---*/ - - if (counter != nPointDomain) { - SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + - string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); - } - } // end SU2_OMP_MASTER - SU2_OMP_BARRIER - - /*--- Update the geometry for flows on deforming meshes ---*/ - - if ((dynamic_grid || static_fsi) && val_update_geo) { - - /*--- Communicate the new coordinates and grid velocities at the halos ---*/ - - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, COORDINATES); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, COORDINATES); - - if (dynamic_grid) { - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, GRID_VELOCITY); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, GRID_VELOCITY); - } - - /*--- Recompute the edges and dual mesh control volumes in the - domain and on the boundaries. ---*/ - - geometry[MESH_0]->SetControlVolume(config, UPDATE); - geometry[MESH_0]->SetBoundControlVolume(config, UPDATE); - geometry[MESH_0]->SetMaxLength(config); - - /*--- Update the multigrid structure after setting up the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - iMeshFine = iMesh-1; - geometry[iMesh]->SetControlVolume(config, geometry[iMeshFine], UPDATE); - geometry[iMesh]->SetBoundControlVolume(config, geometry[iMeshFine],UPDATE); - geometry[iMesh]->SetCoord(geometry[iMeshFine]); - if (dynamic_grid) { - geometry[iMesh]->SetRestricted_GridVelocity(geometry[iMeshFine], config); - } - geometry[iMesh]->SetMaxLength(config); - } - } - - /*--- Communicate the loaded solution on the fine grid before we transfer - it down to the coarse levels. We also call the preprocessing routine - on the fine level in order to have all necessary quantities updated, - especially if this is a turbulent simulation (eddy viscosity). ---*/ - - solver[MESH_0][FLOW_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION); - solver[MESH_0][FLOW_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION); - - /*--- For turbulent simulations the flow preprocessing is done by the turbulence solver - * after it loads its variables (they are needed to compute flow primitives). ---*/ - if (!turbulent) { - solver[MESH_0][FLOW_SOL]->Preprocessing(geometry[MESH_0], solver[MESH_0], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - } - - /*--- Interpolate the solution down to the coarse multigrid levels ---*/ - - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - su2double Solution_Coarse[MAXNVAR] = {0.0}; - for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { - Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); - Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); - Solution_Fine = solver[iMesh-1][FLOW_SOL]->GetNodes()->GetSolution(Point_Fine); - for (iVar = 0; iVar < nVar; iVar++) { - Solution_Coarse[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; - } - } - solver[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint,Solution_Coarse); - } - - solver[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); - solver[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); - - if (!turbulent) { - solver[iMesh][FLOW_SOL]->Preprocessing(geometry[iMesh], solver[iMesh], config, iMesh, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - } - } - - /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy. ---*/ - if (dual_time && config->GetGrid_Movement() && !config->GetDeform_Mesh() && - (config->GetKind_GridMovement() != RIGID_MOTION)) { - Restart_OldGeometry(geometry[MESH_0], config); - } - - /*--- Go back to single threaded execution. ---*/ - SU2_OMP_MASTER - { - /*--- Delete the class memory that is used to load the restart. ---*/ - - delete [] Restart_Vars; Restart_Vars = nullptr; - delete [] Restart_Data; Restart_Data = nullptr; - - } // end SU2_OMP_MASTER - SU2_OMP_BARRIER - -} - void CEulerSolver::SetFreeStream_Solution(const CConfig *config) { unsigned long iPoint; diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 491fcf4fbfd0..55877f298d54 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2914,224 +2914,20 @@ void CIncEulerSolver::PrintVerificationError(const CConfig *config) const { void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { - /*--- Restart the solution from file information ---*/ - unsigned short iDim, iVar, iMesh, iMeshFine; - unsigned long iPoint, index, iChildren, Point_Fine; - unsigned short turb_model = config->GetKind_Turb_Model(); - su2double Area_Children, Area_Parent, Coord[MAXNDIM] = {0.0}, *Solution_Fine; - bool static_fsi = ((config->GetTime_Marching() == STEADY) && config->GetFSI_Simulation()); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool steady_restart = config->GetSteadyRestart(); - bool turbulent = (config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS); - - string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); - - unsigned long counter = 0; - long iPoint_Local = 0; unsigned long iPoint_Global = 0; - unsigned long iPoint_Global_Local = 0; - - /*--- To make this routine safe to call in parallel most of it can only be executed by one thread. ---*/ - SU2_OMP_MASTER { - - /*--- Skip coordinates ---*/ - - unsigned short skipVars = geometry[MESH_0]->GetnDim(); - - /*--- Store the number of variables for the turbulence model - (that could appear in the restart file before the grid velocities). ---*/ - unsigned short turbVars = 0; - if (turbulent){ - if ((turb_model == SST) || (turb_model == SST_SUST)) turbVars = 2; - else turbVars = 1; - } - /*--- Adjust the number of solution variables in the restart. We always carry a space in nVar for the energy equation in the solver, but we only write it to the restart if it is active. Therefore, we must reduce nVar here if energy is inactive so that the restart is read correctly. ---*/ - bool energy = config->GetEnergy_Equation(); - bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + bool energy = config->GetEnergy_Equation(); + bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); unsigned short nVar_Restart = nVar; - if ((!energy) && (!weakly_coupled_heat)) nVar_Restart--; + if (!(energy || weakly_coupled_heat)) nVar_Restart--; su2double Solution[MAXNVAR] = {0.0}; Solution[nVar-1] = GetTemperature_Inf(); - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ - - if (config->GetRead_Binary_Restart()) { - Read_SU2_Restart_Binary(geometry[MESH_0], config, restart_filename); - } else { - Read_SU2_Restart_ASCII(geometry[MESH_0], config, restart_filename); - } - - /*--- Load data from the restart into correct containers. ---*/ - - counter = 0; - for (iPoint_Global = 0; iPoint_Global < geometry[MESH_0]->GetGlobal_nPointDomain(); iPoint_Global++ ) { - - /*--- Retrieve local index. If this node from the restart file lives - on the current processor, we will load and instantiate the vars. ---*/ - - iPoint_Local = geometry[MESH_0]->GetGlobal_to_Local_Point(iPoint_Global); - - if (iPoint_Local > -1) { - - /*--- We need to store this point's data, so jump to the correct - offset in the buffer of data from the restart file and load it. ---*/ - - index = counter*Restart_Vars[1] + skipVars; - for (iVar = 0; iVar < nVar_Restart; iVar++) Solution[iVar] = Restart_Data[index+iVar]; - nodes->SetSolution(iPoint_Local,Solution); - iPoint_Global_Local++; - - /*--- For dynamic meshes, read in and store the - grid coordinates and grid velocities for each node. ---*/ - - if (dynamic_grid && val_update_geo) { - - /*--- Read in the next 2 or 3 variables which are the grid velocities ---*/ - /*--- If we are restarting the solution from a previously computed static calculation (no grid movement) ---*/ - /*--- the grid velocities are set to 0. This is useful for FSI computations ---*/ - - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - for (iDim = 0; iDim < nDim; iDim++) { Coord[iDim] = Restart_Data[index+iDim]; } - - su2double GridVel[MAXNDIM] = {0.0}; - if (!steady_restart) { - /*--- Move the index forward to get the grid velocities. ---*/ - index = counter*Restart_Vars[1] + skipVars + nVar_Restart + turbVars; - for (iDim = 0; iDim < nDim; iDim++) { GridVel[iDim] = Restart_Data[index+iDim]; } - } - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - geometry[MESH_0]->nodes->SetGridVel(iPoint_Local, iDim, GridVel[iDim]); - } - } - - /*--- For static FSI problems, grid_movement is 0 but we need to read in and store the - grid coordinates for each node (but not the grid velocities, as there are none). ---*/ - - if (static_fsi && val_update_geo) { - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - for (iDim = 0; iDim < nDim; iDim++) { Coord[iDim] = Restart_Data[index+iDim];} - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - } - } - - /*--- Increment the overall counter for how many points have been loaded. ---*/ - counter++; - - } - } - - /*--- Detect a wrong solution file ---*/ - - if (counter != nPointDomain) { - SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + - string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); - } - } // end SU2_OMP_MASTER - SU2_OMP_BARRIER - - /*--- Update the geometry for flows on deforming meshes ---*/ - - if ((dynamic_grid || static_fsi) && val_update_geo) { - - /*--- Communicate the new coordinates and grid velocities at the halos ---*/ - - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, COORDINATES); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, COORDINATES); - - if (dynamic_grid) { - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, GRID_VELOCITY); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, GRID_VELOCITY); - } - - /*--- Recompute the edges and dual mesh control volumes in the - domain and on the boundaries. ---*/ - - geometry[MESH_0]->SetControlVolume(config, UPDATE); - geometry[MESH_0]->SetBoundControlVolume(config, UPDATE); - geometry[MESH_0]->SetMaxLength(config); - - /*--- Update the multigrid structure after setting up the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - iMeshFine = iMesh-1; - geometry[iMesh]->SetControlVolume(config, geometry[iMeshFine], UPDATE); - geometry[iMesh]->SetBoundControlVolume(config, geometry[iMeshFine],UPDATE); - geometry[iMesh]->SetCoord(geometry[iMeshFine]); - if (dynamic_grid) { - geometry[iMesh]->SetRestricted_GridVelocity(geometry[iMeshFine], config); - } - geometry[iMesh]->SetMaxLength(config); - } - } - - /*--- Communicate the loaded solution on the fine grid before we transfer - it down to the coarse levels. We alo call the preprocessing routine - on the fine level in order to have all necessary quantities updated, - especially if this is a turbulent simulation (eddy viscosity). ---*/ - - solver[MESH_0][FLOW_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION); - solver[MESH_0][FLOW_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION); - - /*--- For turbulent simulations the flow preprocessing is done by the turbulence solver - * after it loads its variables (they are needed to compute flow primitives). ---*/ - if (!turbulent) { - solver[MESH_0][FLOW_SOL]->Preprocessing(geometry[MESH_0], solver[MESH_0], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - } - - /*--- Interpolate the solution down to the coarse multigrid levels ---*/ - - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - su2double Solution[MAXNVAR] = {0.0}; - for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { - Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); - Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); - Solution_Fine = solver[iMesh-1][FLOW_SOL]->GetNodes()->GetSolution(Point_Fine); - for (iVar = 0; iVar < nVar; iVar++) { - Solution[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; - } - } - solver[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint,Solution); - } - solver[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); - solver[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); - - if (!turbulent) { - solver[iMesh][FLOW_SOL]->Preprocessing(geometry[iMesh], solver[iMesh], config, iMesh, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - } - } - - /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy ---*/ - if (dual_time && config->GetGrid_Movement() && !config->GetDeform_Mesh() && - (config->GetKind_GridMovement() != RIGID_MOTION)) { - Restart_OldGeometry(geometry[MESH_0], config); - } - - /*--- Go back to single threaded execution. ---*/ - SU2_OMP_MASTER - { - /*--- Delete the class memory that is used to load the restart. ---*/ - - delete [] Restart_Vars; Restart_Vars = nullptr; - delete [] Restart_Data; Restart_Data = nullptr; - - } // end SU2_OMP_MASTER - SU2_OMP_BARRIER + LoadRestart_impl(geometry, solver, config, val_iter, val_update_geo, Solution, nVar_Restart); } diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 8e18fd1f5bd8..41c7ceef606c 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -2539,217 +2539,3 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solut // BC_Euler_Wall(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker); // //} - -void CNEMOEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { - - /*--- Restart the solution from file information ---*/ - unsigned short iDim, iVar, iMesh, iMeshFine; - unsigned long iPoint, index, iChildren, Point_Fine; - unsigned short turb_model = config->GetKind_Turb_Model(); - su2double Area_Children, Area_Parent, *Coord, *Solution_Fine; - bool dynamic_grid = config->GetGrid_Movement(); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool static_fsi = ((config->GetTime_Marching() == STEADY) && - (config->GetFSI_Simulation())); - bool steady_restart = config->GetSteadyRestart(); - bool turbulent = false; - - string UnstExt, text_line; - ifstream restart_file; - - string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); - - Coord = new su2double [nDim]; - for (iDim = 0; iDim < nDim; iDim++) - Coord[iDim] = 0.0; - - int counter = 0; - long iPoint_Local = 0; unsigned long iPoint_Global = 0; - unsigned long iPoint_Global_Local = 0; - unsigned short rbuf_NotMatching = 0, sbuf_NotMatching = 0; - - /*--- Skip coordinates ---*/ - unsigned short skipVars = geometry[MESH_0]->GetnDim(); - - /*--- Store the number of variables for the turbulence model - (that could appear in the restart file before the grid velocities). ---*/ - unsigned short turbVars = 0; - if (turbulent){ - if (turb_model == SST) turbVars = 2; - else turbVars = 1; - } - - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ - if (config->GetRead_Binary_Restart()) { - Read_SU2_Restart_Binary(geometry[MESH_0], config, restart_filename); - } else { - Read_SU2_Restart_ASCII(geometry[MESH_0], config, restart_filename); - } - - /*--- Load data from the restart into correct containers. ---*/ - counter = 0; - for (iPoint_Global = 0; iPoint_Global < geometry[MESH_0]->GetGlobal_nPointDomain(); iPoint_Global++ ) { - - /*--- Retrieve local index. If this node from the restart file lives - on the current processor, we will load and instantiate the vars. ---*/ - iPoint_Local = geometry[MESH_0]->GetGlobal_to_Local_Point(iPoint_Global); - - if (iPoint_Local > -1) { - - /*--- We need to store this point's data, so jump to the correct - offset in the buffer of data from the restart file and load it. ---*/ - index = counter*Restart_Vars[1] + skipVars; - for (iVar = 0; iVar < nVar; iVar++) Solution[iVar] = Restart_Data[index+iVar]; - nodes->SetSolution(iPoint_Local,Solution); - iPoint_Global_Local++; - - /*--- For dynamic meshes, read in and store the - grid coordinates and grid velocities for each node. ---*/ - if (dynamic_grid && val_update_geo) { - - /*--- Read in the next 2 or 3 variables which are the grid velocities ---*/ - /*--- If we are restarting the solution from a previously computed static calculation (no grid movement) ---*/ - /*--- the grid velocities are set to 0. This is useful for FSI computations ---*/ - su2double GridVel[3] = {0.0,0.0,0.0}; - if (!steady_restart) { - - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - for (iDim = 0; iDim < nDim; iDim++) { Coord[iDim] = Restart_Data[index+iDim]; } - - /*--- Move the index forward to get the grid velocities. ---*/ - index = counter*Restart_Vars[1] + skipVars + nVar + turbVars; - for (iDim = 0; iDim < nDim; iDim++) { GridVel[iDim] = Restart_Data[index+iDim]; } - } - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - geometry[MESH_0]->nodes->SetGridVel(iPoint_Local, iDim, GridVel[iDim]); - } - } - - if (static_fsi && val_update_geo) { - /*--- Rewind the index to retrieve the Coords. ---*/ - index = counter*Restart_Vars[1]; - for (iDim = 0; iDim < nDim; iDim++) { Coord[iDim] = Restart_Data[index+iDim];} - - for (iDim = 0; iDim < nDim; iDim++) { - geometry[MESH_0]->nodes->SetCoord(iPoint_Local, iDim, Coord[iDim]); - } - } - - /*--- Increment the overall counter for how many points have been loaded. ---*/ - counter++; - } - } - - /*--- Detect a wrong solution file ---*/ - if (iPoint_Global_Local < nPointDomain) { sbuf_NotMatching = 1; } - -#ifndef HAVE_MPI - rbuf_NotMatching = sbuf_NotMatching; -#else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); -#endif - if (rbuf_NotMatching != 0) { - SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + - string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); - } - - /*--- Communicate the loaded solution on the fine grid before we transfer - it down to the coarse levels. We alo call the preprocessing routine - on the fine level in order to have all necessary quantities updated, - especially if this is a turbulent simulation (eddy viscosity). ---*/ - solver[MESH_0][FLOW_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION); - solver[MESH_0][FLOW_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION); - solver[MESH_0][FLOW_SOL]->Preprocessing(geometry[MESH_0], solver[MESH_0], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - - /*--- Interpolate the solution down to the coarse multigrid levels ---*/ - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - for (iVar = 0; iVar < nVar; iVar++) Solution[iVar] = 0.0; - for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { - Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); - Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); - Solution_Fine = solver[iMesh-1][FLOW_SOL]->GetNodes()->GetSolution(Point_Fine); - for (iVar = 0; iVar < nVar; iVar++) { - Solution[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; - } - } - solver[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint,Solution); - } - solver[MESH_0][FLOW_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION); - solver[MESH_0][FLOW_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION); - solver[iMesh][FLOW_SOL]->Preprocessing(geometry[iMesh], solver[iMesh], config, iMesh, NO_RK_ITER, RUNTIME_FLOW_SYS, false); - } - - /*--- Update the geometry for flows on dynamic meshes ---*/ - if (dynamic_grid && val_update_geo) { - - /*--- Communicate the new coordinates and grid velocities at the halos ---*/ - - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, COORDINATES); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, COORDINATES); - - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, GRID_VELOCITY); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, GRID_VELOCITY); - - /*--- Recompute the edges and dual mesh control volumes in the - domain and on the boundaries. ---*/ - geometry[MESH_0]->SetControlVolume(config, UPDATE); - geometry[MESH_0]->SetBoundControlVolume(config, UPDATE); - geometry[MESH_0]->SetMaxLength(config); - - /*--- Update the multigrid structure after setting up the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - iMeshFine = iMesh-1; - geometry[iMesh]->SetControlVolume(config, geometry[iMeshFine], UPDATE); - geometry[iMesh]->SetBoundControlVolume(config, geometry[iMeshFine],UPDATE); - geometry[iMesh]->SetCoord(geometry[iMeshFine]); - geometry[iMesh]->SetRestricted_GridVelocity(geometry[iMeshFine], config); - geometry[iMesh]->SetMaxLength(config); - } - } - - /*--- Update the geometry for flows on static FSI problems with moving meshes ---*/ - if (static_fsi && val_update_geo) { - - /*--- Communicate the new coordinates and grid velocities at the halos ---*/ - geometry[MESH_0]->InitiateComms(geometry[MESH_0], config, COORDINATES); - geometry[MESH_0]->CompleteComms(geometry[MESH_0], config, COORDINATES); - - /*--- Recompute the edges and dual mesh control volumes in the - domain and on the boundaries. ---*/ - geometry[MESH_0]->SetControlVolume(config, UPDATE); - geometry[MESH_0]->SetBoundControlVolume(config, UPDATE); - geometry[MESH_0]->SetMaxLength(config); - - /*--- Update the multigrid structure after setting up the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - iMeshFine = iMesh-1; - geometry[iMesh]->SetControlVolume(config, geometry[iMeshFine], UPDATE); - geometry[iMesh]->SetBoundControlVolume(config, geometry[iMeshFine],UPDATE); - geometry[iMesh]->SetCoord(geometry[iMeshFine]); - geometry[iMesh]->SetMaxLength(config); - } - } - - - /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy ---*/ - if (dual_time && dynamic_grid) - Restart_OldGeometry(geometry[MESH_0], config); - - delete [] Coord; - - /*--- Delete the class memory that is used to load the restart. ---*/ - - delete [] Restart_Vars; - delete [] Restart_Data; - Restart_Vars = nullptr; Restart_Data = nullptr; - -} - From afe4928fd4bcda63cb68c519ba422e522c7296f6 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 28 Jan 2021 22:37:55 +0000 Subject: [PATCH 181/326] simplify SetInitialCondition --- .../include/solvers/CFVMFlowSolverBase.inl | 3 +- SU2_CFD/src/drivers/CDriver.cpp | 11 +--- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 58 +------------------ SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 46 ++------------- 4 files changed, 11 insertions(+), 107 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index ff9a7bcbc01d..23d36b66bd37 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -882,7 +882,8 @@ void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ** index = counter*Restart_Vars[1] + skipVars; if (SolutionRestart == nullptr) { - nodes->SetSolution(iPoint_Local, &Restart_Data[index]); + for (iVar = 0; iVar < nVar_Restart; iVar++) + nodes->SetSolution(iPoint_Local, iVar, Restart_Data[index+iVar]); } else { /*--- Used as buffer, allows defaults for nVar > nVar_Restart. ---*/ diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 7ee5c3571587..f8767d114a5b 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2956,10 +2956,8 @@ void CFluidDriver::Preprocess(unsigned long Iter) { config_container[iZone]->SetPhysicalTime(static_cast(Iter)*config_container[iZone]->GetDelta_UnstTimeND()); else config_container[iZone]->SetPhysicalTime(0.0); - } - // /*--- Read the target pressure ---*/ // if (config_container[ZONE_0]->GetInvDesign_Cp() == YES) @@ -2976,14 +2974,7 @@ void CFluidDriver::Preprocess(unsigned long Iter) { if(!fsi) { for (iZone = 0; iZone < nZone; iZone++) { - if ((config_container[iZone]->GetKind_Solver() == EULER) || - (config_container[iZone]->GetKind_Solver() == NAVIER_STOKES) || - (config_container[iZone]->GetKind_Solver() == NEMO_EULER) || - (config_container[iZone]->GetKind_Solver() == NEMO_NAVIER_STOKES) || - (config_container[iZone]->GetKind_Solver() == RANS) || - (config_container[iZone]->GetKind_Solver() == INC_EULER) || - (config_container[iZone]->GetKind_Solver() == INC_NAVIER_STOKES) || - (config_container[iZone]->GetKind_Solver() == INC_RANS)) { + if (config_container[iZone]->GetFluidProblem()) { for (iInst = 0; iInst < nInst[iZone]; iInst++) solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], Iter); } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 55877f298d54..758ba7add8f3 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -815,7 +815,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { - const bool restart = (config->GetRestart() || config->GetRestart_Flow()); + const bool restart = (config->GetRestart() || config->GetRestart_Flow()); const bool rans = (config->GetKind_Turb_Model() != NONE); const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == DT_STEPPING_2ND)); @@ -824,10 +824,8 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve SU2_OMP_PARALLEL { - unsigned long iPoint, Point_Fine; - unsigned short iMesh, iChildren, iVar; - su2double Area_Children, Area_Parent; - const su2double *Solution_Fine; + unsigned long iPoint; + unsigned short iMesh; /*--- Check if a verification solution is to be computed. ---*/ if ((VerificationSolution) && (TimeIter == 0) && !restart) { @@ -851,56 +849,6 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve } } - /*--- If restart solution, then interpolate the flow solution to - all the multigrid levels, this is important with the dual time strategy ---*/ - - if (restart && (TimeIter == 0)) { - - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - su2double Solution[MAXNVAR] = {0.0}; - for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { - Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); - Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); - Solution_Fine = solver_container[iMesh-1][FLOW_SOL]->GetNodes()->GetSolution(Point_Fine); - for (iVar = 0; iVar < nVar; iVar++) { - Solution[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; - } - } - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint,Solution); - } - solver_container[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); - solver_container[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); - } - - /*--- Interpolate the turblence variable also, if needed ---*/ - - if (rans) { - - unsigned short nVar_Turb = solver_container[MESH_0][TURB_SOL]->GetnVar(); - for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Area_Parent = geometry[iMesh]->nodes->GetVolume(iPoint); - su2double Solution[MAXNVAR] = {0.0}; - for (iChildren = 0; iChildren < geometry[iMesh]->nodes->GetnChildren_CV(iPoint); iChildren++) { - Point_Fine = geometry[iMesh]->nodes->GetChildren_CV(iPoint, iChildren); - Area_Children = geometry[iMesh-1]->nodes->GetVolume(Point_Fine); - Solution_Fine = solver_container[iMesh-1][TURB_SOL]->GetNodes()->GetSolution(Point_Fine); - for (iVar = 0; iVar < nVar_Turb; iVar++) { - Solution[iVar] += Solution_Fine[iVar]*Area_Children/Area_Parent; - } - } - solver_container[iMesh][TURB_SOL]->GetNodes()->SetSolution(iPoint,Solution); - } - solver_container[iMesh][TURB_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION_EDDY); - solver_container[iMesh][TURB_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION_EDDY); - solver_container[iMesh][TURB_SOL]->Postprocessing(geometry[iMesh], solver_container[iMesh], config, iMesh); - } - } - } - /*--- The value of the solution for the first iteration of the dual time ---*/ if (dual_time && (TimeIter == 0 || (restart && TimeIter == config->GetRestart_Iter()))) { diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 41c7ceef606c..b5d43187da14 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -286,54 +286,18 @@ CNEMOEulerSolver::~CNEMOEulerSolver(void) { void CNEMOEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { - unsigned long iPoint; - unsigned short iMesh; const bool restart = (config->GetRestart() || config->GetRestart_Flow()); const bool rans = false; const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == DT_STEPPING_2ND)); + /*--- Make sure that the solution is well initialized for unsteady calculations + * with dual time-stepping (load additional restarts for 2nd-order). ---*/ - /*--- Make sure that the solution is well initialized for unsteady - calculations with dual time-stepping (load additional restarts for 2nd-order). ---*/ - - if (dual_time && (TimeIter == 0 || (restart && TimeIter == config->GetRestart_Iter())) ) { - - /*--- Push back the initial condition to previous solution containers - for a 1st-order restart or when simply intitializing to freestream. ---*/ - - for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - solver_container[iMesh][FLOW_SOL]->GetNodes()->Set_Solution_time_n(); - solver_container[iMesh][FLOW_SOL]->GetNodes()->Set_Solution_time_n1(); - if (rans) { - solver_container[iMesh][TURB_SOL]->GetNodes()->Set_Solution_time_n(); - solver_container[iMesh][TURB_SOL]->GetNodes()->Set_Solution_time_n1(); - } - } - } - - if ((restart && TimeIter == config->GetRestart_Iter()) && - (config->GetTime_Marching() == DT_STEPPING_2ND)) { - - /*--- Load an additional restart file for a 2nd-order restart ---*/ - solver_container[MESH_0][FLOW_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), true); - - /*--- Load an additional restart file for the turbulence model ---*/ - if (rans) - solver_container[MESH_0][TURB_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), false); - - /*--- Push back this new solution to time level N. ---*/ - - for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - solver_container[iMesh][FLOW_SOL]->GetNodes()->Set_Solution_time_n(); - if (rans) - solver_container[iMesh][TURB_SOL]->GetNodes()->Set_Solution_time_n(); - } - } - } + if (dual_time && ((TimeIter == 0) || (restart && (TimeIter == config->GetRestart_Iter()))) ) { + PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); } + } void CNEMOEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, From a7e66950803ac162ecbcfe62987915277c56bb13 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 29 Jan 2021 10:25:36 +0000 Subject: [PATCH 182/326] even cleaner --- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 + .../include/solvers/CFVMFlowSolverBase.hpp | 9 + .../include/solvers/CFVMFlowSolverBase.inl | 48 ++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 12 - SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 9 - SU2_CFD/src/solvers/CEulerSolver.cpp | 212 +++++++----------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 46 ---- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 16 -- 8 files changed, 135 insertions(+), 219 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index b156f6498d91..22857bc2a5f7 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -37,6 +37,8 @@ */ class CEulerSolver : public CFVMFlowSolverBase { protected: + using BaseClass = CFVMFlowSolverBase; + su2double Prandtl_Lam = 0.0, /*!< \brief Laminar Prandtl number. */ Prandtl_Turb = 0.0; /*!< \brief Turbulent Prandtl number. */ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 7c8104869205..36adc6c7c366 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -1093,6 +1093,15 @@ class CFVMFlowSolverBase : public CSolver { */ void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int iter, bool update_geo) override; + /*! + * \brief Set the initial condition for the Euler Equations. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] ExtIter - External iteration. + */ + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) override; + /*! * \brief Compute the gradient of the primitive variables using Green-Gauss method, * and stores the result in the Gradient_Primitive variable. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 23d36b66bd37..2c7b12ba95ce 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1047,6 +1047,54 @@ void CFVMFlowSolverBase::LoadRestart(CGeometry **geometry, CSolver ***solv LoadRestart_impl(geometry, solver, config, iter, update_geo); } +template +void CFVMFlowSolverBase::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, + CConfig *config, unsigned long TimeIter) { + + const bool restart = (config->GetRestart() || config->GetRestart_Flow()); + const bool rans = (config->GetKind_Turb_Model() != NONE); + const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + + /*--- Start OpenMP parallel region. ---*/ + + SU2_OMP_PARALLEL { + + unsigned long iPoint; + unsigned short iMesh; + + /*--- Check if a verification solution is to be computed. ---*/ + if ((VerificationSolution) && (TimeIter == 0) && !restart) { + + /*--- Loop over the multigrid levels. ---*/ + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + + /*--- Loop over all grid points. ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { + + /* Set the pointers to the coordinates and solution of this DOF. */ + const su2double *coor = geometry[iMesh]->nodes->GetCoord(iPoint); + su2double *solDOF = solver_container[iMesh][FLOW_SOL]->GetNodes()->GetSolution(iPoint); + + /* Set the solution in this DOF to the initial condition provided by + the verification solution class. This can be the exact solution, + but this is not necessary. */ + VerificationSolution->GetInitialCondition(coor, solDOF); + } + } + } + + /*--- The value of the solution for the first iteration of the dual time ---*/ + + if (dual_time && (TimeIter == 0 || (restart && TimeIter == config->GetRestart_Iter()))) { + PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); + } + + } // end SU2_OMP_PARALLEL + +} + template void CFVMFlowSolverBase::PushSolutionBackInTime(unsigned long TimeIter, bool restart, bool rans, CSolver*** solver_container, CGeometry** geometry, diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 801c6fe5d86c..73e63183dac1 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -364,18 +364,6 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetRestart() || config->GetRestart_Flow()); - const bool rans = (config->GetKind_Turb_Model() != NONE); - const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); const bool SubsonicEngine = config->GetSubsonicEngine(); - /*--- Start OpenMP parallel region. ---*/ - - SU2_OMP_PARALLEL { - - unsigned long iPoint; - unsigned short iMesh, iDim; - su2double X0[MAXNDIM] = {0.0}, X1[MAXNDIM] = {0.0}, X2[MAXNDIM] = {0.0}, - X1_X0[MAXNDIM] = {0.0}, X2_X0[MAXNDIM] = {0.0}, X2_X1[MAXNDIM] = {0.0}, - CP[MAXNDIM] = {0.0}, Distance, DotCheck, Radius; - - /*--- Check if a verification solution is to be computed. ---*/ - if ((VerificationSolution) && (TimeIter == 0) && !restart) { + /*--- Use default implementation, then add solver-specifics. ---*/ - /*--- Loop over the multigrid levels. ---*/ - for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + BaseClass::SetInitialCondition(geometry, solver_container, config, TimeIter); - /*--- Loop over all grid points. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { + /*--- Set subsonic initial condition for engine intakes at iteration 0 ---*/ - /* Set the pointers to the coordinates and solution of this DOF. */ - const su2double *coor = geometry[iMesh]->nodes->GetCoord(iPoint); - su2double *solDOF = solver_container[iMesh][FLOW_SOL]->GetNodes()->GetSolution(iPoint); + if (!SubsonicEngine || (TimeIter != 0) || restart) return; - /* Set the solution in this DOF to the initial condition provided by - the verification solution class. This can be the exact solution, - but this is not necessary. */ - VerificationSolution->GetInitialCondition(coor, solDOF); - - } - } - } - - /*--- Set subsonic initial condition for engine intakes ---*/ - - if (SubsonicEngine) { - - /*--- Set initial boundary condition at iteration 0 ---*/ + /*--- Start OpenMP parallel region. ---*/ - if ((TimeIter == 0) && (!restart)) { + SU2_OMP_PARALLEL { - su2double Velocity_Cyl[3] = {0.0, 0.0, 0.0}, Velocity_CylND[3] = {0.0, 0.0, 0.0}, Viscosity_Cyl, - Density_Cyl, Density_CylND, Pressure_CylND, ModVel_Cyl, ModVel_CylND, Energy_CylND, - T_ref = 0.0, S = 0.0, Mu_ref = 0.0; - const su2double *Coord, *SubsonicEngine_Cyl, *SubsonicEngine_Values; + unsigned long iPoint; + unsigned short iMesh, iDim; + su2double X0[MAXNDIM] = {0.0}, X1[MAXNDIM] = {0.0}, X2[MAXNDIM] = {0.0}, + X1_X0[MAXNDIM] = {0.0}, X2_X0[MAXNDIM] = {0.0}, X2_X1[MAXNDIM] = {0.0}, + CP[MAXNDIM] = {0.0}, Distance, DotCheck, Radius; - SubsonicEngine_Values = config->GetSubsonicEngine_Values(); - su2double Mach_Cyl = SubsonicEngine_Values[0]; - su2double Alpha_Cyl = SubsonicEngine_Values[1]; - su2double Beta_Cyl = SubsonicEngine_Values[2]; - su2double Pressure_Cyl = SubsonicEngine_Values[3]; - su2double Temperature_Cyl = SubsonicEngine_Values[4]; + su2double Velocity_Cyl[MAXNDIM] = {0.0}, Velocity_CylND[MAXNDIM] = {0.0}, Viscosity_Cyl, + Density_Cyl, Density_CylND, Pressure_CylND, ModVel_Cyl, ModVel_CylND, Energy_CylND, + T_ref = 0.0, S = 0.0, Mu_ref = 0.0; + const su2double *Coord, *SubsonicEngine_Cyl, *SubsonicEngine_Values; - su2double Alpha = Alpha_Cyl*PI_NUMBER/180.0; - su2double Beta = Beta_Cyl*PI_NUMBER/180.0; + SubsonicEngine_Values = config->GetSubsonicEngine_Values(); + su2double Mach_Cyl = SubsonicEngine_Values[0]; + su2double Alpha_Cyl = SubsonicEngine_Values[1]; + su2double Beta_Cyl = SubsonicEngine_Values[2]; + su2double Pressure_Cyl = SubsonicEngine_Values[3]; + su2double Temperature_Cyl = SubsonicEngine_Values[4]; - su2double Gamma_Minus_One = Gamma - 1.0; - su2double Gas_Constant = config->GetGas_Constant(); + su2double Alpha = Alpha_Cyl*PI_NUMBER/180.0; + su2double Beta = Beta_Cyl*PI_NUMBER/180.0; - su2double Mach2Vel_Cyl = sqrt(Gamma*Gas_Constant*Temperature_Cyl); + su2double Gamma_Minus_One = Gamma - 1.0; + su2double Gas_Constant = config->GetGas_Constant(); - for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + su2double Mach2Vel_Cyl = sqrt(Gamma*Gas_Constant*Temperature_Cyl); - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { - Velocity_Cyl[0] = cos(Alpha)*cos(Beta)*Mach_Cyl*Mach2Vel_Cyl; - Velocity_Cyl[1] = sin(Beta)*Mach_Cyl*Mach2Vel_Cyl; - Velocity_Cyl[2] = sin(Alpha)*cos(Beta)*Mach_Cyl*Mach2Vel_Cyl; + auto FlowNodes = solver_container[iMesh][FLOW_SOL]->GetNodes(); - ModVel_Cyl = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - ModVel_Cyl += Velocity_Cyl[iDim]*Velocity_Cyl[iDim]; - } - ModVel_Cyl = sqrt(ModVel_Cyl); - - if (config->GetViscous()) { - if (config->GetSystemMeasurements() == SI) { T_ref = 273.15; S = 110.4; Mu_ref = 1.716E-5; } - if (config->GetSystemMeasurements() == US) { - T_ref = (273.15 - 273.15) * 1.8 + 491.67; - S = (110.4 - 273.15) * 1.8 + 491.67; - Mu_ref = 1.716E-5/47.88025898; - } - Viscosity_Cyl = Mu_ref*(pow(Temperature_Cyl/T_ref, 1.5) * (T_ref+S)/(Temperature_Cyl+S)); - Density_Cyl = config->GetReynolds()*Viscosity_Cyl/(ModVel_Cyl*config->GetLength_Reynolds()); - Pressure_Cyl = Density_Cyl*Gas_Constant*Temperature_Cyl; - } - else { - Density_Cyl = Pressure_Cyl/(Gas_Constant*Temperature_Cyl); - } + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - Density_CylND = Density_Cyl/config->GetDensity_Ref(); - Pressure_CylND = Pressure_Cyl/config->GetPressure_Ref(); + Velocity_Cyl[0] = cos(Alpha)*cos(Beta)*Mach_Cyl*Mach2Vel_Cyl; + Velocity_Cyl[1] = sin(Beta)*Mach_Cyl*Mach2Vel_Cyl; + Velocity_Cyl[2] = sin(Alpha)*cos(Beta)*Mach_Cyl*Mach2Vel_Cyl; - for (iDim = 0; iDim < nDim; iDim++) { - Velocity_CylND[iDim] = Velocity_Cyl[iDim]/config->GetVelocity_Ref(); - } + ModVel_Cyl = GeometryToolbox::Norm(nDim, Velocity_Cyl); - ModVel_CylND = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - ModVel_CylND += Velocity_CylND[iDim]*Velocity_CylND[iDim]; + if (config->GetViscous()) { + if (config->GetSystemMeasurements() == SI) { T_ref = 273.15; S = 110.4; Mu_ref = 1.716E-5; } + if (config->GetSystemMeasurements() == US) { + T_ref = (273.15 - 273.15) * 1.8 + 491.67; + S = (110.4 - 273.15) * 1.8 + 491.67; + Mu_ref = 1.716E-5/47.88025898; } - ModVel_CylND = sqrt(ModVel_CylND); - - Energy_CylND = Pressure_CylND/(Density_CylND*Gamma_Minus_One)+0.5*ModVel_CylND*ModVel_CylND; + Viscosity_Cyl = Mu_ref*(pow(Temperature_Cyl/T_ref, 1.5) * (T_ref+S)/(Temperature_Cyl+S)); + Density_Cyl = config->GetReynolds()*Viscosity_Cyl/(ModVel_Cyl*config->GetLength_Reynolds()); + Pressure_Cyl = Density_Cyl*Gas_Constant*Temperature_Cyl; + } + else { + Density_Cyl = Pressure_Cyl/(Gas_Constant*Temperature_Cyl); + } - Coord = geometry[iMesh]->nodes->GetCoord(iPoint); + Density_CylND = Density_Cyl/config->GetDensity_Ref(); + Pressure_CylND = Pressure_Cyl/config->GetPressure_Ref(); - SubsonicEngine_Cyl = config->GetSubsonicEngine_Cyl(); + for (iDim = 0; iDim < nDim; iDim++) { + Velocity_CylND[iDim] = Velocity_Cyl[iDim]/config->GetVelocity_Ref(); + } - X0[0] = Coord[0]; X0[1] = Coord[1]; X0[2] = Coord[2]; - X1[0] = SubsonicEngine_Cyl[0]; X1[1] = SubsonicEngine_Cyl[1]; X1[2] = SubsonicEngine_Cyl[2]; - X2[0] = SubsonicEngine_Cyl[3]; X2[1] = SubsonicEngine_Cyl[4]; X2[2] = SubsonicEngine_Cyl[5]; - Radius = SubsonicEngine_Cyl[6]; + ModVel_CylND = GeometryToolbox::Norm(nDim, Velocity_CylND); - for (iDim = 0; iDim < nDim; iDim++) { - X2_X1[iDim]= X1[iDim] - X2[iDim]; - X1_X0[iDim]= X0[iDim] - X1[iDim]; - X2_X0[iDim]= X0[iDim] - X2[iDim]; - } + Energy_CylND = Pressure_CylND/(Density_CylND*Gamma_Minus_One)+0.5*ModVel_CylND*ModVel_CylND; - CP[0] = (X2_X1[1]*X1_X0[2] - X2_X1[2]*X1_X0[1]); - CP[1] = (X2_X1[2]*X1_X0[0] - X2_X1[0]*X1_X0[2]); - CP[2] = (X2_X1[0]*X1_X0[1] - X2_X1[1]*X1_X0[0]); + Coord = geometry[iMesh]->nodes->GetCoord(iPoint); - Distance = sqrt((CP[0]*CP[0]+CP[1]*CP[1]+CP[2]*CP[2])/(X2_X1[0]*X2_X1[0]+X2_X1[1]*X2_X1[1]+X2_X1[2]*X2_X1[2])); + SubsonicEngine_Cyl = config->GetSubsonicEngine_Cyl(); - DotCheck = -(X1_X0[0]*X2_X1[0]+X1_X0[1]*X2_X1[1]+X1_X0[2]*X2_X1[2]); - if (DotCheck < 0.0) Distance = sqrt(X1_X0[0]*X1_X0[0]+X1_X0[1]*X1_X0[1]+X1_X0[2]*X1_X0[2]); + X0[0] = Coord[0]; X0[1] = Coord[1]; if (nDim==3) X0[2] = Coord[2]; + X1[0] = SubsonicEngine_Cyl[0]; X1[1] = SubsonicEngine_Cyl[1]; X1[2] = SubsonicEngine_Cyl[2]; + X2[0] = SubsonicEngine_Cyl[3]; X2[1] = SubsonicEngine_Cyl[4]; X2[2] = SubsonicEngine_Cyl[5]; + Radius = SubsonicEngine_Cyl[6]; - DotCheck = (X2_X0[0]*X2_X1[0]+X2_X0[1]*X2_X1[1]+X2_X0[2]*X2_X1[2]); - if (DotCheck < 0.0) Distance = sqrt(X2_X0[0]*X2_X0[0]+X2_X0[1]*X2_X0[1]+X2_X0[2]*X2_X0[2]); + GeometryToolbox::Distance(3, X1, X2, X2_X1); + GeometryToolbox::Distance(3, X0, X1, X1_X0); + GeometryToolbox::Distance(3, X0, X2, X2_X0); - if (Distance < Radius) { + GeometryToolbox::CrossProduct(X2_X1, X1_X0, CP); - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint, 0, Density_CylND); - for (iDim = 0; iDim < nDim; iDim++) - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint, iDim+1, Density_CylND*Velocity_CylND[iDim]); - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution(iPoint, nVar-1, Density_CylND*Energy_CylND); + Distance = sqrt(GeometryToolbox::SquaredNorm(3,CP) / GeometryToolbox::SquaredNorm(3,X2_X1)); - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution_Old(iPoint, 0, Density_CylND); - for (iDim = 0; iDim < nDim; iDim++) - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution_Old(iPoint, iDim+1, Density_CylND*Velocity_CylND[iDim]); - solver_container[iMesh][FLOW_SOL]->GetNodes()->SetSolution_Old(iPoint, nVar-1, Density_CylND*Energy_CylND); + DotCheck = -GeometryToolbox::DotProduct(3, X1_X0, X2_X1); + if (DotCheck < 0.0) Distance = GeometryToolbox::Norm(3, X1_X0); - } + DotCheck = GeometryToolbox::DotProduct(3, X2_X0, X2_X1); + if (DotCheck < 0.0) Distance = GeometryToolbox::Norm(3, X2_X0); + if (Distance < Radius) { + FlowNodes->SetSolution(iPoint, 0, Density_CylND); + for (iDim = 0; iDim < nDim; iDim++) + FlowNodes->SetSolution(iPoint, iDim+1, Density_CylND*Velocity_CylND[iDim]); + FlowNodes->SetSolution(iPoint, nVar-1, Density_CylND*Energy_CylND); } - /*--- Set the MPI communication ---*/ - - solver_container[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION); - solver_container[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION); - - solver_container[iMesh][FLOW_SOL]->InitiateComms(geometry[iMesh], config, SOLUTION_OLD); - solver_container[iMesh][FLOW_SOL]->CompleteComms(geometry[iMesh], config, SOLUTION_OLD); - } - } - - } + FlowNodes->Set_OldSolution(); - /*--- Make sure that the solution is well initialized for unsteady - calculations with dual time-stepping (load additional restarts for 2nd-order). ---*/ - - if (dual_time && ((TimeIter == 0) || (restart && (TimeIter == config->GetRestart_Iter()))) ) { - PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); - } + } } // end SU2_OMP_PARALLEL diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 758ba7add8f3..da1586ad0f05 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -813,52 +813,6 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i } -void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { - - const bool restart = (config->GetRestart() || config->GetRestart_Flow()); - const bool rans = (config->GetKind_Turb_Model() != NONE); - const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - - /*--- Start OpenMP parallel region. ---*/ - - SU2_OMP_PARALLEL { - - unsigned long iPoint; - unsigned short iMesh; - - /*--- Check if a verification solution is to be computed. ---*/ - if ((VerificationSolution) && (TimeIter == 0) && !restart) { - - /*--- Loop over the multigrid levels. ---*/ - for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { - - /*--- Loop over all grid points. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - - /* Set the pointers to the coordinates and solution of this DOF. */ - const su2double *coor = geometry[iMesh]->nodes->GetCoord(iPoint); - su2double *solDOF = solver_container[iMesh][FLOW_SOL]->GetNodes()->GetSolution(iPoint); - - /* Set the solution in this DOF to the initial condition provided by - the verification solution class. This can be the exact solution, - but this is not necessary. */ - VerificationSolution->GetInitialCondition(coor, solDOF); - } - } - } - - /*--- The value of the solution for the first iteration of the dual time ---*/ - - if (dual_time && (TimeIter == 0 || (restart && TimeIter == config->GetRestart_Iter()))) { - PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); - } - - } // end SU2_OMP_PARALLEL - -} - void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index b5d43187da14..91bfd62f20dc 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -284,22 +284,6 @@ CNEMOEulerSolver::~CNEMOEulerSolver(void) { } -void CNEMOEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { - - const bool restart = (config->GetRestart() || config->GetRestart_Flow()); - const bool rans = false; - const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - - /*--- Make sure that the solution is well initialized for unsteady calculations - * with dual time-stepping (load additional restarts for 2nd-order). ---*/ - - if (dual_time && ((TimeIter == 0) || (restart && (TimeIter == config->GetRestart_Iter()))) ) { - PushSolutionBackInTime(TimeIter, restart, rans, solver_container, geometry, config); - } - -} - void CNEMOEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { From f3ce5bb7ac5939b99f0f433574a3abc2676d8477 Mon Sep 17 00:00:00 2001 From: Alessandro Gastaldi Date: Fri, 29 Jan 2021 17:05:46 +0100 Subject: [PATCH 183/326] Replace global MPI_COMM_WORLD with SU2_MPI::GetComm() where appropriate --- .../include/linear_algebra/CPastixWrapper.hpp | 2 +- Common/include/linear_algebra/CSysVector.hpp | 2 +- .../toolboxes/CQuasiNewtonInvLeastSquares.hpp | 4 +- Common/src/CConfig.cpp | 42 ++-- Common/src/adt/CADTElemClass.cpp | 22 +- Common/src/adt/CADTPointsOnlyClass.cpp | 14 +- Common/src/fem/fem_geometry_structure.cpp | 94 ++++---- .../src/fem/geometry_structure_fem_part.cpp | 154 ++++++------ Common/src/geometry/CGeometry.cpp | 72 +++--- Common/src/geometry/CMultiGridGeometry.cpp | 8 +- Common/src/geometry/CPhysicalGeometry.cpp | 224 +++++++++--------- .../meshreader/CCGNSMeshReaderFVM.cpp | 30 +-- Common/src/graph_coloring_structure.cpp | 16 +- Common/src/grid_movement/CSurfaceMovement.cpp | 36 +-- .../src/grid_movement/CVolumetricMovement.cpp | 12 +- .../interface_interpolation/CInterpolator.cpp | 62 ++--- .../CIsoparametric.cpp | 6 +- .../src/interface_interpolation/CMirror.cpp | 18 +- .../CNearestNeighbor.cpp | 6 +- .../CRadialBasisFunction.cpp | 16 +- Common/src/linear_algebra/CPastixWrapper.cpp | 4 +- Common/src/linear_algebra/CSysMatrix.cpp | 4 +- SU2_CFD/include/limiters/CLimiterDetails.hpp | 4 +- .../include/solvers/CFVMFlowSolverBase.inl | 16 +- SU2_CFD/src/CMarkerProfileReaderFVM.cpp | 12 +- SU2_CFD/src/definition_structure.cpp | 16 +- .../src/drivers/CDiscAdjMultizoneDriver.cpp | 2 +- .../src/drivers/CDiscAdjSinglezoneDriver.cpp | 2 +- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- SU2_CFD/src/drivers/CSinglezoneDriver.cpp | 2 +- SU2_CFD/src/integration/CIntegration.cpp | 6 +- SU2_CFD/src/interfaces/CInterface.cpp | 28 +-- SU2_CFD/src/output/CFlowOutput.cpp | 30 +-- SU2_CFD/src/output/COutput.cpp | 6 +- .../src/output/filewriter/CCSVFileWriter.cpp | 8 +- .../src/output/filewriter/CFEMDataSorter.cpp | 2 +- .../src/output/filewriter/CFVMDataSorter.cpp | 10 +- .../output/filewriter/CParallelDataSorter.cpp | 18 +- .../output/filewriter/CParallelFileWriter.cpp | 6 +- .../output/filewriter/CParaviewFileWriter.cpp | 26 +- .../src/output/filewriter/CSTLFileWriter.cpp | 12 +- .../src/output/filewriter/CSU2FileWriter.cpp | 2 +- .../output/filewriter/CSU2MeshFileWriter.cpp | 6 +- .../filewriter/CSurfaceFEMDataSorter.cpp | 16 +- .../filewriter/CSurfaceFVMDataSorter.cpp | 40 ++-- .../filewriter/CTecplotBinaryFileWriter.cpp | 24 +- .../output/filewriter/CTecplotFileWriter.cpp | 6 +- .../src/output/output_structure_legacy.cpp | 86 +++---- SU2_CFD/src/python_wrapper_structure.cpp | 6 +- SU2_CFD/src/solvers/CAdjEulerSolver.cpp | 50 ++-- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 14 +- SU2_CFD/src/solvers/CAdjTurbSolver.cpp | 2 +- SU2_CFD/src/solvers/CBaselineSolver.cpp | 10 +- SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp | 12 +- SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp | 12 +- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 24 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 126 +++++----- SU2_CFD/src/solvers/CFEASolver.cpp | 34 +-- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 66 +++--- SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp | 8 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 34 +-- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 28 +-- SU2_CFD/src/solvers/CIncNSSolver.cpp | 22 +- SU2_CFD/src/solvers/CMeshSolver.cpp | 10 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 14 +- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 4 +- SU2_CFD/src/solvers/CNSSolver.cpp | 8 +- SU2_CFD/src/solvers/CRadP1Solver.cpp | 4 +- SU2_CFD/src/solvers/CSolver.cpp | 38 +-- 69 files changed, 881 insertions(+), 881 deletions(-) diff --git a/Common/include/linear_algebra/CPastixWrapper.hpp b/Common/include/linear_algebra/CPastixWrapper.hpp index 3f7a87ecf5f6..bb42f4a4f0ba 100644 --- a/Common/include/linear_algebra/CPastixWrapper.hpp +++ b/Common/include/linear_algebra/CPastixWrapper.hpp @@ -93,7 +93,7 @@ class CPastixWrapper * \brief Run the external solver for the task it is currently setup to execute. */ void Run() { - dpastix(&state, MPI_COMM_WORLD, nCols, colptr.data(), rowidx.data(), values.data(), + dpastix(&state, SU2_MPI::GetComm(), nCols, colptr.data(), rowidx.data(), values.data(), loc2glb.data(), perm.data(), NULL, workvec.data(), 1, iparm, dparm); } diff --git a/Common/include/linear_algebra/CSysVector.hpp b/Common/include/linear_algebra/CSysVector.hpp index 2896b8ea8784..405f8c030380 100644 --- a/Common/include/linear_algebra/CSysVector.hpp +++ b/Common/include/linear_algebra/CSysVector.hpp @@ -315,7 +315,7 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> SU2_OMP_MASTER { sum = dotRes; const auto mpi_type = (sizeof(ScalarType) < sizeof(double)) ? MPI_FLOAT : MPI_DOUBLE; - SelectMPIWrapper::W::Allreduce(&sum, &dotRes, 1, mpi_type, MPI_SUM, MPI_COMM_WORLD); + SelectMPIWrapper::W::Allreduce(&sum, &dotRes, 1, mpi_type, MPI_SUM, SU2_MPI::GetComm()); } } #endif diff --git a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp index cbd5f192a811..645616b62740 100644 --- a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp +++ b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp @@ -95,11 +95,11 @@ class CQuasiNewtonInvLeastSquares { su2vector tmp(mat.size()); MPI_Wrapper::Allreduce(mat.data(), tmp.data(), iSample*(iSample+1)/2, - type, MPI_SUM, MPI_COMM_WORLD); + type, MPI_SUM, SU2_MPI::GetComm()); mat = std::move(tmp); MPI_Wrapper::Allreduce(rhs.data(), sol.data(), iSample, - type, MPI_SUM, MPI_COMM_WORLD); + type, MPI_SUM, SU2_MPI::GetComm()); std::swap(rhs, sol); } } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 6dabd4d63115..2018f936cbac 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -5011,7 +5011,7 @@ void CConfig::SetMarkers(unsigned short val_software) { #ifdef HAVE_MPI if (val_software != SU2_MSH) - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); #endif /*--- Compute the total number of markers in the config file ---*/ @@ -9334,8 +9334,8 @@ void CConfig::SetProfilingCSV(void) { int rank = MASTER_NODE; int size = SINGLE_NODE; #ifdef HAVE_MPI - SU2_MPI::Comm_rank(MPI_COMM_WORLD, &rank); - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); #endif /*--- Each rank has the same stack trace, so the they have the same @@ -9419,11 +9419,11 @@ void CConfig::SetProfilingCSV(void) { } #ifdef HAVE_MPI - MPI_Reduce(n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - MPI_Reduce(l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - MPI_Reduce(l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - MPI_Reduce(l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - MPI_Reduce(l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); + MPI_Reduce(n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + MPI_Reduce(l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + MPI_Reduce(l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + MPI_Reduce(l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + MPI_Reduce(l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); #else memcpy(n_calls_red, n_calls, map_size*sizeof(int)); memcpy(l_tot_red, l_tot, map_size*sizeof(double)); @@ -9557,8 +9557,8 @@ void CConfig::GEMMProfilingCSV(void) { /* Parallel executable. The profiling data must be sent to the master node. First determine the rank and size. */ int size; - SU2_MPI::Comm_rank(MPI_COMM_WORLD, &rank); - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /* Check for the master node. */ if(rank == MASTER_NODE) { @@ -9569,7 +9569,7 @@ void CConfig::GEMMProfilingCSV(void) { /* Block until a message from this processor arrives. Determine the number of entries in the receive buffers. */ SU2_MPI::Status status; - SU2_MPI::Probe(proc, 0, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(proc, 0, SU2_MPI::GetComm(), &status); int nEntries; SU2_MPI::Get_count(&status, MPI_LONG, &nEntries); @@ -9583,15 +9583,15 @@ void CConfig::GEMMProfilingCSV(void) { vector recvBufMNK(3*nEntries); SU2_MPI::Recv(recvBufNCalls.data(), recvBufNCalls.size(), - MPI_LONG, proc, 0, MPI_COMM_WORLD, &status); + MPI_LONG, proc, 0, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(recvBufTotTime.data(), recvBufTotTime.size(), - MPI_DOUBLE, proc, 1, MPI_COMM_WORLD, &status); + MPI_DOUBLE, proc, 1, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(recvBufMinTime.data(), recvBufMinTime.size(), - MPI_DOUBLE, proc, 2, MPI_COMM_WORLD, &status); + MPI_DOUBLE, proc, 2, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(recvBufMaxTime.data(), recvBufMaxTime.size(), - MPI_DOUBLE, proc, 3, MPI_COMM_WORLD, &status); + MPI_DOUBLE, proc, 3, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(recvBufMNK.data(), recvBufMNK.size(), - MPI_LONG, proc, 4, MPI_COMM_WORLD, &status); + MPI_LONG, proc, 4, SU2_MPI::GetComm(), &status); /* Loop over the number of entries. */ for(int i=0; i recvCounts(size), displs(size); int sizeLocal = (int) val_coor.size(); SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, MPI_COMM_WORLD); + MPI_INT, SU2_MPI::GetComm()); displs[0] = 0; for(int i=1; i recvCounts(size), displs(size); int sizeLocal = (int) nPoints; SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, MPI_COMM_WORLD); + MPI_INT, SU2_MPI::GetComm()); displs[0] = 0; for(int i=1; i rankLocal(sizeLocal, rank); SU2_MPI::Allgatherv(rankLocal.data(), sizeLocal, MPI_INT, ranksOfPoints.data(), - recvCounts.data(), displs.data(), MPI_INT, MPI_COMM_WORLD); + recvCounts.data(), displs.data(), MPI_INT, SU2_MPI::GetComm()); /*--- Gather the coordinates of the points on all ranks. ---*/ for(int i=0; i sizeRecv(size, 1); SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- Loop over the local elements to fill the communication buffers with element data. ---*/ @@ -468,11 +468,11 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { int dest = MI->first; SU2_MPI::Isend(shortSendBuf[i].data(), shortSendBuf[i].size(), MPI_SHORT, - dest, dest, MPI_COMM_WORLD, &commReqs[3*i]); + dest, dest, SU2_MPI::GetComm(), &commReqs[3*i]); SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest+1, MPI_COMM_WORLD, &commReqs[3*i+1]); + dest, dest+1, SU2_MPI::GetComm(), &commReqs[3*i+1]); SU2_MPI::Isend(doubleSendBuf[i].data(), doubleSendBuf[i].size(), MPI_DOUBLE, - dest, dest+2, MPI_COMM_WORLD, &commReqs[3*i+2]); + dest, dest+2, SU2_MPI::GetComm(), &commReqs[3*i+2]); } /* Loop over the number of ranks from which I receive data. */ @@ -481,7 +481,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Block until a message with shorts arrives from any processor. Determine the source and the size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -490,24 +490,24 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Allocate the memory for the short receive buffer and receive the message. */ shortRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(shortRecvBuf[i].data(), sizeMess, MPI_SHORT, - source, rank, MPI_COMM_WORLD, &status); + source, rank, SU2_MPI::GetComm(), &status); /* Block until the corresponding message with longs arrives, determine its size, allocate the memory and receive the message. */ - SU2_MPI::Probe(source, rank+1, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(source, rank+1, SU2_MPI::GetComm(), &status); SU2_MPI::Get_count(&status, MPI_LONG, &sizeMess); longRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(longRecvBuf[i].data(), sizeMess, MPI_LONG, - source, rank+1, MPI_COMM_WORLD, &status); + source, rank+1, SU2_MPI::GetComm(), &status); /* Idem for the message with doubles. */ - SU2_MPI::Probe(source, rank+2, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(source, rank+2, SU2_MPI::GetComm(), &status); SU2_MPI::Get_count(&status, MPI_DOUBLE, &sizeMess); doubleRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(doubleRecvBuf[i].data(), sizeMess, MPI_DOUBLE, - source, rank+2, MPI_COMM_WORLD, &status); + source, rank+2, SU2_MPI::GetComm(), &status); } /* Complete the non-blocking sends. */ @@ -515,7 +515,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else @@ -701,7 +701,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #ifdef HAVE_MPI SU2_MPI::Allreduce(&maxTimeLevelLoc, &maxTimeLevelGlob, - 1, MPI_UNSIGNED_SHORT, MPI_MAX, MPI_COMM_WORLD); + 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); #endif const unsigned short nTimeLevels = maxTimeLevelGlob+1; @@ -763,7 +763,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #ifdef HAVE_MPI SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /* Loop over the local halo elements to fill the communication buffers. */ @@ -808,7 +808,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { for(int i=0; ifirst; SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest, MPI_COMM_WORLD, &commReqs[i]); + dest, dest, SU2_MPI::GetComm(), &commReqs[i]); } /* Loop over the number of ranks from which I receive data. */ @@ -817,7 +817,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Block until a message with longs arrives from any processor. Determine the source and the size of the message and receive it. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); sourceRank[i] = status.MPI_SOURCE; int sizeMess; @@ -825,7 +825,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { longSecondRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(longSecondRecvBuf[i].data(), sizeMess, MPI_LONG, - sourceRank[i], rank, MPI_COMM_WORLD, &status); + sourceRank[i], rank, SU2_MPI::GetComm(), &status); } /* Complete the non-blocking sends. */ @@ -895,7 +895,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #ifdef HAVE_MPI int dest = sourceRank[i]; SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest+1, MPI_COMM_WORLD, &commReqs[i]); + dest, dest+1, SU2_MPI::GetComm(), &commReqs[i]); #endif } @@ -914,7 +914,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Block until a message with longs arrives from any processor. Determine the source and the size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -923,13 +923,13 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Allocate the memory for the long receive buffer and receive the message. */ longSecondRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(longSecondRecvBuf[i].data(), sizeMess, MPI_LONG, - source, rank+1, MPI_COMM_WORLD, &status); + source, rank+1, SU2_MPI::GetComm(), &status); } /* Complete the non-blocking sends and synchronize the ranks, because wild cards have been used. */ SU2_MPI::Waitall(nRankRecv, commReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else @@ -1000,7 +1000,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #ifdef HAVE_MPI SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /* Copy the data to be sent to the send buffers. */ @@ -1030,7 +1030,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { for(int i=0; ifirst; SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest, MPI_COMM_WORLD, &commReqs[i]); + dest, dest, SU2_MPI::GetComm(), &commReqs[i]); } /* Resize the vector to store the ranks from which the message came. */ @@ -1042,7 +1042,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Block until a message with longs arrives from any processor. Determine the source and the size of the message and receive it. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); sourceRank[i] = status.MPI_SOURCE; int sizeMess; @@ -1050,13 +1050,13 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { longSecondRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(longSecondRecvBuf[i].data(), sizeMess, MPI_LONG, - sourceRank[i], rank, MPI_COMM_WORLD, &status); + sourceRank[i], rank, SU2_MPI::GetComm(), &status); } /* Complete the non-blocking sends and synchronize the ranks, because wild cards have been used. */ SU2_MPI::Waitall(nRankSend, commReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else @@ -1215,7 +1215,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { unsigned long nRanksTooManyPartChunks = tooManyPartChunksLoc; #ifdef HAVE_MPI SU2_MPI::Reduce(&tooManyPartChunksLoc, &nRanksTooManyPartChunks, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); #endif if((rank == MASTER_NODE) && (nRanksTooManyPartChunks != 0) && (size > 1)) { @@ -1404,7 +1404,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { unsigned long nEmptyPartitions = 0; SU2_MPI::Reduce(&thisPartitionEmpty, &nEmptyPartitions, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); if(rank == MASTER_NODE && nEmptyPartitions) { cout << endl << " WARNING" << endl; @@ -1671,11 +1671,11 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #ifdef HAVE_MPI int dest = sourceRank[i]; SU2_MPI::Isend(shortSendBuf[i].data(), shortSendBuf[i].size(), MPI_SHORT, - dest, dest+1, MPI_COMM_WORLD, &commReqs[3*i]); + dest, dest+1, SU2_MPI::GetComm(), &commReqs[3*i]); SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest+2, MPI_COMM_WORLD, &commReqs[3*i+1]); + dest, dest+2, SU2_MPI::GetComm(), &commReqs[3*i+1]); SU2_MPI::Isend(doubleSendBuf[i].data(), doubleSendBuf[i].size(), MPI_DOUBLE, - dest, dest+3, MPI_COMM_WORLD, &commReqs[3*i+2]); + dest, dest+3, SU2_MPI::GetComm(), &commReqs[3*i+2]); #endif } @@ -1700,7 +1700,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Block until a message with shorts arrives from any processor. Determine the source and the size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, SU2_MPI::GetComm(), &status); sourceRank[i] = status.MPI_SOURCE; int sizeMess; @@ -1709,24 +1709,24 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Allocate the memory for the short receive buffer and receive the message. */ shortRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(shortRecvBuf[i].data(), sizeMess, MPI_SHORT, - sourceRank[i], rank+1, MPI_COMM_WORLD, &status); + sourceRank[i], rank+1, SU2_MPI::GetComm(), &status); /* Block until the corresponding message with longs arrives, determine its size, allocate the memory and receive the message. */ - SU2_MPI::Probe(sourceRank[i], rank+2, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(sourceRank[i], rank+2, SU2_MPI::GetComm(), &status); SU2_MPI::Get_count(&status, MPI_LONG, &sizeMess); longRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(longRecvBuf[i].data(), sizeMess, MPI_LONG, - sourceRank[i], rank+2, MPI_COMM_WORLD, &status); + sourceRank[i], rank+2, SU2_MPI::GetComm(), &status); /* Idem for the message with doubles. */ - SU2_MPI::Probe(sourceRank[i], rank+3, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(sourceRank[i], rank+3, SU2_MPI::GetComm(), &status); SU2_MPI::Get_count(&status, MPI_DOUBLE, &sizeMess); doubleRecvBuf[i].resize(sizeMess); SU2_MPI::Recv(doubleRecvBuf[i].data(), sizeMess, MPI_DOUBLE, - sourceRank[i], rank+3, MPI_COMM_WORLD, &status); + sourceRank[i], rank+3, SU2_MPI::GetComm(), &status); } /* Complete the non-blocking sends. */ @@ -1734,7 +1734,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else @@ -2420,7 +2420,7 @@ void CMeshFEM::SetPositive_ZArea(CConfig *config) { #ifdef HAVE_MPI su2double locArea = PositiveZArea; - SU2_MPI::Allreduce(&locArea, &PositiveZArea, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&locArea, &PositiveZArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif /*---------------------------------------------------------------------------*/ @@ -3504,7 +3504,7 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { vector sizeReduce(size, 1); SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeReduce.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Resize ranksSend and the first index of entitiesSend to the number of ranks to which this rank has to send data. */ @@ -3517,7 +3517,7 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { for(unsigned long i=0; i nDOFsPerRank(size); SU2_MPI::Allgather(&nDOFsLoc, 1, MPI_UNSIGNED_LONG, nDOFsPerRank.data(), 1, - MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /* Determine the offset for the DOFs on this rank. */ unsigned long offsetRank = 0; @@ -1184,7 +1184,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, int nRankRecv; vector sizeRecv(size, 1); SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Send out the messages with the global node numbers. Use nonblocking sends to avoid deadlock. ---*/ @@ -1193,7 +1193,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, for(int i=0; i faceRecvBuf(sizeMess); SU2_MPI::Recv(faceRecvBuf.data(), faceRecvBuf.size(), MPI_UNSIGNED_LONG, - source, rank+4, MPI_COMM_WORLD, &status); + source, rank+4, SU2_MPI::GetComm(), &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; @@ -1432,7 +1432,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* Complete the non-blocking sends. Afterwards, synchronize the ranks, because wild cards have been used. */ SU2_MPI::Waitall(sendReqs.size(), sendReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif @@ -1681,7 +1681,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, } SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Send the messages using non-blocking sends to avoid deadlock. ---*/ sendReqs.resize(nRankSend); @@ -1689,7 +1689,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, for(int i=0; i boundElemRecvBuf(sizeMess); SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+5, MPI_COMM_WORLD, &status); + source, rank+5, SU2_MPI::GetComm(), &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; @@ -1783,7 +1783,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, } SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Send the messages using non-blocking sends to avoid deadlock. ---*/ sendReqs.resize(nRankSend); @@ -1791,7 +1791,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, for(int i=0; i boundElemRecvBuf(sizeMess); SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+6, MPI_COMM_WORLD, &status); + source, rank+6, SU2_MPI::GetComm(), &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; @@ -1853,7 +1853,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, because wild cards have been used. */ SU2_MPI::Waitall(sendReqs.size(), sendReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else /*--- Sequential mode. All boundary elements read must be stored on this @@ -2059,7 +2059,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { unsigned long maxPointID; SU2_MPI::Allreduce(&maxPointIDLoc, &maxPointID, 1, MPI_UNSIGNED_LONG, - MPI_MAX, MPI_COMM_WORLD); + MPI_MAX, SU2_MPI::GetComm()); ++maxPointID; /*--- Create a vector with a linear distribution over the ranks for @@ -2126,7 +2126,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { unsigned long nMessRecv; SU2_MPI::Reduce_scatter(counter.data(), &nMessRecv, sizeRecv.data(), - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Send the data using nonblocking sends. ---*/ vector commReqs(max(nMessSend,nMessRecv)); @@ -2137,7 +2137,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { if( nFacesComm[i] ) { unsigned long count = 9*nFacesComm[i]; SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, i, i, - MPI_COMM_WORLD, &commReqs[nMessSend]); + SU2_MPI::GetComm(), &commReqs[nMessSend]); ++nMessSend; indSend += count; } @@ -2151,14 +2151,14 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { nFacesRecv[0] = 0; for(unsigned long i=0; i recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - rankRecv[i], rank, MPI_COMM_WORLD, &status); + rankRecv[i], rank, SU2_MPI::GetComm(), &status); nFacesRecv[i+1] = nFacesRecv[i] + sizeMess/9; facesRecv.resize(nFacesRecv[i+1]); @@ -2237,7 +2237,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { unsigned long count = ii - indSend; SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, rankRecv[i], - rankRecv[i]+1, MPI_COMM_WORLD, &commReqs[i]); + rankRecv[i]+1, SU2_MPI::GetComm(), &commReqs[i]); indSend = ii; } @@ -2246,13 +2246,13 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { The return data contains information about the neighboring element. ---*/ for(unsigned long i=0; i recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - status.MPI_SOURCE, rank+1, MPI_COMM_WORLD, &status); + status.MPI_SOURCE, rank+1, SU2_MPI::GetComm(), &status); sizeMess /= 9; unsigned long jj = 0; @@ -2278,7 +2278,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /*--- Wild cards have been used in the communication, so synchronize the ranks to avoid problems. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif @@ -2310,7 +2310,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { #ifdef HAVE_MPI SU2_MPI::Reduce(&nFacesLocOr, &nNonMatchingFaces, 1, MPI_UNSIGNED_LONG, - MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); #endif if(rank == MASTER_NODE && nNonMatchingFaces) { cout << "There are " << nNonMatchingFaces << " non-matching faces in the grid. " @@ -2568,7 +2568,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { int nRankRecv; vector sizeSend(size, 1); SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeSend.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Send the data using non-blocking sends. */ vector sendReqs(nRankSend); @@ -2576,7 +2576,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { for(int i=0; i recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, MPI_COMM_WORLD, &status); + source, rank, SU2_MPI::GetComm(), &status); /* Loop over the contents of the receive buffer and update the graph accordingly. */ @@ -2610,7 +2610,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /* Complete the non-blocking sends amd synchronize the ranks, because wild cards have been used in the above communication. */ SU2_MPI::Waitall(nRankSend, sendReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif @@ -2687,7 +2687,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { if (rank == MASTER_NODE) cout << "Calling ParMETIS..."; idx_t edgecut; - MPI_Comm comm = MPI_COMM_WORLD; + MPI_Comm comm = SU2_MPI::GetComm(); ParMETIS_V3_PartKway(vtxdist.data(), xadjPar.data(), adjacencyPar.data(), vwgtPar.data(), adjwgtPar.data(), &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec, options, @@ -2843,7 +2843,7 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co int sizeLocal = facesDonor.size(); SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, MPI_COMM_WORLD); + MPI_INT, SU2_MPI::GetComm()); /*--- Create the data for the vector displs from the known values of recvCounts. Also determine the total size of the data. ---*/ @@ -2898,7 +2898,7 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co SU2_MPI::Allgatherv(longLocBuf.data(), longLocBuf.size(), MPI_UNSIGNED_LONG, longGlobBuf.data(), recvCounts.data(), displs.data(), - MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); for(int i=0; i bufBoundaryElemIDGlobalSearch(nGlobalSearchPoints); SU2_MPI::Allgatherv(boundaryElemIDGlobalSearch.data(), nLocalSearchPoints, MPI_UNSIGNED_LONG, bufBoundaryElemIDGlobalSearch.data(), recvCounts.data(), displs.data(), MPI_UNSIGNED_LONG, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); for(int i=0; i bufCoorExGlobalSearch(nDim*nGlobalSearchPoints); SU2_MPI::Allgatherv(coorExGlobalSearch.data(), nDim*nLocalSearchPoints, MPI_DOUBLE, bufCoorExGlobalSearch.data(), recvCounts.data(), displs.data(), MPI_DOUBLE, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); /* Buffers to store the return information. */ vector markerIDReturn; @@ -3878,7 +3878,7 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { int nRankRecv; SU2_MPI::Reduce_scatter(recvCounts.data(), &nRankRecv, displs.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Send the data using nonblocking sends to avoid deadlock. */ vector commReqs(3*nRankSend); @@ -3887,13 +3887,13 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { if( recvCounts[i] ) { const int sizeMessage = nSearchPerRank[i+1] - nSearchPerRank[i]; SU2_MPI::Isend(markerIDReturn.data() + nSearchPerRank[i], - sizeMessage, MPI_UNSIGNED_SHORT, i, i, MPI_COMM_WORLD, + sizeMessage, MPI_UNSIGNED_SHORT, i, i, SU2_MPI::GetComm(), &commReqs[nRankSend++]); SU2_MPI::Isend(boundaryElemIDReturn.data() + nSearchPerRank[i], - sizeMessage, MPI_UNSIGNED_LONG, i, i+1, MPI_COMM_WORLD, + sizeMessage, MPI_UNSIGNED_LONG, i, i+1, SU2_MPI::GetComm(), &commReqs[nRankSend++]); SU2_MPI::Isend(volElemIDDonorReturn.data() + nSearchPerRank[i], - sizeMessage, MPI_UNSIGNED_LONG, i, i+2, MPI_COMM_WORLD, + sizeMessage, MPI_UNSIGNED_LONG, i, i+2, SU2_MPI::GetComm(), &commReqs[nRankSend++]); } } @@ -3904,7 +3904,7 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Block until a message with unsigned shorts arrives from any processor. Determine the source and the size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -3917,13 +3917,13 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Receive the three messages using blocking receives. */ SU2_MPI::Recv(bufMarkerIDReturn.data(), sizeMess, MPI_UNSIGNED_SHORT, - source, rank, MPI_COMM_WORLD, &status); + source, rank, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(bufBoundaryElemIDReturn.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+1, MPI_COMM_WORLD, &status); + source, rank+1, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(bufVolElemIDDonorReturn.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+2, MPI_COMM_WORLD, &status); + source, rank+2, SU2_MPI::GetComm(), &status); /* Loop over the data just received and add it to the wall function donor information of the corresponding boundary element. */ @@ -3941,7 +3941,7 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /* Loop again over the boundary elements of the marker for which a wall function treatment must be used and make remove the multiple entries @@ -4057,7 +4057,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( int nRankRecv; vector sizeSend(size, 1); SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankRecv, sizeSend.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Determine the number of messages this rank will send. */ int nRankSend = 0; @@ -4075,7 +4075,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( sendBufAddExternals[i].erase(lastElem, sendBufAddExternals[i].end()); SU2_MPI::Isend(sendBufAddExternals[i].data(), sendBufAddExternals[i].size(), - MPI_UNSIGNED_LONG, i, i, MPI_COMM_WORLD, &sendReqs[nRankSend++]); + MPI_UNSIGNED_LONG, i, i, SU2_MPI::GetComm(), &sendReqs[nRankSend++]); } } @@ -4086,7 +4086,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /* Block until a message arrives and determine the source and size of the message. Allocate the memory for a receive buffer. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -4094,7 +4094,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( vector recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, MPI_COMM_WORLD, &status); + source, rank, SU2_MPI::GetComm(), &status); /* Loop over the entries of recvBuf and add them to mapExternalElemIDToTimeLevel, if not present already. */ @@ -4109,7 +4109,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /* Complete the non-blocking sends. Synchronize the processors afterwards, because wild cards have been used in the communication. */ SU2_MPI::Waitall(nRankSend, sendReqs.data(), MPI_STATUSES_IGNORE); - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif @@ -4185,7 +4185,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( Only needed for a parallel implementation. */ #ifdef HAVE_MPI su2double locVal = minDeltaT; - SU2_MPI::Allreduce(&locVal, &minDeltaT, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&locVal, &minDeltaT, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); #endif /* Initial estimate of the time level of the owned elements. */ @@ -4244,7 +4244,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( which I will send data. */ nRankRecv = mapRankToIndRecv.size(); SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeSend.data(), - MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Create the vector of vectors of the global element ID's that will be received from other ranks. ---*/ @@ -4282,7 +4282,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( recvElem[i].erase(lastElem, recvElem[i].end()); SU2_MPI::Isend(recvElem[i].data(), recvElem[i].size(), MPI_UNSIGNED_LONG, - MRI->first, MRI->first, MPI_COMM_WORLD, &sendReqs[i]); + MRI->first, MRI->first, SU2_MPI::GetComm(), &sendReqs[i]); } /*--- Receive the messages in arbitrary sequence and store the requested @@ -4294,7 +4294,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( for(int i=0; ifirst, rank, MPI_COMM_WORLD, &status); + MRI->first, rank, SU2_MPI::GetComm(), &status); for(unsigned long j=0; jGetTimeLevel(); SU2_MPI::Isend(sendBuf[i].data(), sendElem[i].size(), MPI_UNSIGNED_SHORT, - sendRank[i], sendRank[i], MPI_COMM_WORLD, &sendReqs[i]); + sendRank[i], sendRank[i], SU2_MPI::GetComm(), &sendReqs[i]); } /*--- Receive the data for the externals. As this data is needed @@ -4568,7 +4568,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( SU2_MPI::Status status; SU2_MPI::Recv(returnBuf[i].data(), recvElem[i].size(), MPI_UNSIGNED_SHORT, - MRI->first, rank, MPI_COMM_WORLD, &status); + MRI->first, rank, SU2_MPI::GetComm(), &status); for(unsigned long j=0; jfirst, MRI->first+1, MPI_COMM_WORLD, &returnReqs[i]); + MRI->first, MRI->first+1, SU2_MPI::GetComm(), &returnReqs[i]); } /* Complete the first round of nonblocking sends, such that the @@ -4594,7 +4594,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( SU2_MPI::Status status; SU2_MPI::Recv(sendBuf[i].data(), sendElem[i].size(), MPI_UNSIGNED_SHORT, - sendRank[i], rank+1, MPI_COMM_WORLD, &status); + sendRank[i], rank+1, SU2_MPI::GetComm(), &status); for(unsigned long j=0; jSetTimeLevel(sendBuf[i][j]); @@ -4625,7 +4625,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( #ifdef HAVE_MPI SU2_MPI::Reduce(nLocalElemPerLevel.data(), nGlobalElemPerLevel.data(), nTimeLevels, MPI_UNSIGNED_LONG, MPI_SUM, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); #endif /* Write the output. */ @@ -4655,7 +4655,7 @@ void CPhysicalGeometry::ComputeFEMGraphWeights( #ifdef HAVE_MPI unsigned short maxTimeLevelLocal = maxTimeLevel; SU2_MPI::Allreduce(&maxTimeLevelLocal, &maxTimeLevel, 1, - MPI_UNSIGNED_SHORT, MPI_MAX, MPI_COMM_WORLD); + MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); #endif /*--------------------------------------------------------------------------*/ @@ -4891,7 +4891,7 @@ void CPhysicalGeometry::ComputeFEMGraphWeights( #ifdef HAVE_MPI su2double locminvwgt = minvwgt; - SU2_MPI::Allreduce(&locminvwgt, &minvwgt, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&locminvwgt, &minvwgt, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); #endif /*--- Scale the workload of the elements, the 1st vertex weight, with the diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 8cfc74f5c24c..8710b45421e6 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -224,7 +224,7 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, - &(nPoint_Recv_All[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -452,11 +452,11 @@ void CGeometry::PostP2PRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Irecv(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, - source, tag, MPI_COMM_WORLD, &(req_P2PRecv[iRecv])); + source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iRecv])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Irecv(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, - source, tag, MPI_COMM_WORLD, &(req_P2PRecv[iRecv])); + source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iRecv])); break; default: SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", @@ -489,11 +489,11 @@ void CGeometry::PostP2PRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Irecv(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, - source, tag, MPI_COMM_WORLD, &(req_P2PRecv[iMessage])); + source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Irecv(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, - source, tag, MPI_COMM_WORLD, &(req_P2PRecv[iMessage])); + source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iMessage])); break; default: SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", @@ -551,11 +551,11 @@ void CGeometry::PostP2PSends(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Isend(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, - dest, tag, MPI_COMM_WORLD, &(req_P2PSend[val_iSend])); + dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Isend(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, - dest, tag, MPI_COMM_WORLD, &(req_P2PSend[val_iSend])); + dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); break; default: SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", @@ -588,11 +588,11 @@ void CGeometry::PostP2PSends(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Isend(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, - dest, tag, MPI_COMM_WORLD, &(req_P2PSend[val_iSend])); + dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Isend(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, - dest, tag, MPI_COMM_WORLD, &(req_P2PSend[val_iSend])); + dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); break; default: SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", @@ -927,7 +927,7 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, many periodic points it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, - &(nPoint_Recv_All[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Check how many messages we will be sending and receiving. Here we also put the counters into cumulative storage format to @@ -1112,7 +1112,7 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, /*--- Post non-blocking recv for this proc. ---*/ SU2_MPI::Irecv(&(static_cast(idRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), &(req_PeriodicRecv[iMessage])); /*--- Increment message counter. ---*/ @@ -1143,7 +1143,7 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, /*--- Post non-blocking send for this proc. ---*/ SU2_MPI::Isend(&(static_cast(idSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), &(req_PeriodicSend[iMessage])); /*--- Increment message counter. ---*/ @@ -1268,12 +1268,12 @@ void CGeometry::PostPeriodicRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Irecv(&(static_cast(bufD_PeriodicRecv)[offset]), - count, MPI_DOUBLE, source, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), &(req_PeriodicRecv[iRecv])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Irecv(&(static_cast(bufS_PeriodicRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), &(req_PeriodicRecv[iRecv])); break; default: @@ -1324,12 +1324,12 @@ void CGeometry::PostPeriodicSends(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Isend(&(static_cast(bufD_PeriodicSend)[offset]), - count, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &(req_PeriodicSend[val_iSend])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Isend(&(static_cast(bufS_PeriodicSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), &(req_PeriodicSend[val_iSend])); break; default: @@ -1991,8 +1991,8 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor Buffer_Send_nEdge[0] = nLocalEdge; - SU2_MPI::Allreduce(&nLocalEdge, &MaxLocalEdge, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_nEdge, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nEdge, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nLocalEdge, &MaxLocalEdge, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nEdge, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nEdge, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); Buffer_Send_Coord = new su2double [MaxLocalEdge*6]; Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalEdge*6]; @@ -2024,9 +2024,9 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor Buffer_Send_GlobalID[iEdge*4 + 3] = JGlobalID_Index1[iEdge]; } - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_Variable, nBuffer_Variable, MPI_DOUBLE, Buffer_Receive_Variable, nBuffer_Variable, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Variable, nBuffer_Variable, MPI_DOUBLE, Buffer_Receive_Variable, nBuffer_Variable, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Clean the vectors before adding the new vertices only to the master node ---*/ @@ -2728,7 +2728,7 @@ void CGeometry::ComputeSurf_Straightness(CConfig *config, /*--- Product of type (bool) is equivalnt to a 'logical and' ---*/ SU2_MPI::Allreduce(Buff_Send_isStraight.data(), Buff_Recv_isStraight.data(), - nMarker_Global, MPI_INT, MPI_PROD, MPI_COMM_WORLD); + nMarker_Global, MPI_INT, MPI_PROD, SU2_MPI::GetComm()); /*--- Print results on screen. ---*/ if(rank == MASTER_NODE) { @@ -2996,9 +2996,9 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { su2double MyMeanK = MeanK; MeanK = 0.0; su2double MyMaxK = MaxK; MaxK = 0.0; unsigned long MynPointDomain = TotalnPointDomain; TotalnPointDomain = 0; - SU2_MPI::Allreduce(&MyMeanK, &MeanK, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyMaxK, &MaxK, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MynPointDomain, &TotalnPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyMeanK, &MeanK, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyMaxK, &MaxK, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MynPointDomain, &TotalnPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Compute the mean ---*/ MeanK /= su2double(TotalnPointDomain); @@ -3017,7 +3017,7 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { } su2double MySigmaK = SigmaK; SigmaK = 0.0; - SU2_MPI::Allreduce(&MySigmaK, &SigmaK, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MySigmaK, &SigmaK, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SigmaK = sqrt(SigmaK/su2double(TotalnPointDomain)); @@ -3052,8 +3052,8 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { /*--- Communicate to all processors the total number of critical edge nodes. ---*/ MaxLocalVertex = 0; - SU2_MPI::Allreduce(&nLocalVertex, &MaxLocalVertex, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nLocalVertex, &MaxLocalVertex, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Create and initialize to zero some buffers to hold the coordinates of the boundary nodes that are communicated from each partition (all-to-all). ---*/ @@ -3071,7 +3071,7 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { Buffer_Send_Coord[iVertex*nDim+iDim] = nodes->GetCoord(iPoint, iDim); } - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer, MPI_DOUBLE, MPI_COMM_WORLD); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer, MPI_DOUBLE, SU2_MPI::GetComm()); /*--- Loop over all interior mesh nodes on the local partition and compute the distances to each of the no-slip boundary nodes in the entire mesh. @@ -3184,15 +3184,15 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, SU2_OMP_MASTER { su2double* dbl_buffer = new su2double [Global_nElemDomain*nDim]; - SU2_MPI::Allreduce(cg_elem,dbl_buffer,Global_nElemDomain*nDim,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(cg_elem,dbl_buffer,Global_nElemDomain*nDim,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); swap(dbl_buffer, cg_elem); delete [] dbl_buffer; dbl_buffer = new su2double [Global_nElemDomain]; - SU2_MPI::Allreduce(vol_elem,dbl_buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(vol_elem,dbl_buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); swap(dbl_buffer, vol_elem); delete [] dbl_buffer; vector char_buffer(Global_nElemDomain); - MPI_Allreduce(halo_detect.data(),char_buffer.data(),Global_nElemDomain,MPI_CHAR,MPI_SUM,MPI_COMM_WORLD); + MPI_Allreduce(halo_detect.data(),char_buffer.data(),Global_nElemDomain,MPI_CHAR,MPI_SUM,SU2_MPI::GetComm()); halo_detect.swap(char_buffer); } SU2_OMP_BARRIER @@ -3234,7 +3234,7 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, SU2_OMP_MASTER { su2double *buffer = new su2double [Global_nElemDomain]; - SU2_MPI::Allreduce(work_values,buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(work_values,buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); swap(buffer, work_values); delete [] buffer; } SU2_OMP_BARRIER @@ -3315,7 +3315,7 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, limited_searches /= kernels.size(); unsigned long tmp = limited_searches; - SU2_MPI::Reduce(&tmp,&limited_searches,1,MPI_UNSIGNED_LONG,MPI_SUM,MASTER_NODE,MPI_COMM_WORLD); + SU2_MPI::Reduce(&tmp,&limited_searches,1,MPI_UNSIGNED_LONG,MPI_SUM,MASTER_NODE,SU2_MPI::GetComm()); if (rank==MASTER_NODE && limited_searches>0) cout << "Warning: The filter radius was limited for " << limited_searches @@ -3353,7 +3353,7 @@ void CGeometry::GetGlobalElementAdjacencyMatrix(vector &neighbour /*--- Share with all processors ---*/ { unsigned short *buffer = new unsigned short [Global_nElemDomain]; - MPI_Allreduce(nFaces_elem,buffer,Global_nElemDomain,MPI_UNSIGNED_SHORT,MPI_MAX,MPI_COMM_WORLD); + MPI_Allreduce(nFaces_elem,buffer,Global_nElemDomain,MPI_UNSIGNED_SHORT,MPI_MAX,SU2_MPI::GetComm()); /*--- swap pointers and delete old data to keep the same variable name after reduction ---*/ swap(buffer, nFaces_elem); delete [] buffer; } @@ -3400,7 +3400,7 @@ void CGeometry::GetGlobalElementAdjacencyMatrix(vector &neighbour /*--- Share with all processors ---*/ { long *buffer = new long [matrix_size]; - MPI_Allreduce(neighbour_idx,buffer,matrix_size,MPI_LONG,MPI_MAX,MPI_COMM_WORLD); + MPI_Allreduce(neighbour_idx,buffer,matrix_size,MPI_LONG,MPI_MAX,SU2_MPI::GetComm()); swap(buffer, neighbour_idx); delete [] buffer; } #endif diff --git a/Common/src/geometry/CMultiGridGeometry.cpp b/Common/src/geometry/CMultiGridGeometry.cpp index 914b21a7d202..6e09d81b9cf7 100644 --- a/Common/src/geometry/CMultiGridGeometry.cpp +++ b/Common/src/geometry/CMultiGridGeometry.cpp @@ -513,9 +513,9 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry **geometry, CConfig *config_con #ifdef HAVE_MPI /*--- Send/Receive information using Sendrecv ---*/ SU2_MPI::Sendrecv(Buffer_Send_Children, nBufferS_Vector, MPI_UNSIGNED_LONG, send_to,0, - Buffer_Receive_Children, nBufferR_Vector, MPI_UNSIGNED_LONG, receive_from,0, MPI_COMM_WORLD, &status); + Buffer_Receive_Children, nBufferR_Vector, MPI_UNSIGNED_LONG, receive_from,0, SU2_MPI::GetComm(), &status); SU2_MPI::Sendrecv(Buffer_Send_Parent, nBufferS_Vector, MPI_UNSIGNED_LONG, send_to,1, - Buffer_Receive_Parent, nBufferR_Vector, MPI_UNSIGNED_LONG, receive_from,1, MPI_COMM_WORLD, &status); + Buffer_Receive_Parent, nBufferR_Vector, MPI_UNSIGNED_LONG, receive_from,1, SU2_MPI::GetComm(), &status); #else /*--- Receive information without MPI ---*/ for (iVertex = 0; iVertex < nVertexR; iVertex++) { @@ -612,8 +612,8 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry **geometry, CConfig *config_con Local_nPointCoarse = nPoint; Local_nPointFine = fine_grid->GetnPoint(); - SU2_MPI::Allreduce(&Local_nPointCoarse, &Global_nPointCoarse, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_nPointFine, &Global_nPointFine, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_nPointCoarse, &Global_nPointCoarse, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nPointFine, &Global_nPointFine, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); su2double Coeff = 1.0, CFL = 0.0, factor = 1.5; diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index dc8ae548d27b..33a75ef557f3 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -256,9 +256,9 @@ CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, nLocal_Bound_Elem = nLocal_Line + nLocal_BoundTria + nLocal_BoundQuad; SU2_MPI::Allreduce(&nLocal_Elem, &nGlobal_Elem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&nLocal_Bound_Elem, &nGlobal_Bound_Elem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- With the distribution of all points, elements, and markers based on the ParMETIS coloring complete, as a final step, load this data into @@ -597,7 +597,7 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, many points it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, - &(nPoint_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send colors. First check how many messages we will be sending and receiving. Here we also put @@ -840,7 +840,7 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -1137,7 +1137,7 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome many points it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, - &(nPoint_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send colors, ids, and coords. First check how many messages we will be sending and receiving. Here we also put @@ -1444,7 +1444,7 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, many cells it will receive from each other processor. ---*/ SU2_MPI::Scatter(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + &(nElem_Recv[1]), 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -1816,7 +1816,7 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -2086,7 +2086,7 @@ void CPhysicalGeometry::DistributeMarkerTags(CConfig *config, CGeometry *geometr /*--- Broadcast the global number of markers in the mesh. ---*/ SU2_MPI::Bcast(&nMarker_Global, 1, MPI_UNSIGNED_LONG, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); char *mpi_str_buf = new char[nMarker_Global*MAX_STRING_SIZE](); if (rank == MASTER_NODE) { @@ -2099,7 +2099,7 @@ void CPhysicalGeometry::DistributeMarkerTags(CConfig *config, CGeometry *geometr /*--- Broadcast the string names of the variables. ---*/ SU2_MPI::Bcast(mpi_str_buf, (int)nMarker_Global*MAX_STRING_SIZE, MPI_CHAR, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Now parse the string names and load into our marker tag vector. We also need to set the values of all markers into the config. ---*/ @@ -2200,9 +2200,9 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { #ifdef HAVE_MPI SU2_MPI::Allreduce(&Local_nPoint, &Global_nPoint, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else Global_nPoint = Local_nPoint; Global_nPointDomain = Local_nPointDomain; @@ -2498,7 +2498,7 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) values are important for merging and writing output later. ---*/ SU2_MPI::Allreduce(&Local_Elem, &Global_nElem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << Global_nElem << " interior elements including halo cells. " << endl; @@ -2527,17 +2527,17 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) unsigned long Local_nElemPyramid = nelem_pyramid; SU2_MPI::Allreduce(&Local_nElemTri, &Global_nelem_triangle, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nElemQuad, &Global_nelem_quad, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nElemTet, &Global_nelem_tetra, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nElemHex, &Global_nelem_hexa, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nElemPrism, &Global_nelem_prism, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Local_nElemPyramid, &Global_nelem_pyramid, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else Global_nelem_triangle = nelem_triangle; Global_nelem_quad = nelem_quad; @@ -2903,37 +2903,37 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_DOUBLE, source, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_LONG: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_LONG, source, tag, MPI_COMM_WORLD, + count, MPI_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_CHAR: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_CHAR, source, tag, MPI_COMM_WORLD, + count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_SHORT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_SHORT, source, tag, MPI_COMM_WORLD, + count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_INT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_INT, source, tag, MPI_COMM_WORLD, + count, MPI_INT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; default: @@ -2978,37 +2978,37 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_LONG: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_LONG, dest, tag, MPI_COMM_WORLD, + count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_CHAR: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_CHAR, dest, tag, MPI_COMM_WORLD, + count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_SHORT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_SHORT, dest, tag, MPI_COMM_WORLD, + count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_INT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_INT, dest, tag, MPI_COMM_WORLD, + count, MPI_INT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; default: @@ -3884,7 +3884,7 @@ void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElements(CConfig *co the CGNS grid with all ranks. ---*/ auto reduce = [](unsigned long p, unsigned long& t) { - SU2_MPI::Allreduce(&p, &t, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&p, &t, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); }; reduce(nelem_triangle, Global_nelem_triangle); reduce(nelem_quad, Global_nelem_quad); @@ -4379,7 +4379,7 @@ void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig *config) { auto reduce = [](unsigned long& val) { unsigned long tmp = val; - SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); }; reduce(tria_flip); reduce(quad_flip); reduce(tet_flip); reduce(pyram_flip); @@ -4526,7 +4526,7 @@ void CPhysicalGeometry::Check_BoundElem_Orientation(const CConfig *config) { auto reduce = [](unsigned long& val) { unsigned long tmp = val; - SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); }; reduce(line_flip); reduce(tria_flip); reduce(quad_flip); reduce(quad_error); @@ -4611,19 +4611,19 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { } - SU2_MPI::Allreduce(&PositiveXArea, &TotalPositiveXArea, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&PositiveYArea, &TotalPositiveYArea, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&PositiveZArea, &TotalPositiveZArea, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&PositiveXArea, &TotalPositiveXArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&PositiveYArea, &TotalPositiveYArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&PositiveZArea, &TotalPositiveZArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&MinCoordX, &TotalMinCoordX, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MinCoordY, &TotalMinCoordY, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MinCoordZ, &TotalMinCoordZ, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MinCoordX, &TotalMinCoordX, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MinCoordY, &TotalMinCoordY, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MinCoordZ, &TotalMinCoordZ, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&MaxCoordX, &TotalMaxCoordX, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MaxCoordY, &TotalMaxCoordY, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MaxCoordZ, &TotalMaxCoordZ, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MaxCoordX, &TotalMaxCoordX, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MaxCoordY, &TotalMaxCoordY, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MaxCoordZ, &TotalMaxCoordZ, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&WettedArea, &TotalWettedArea, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&WettedArea, &TotalWettedArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Set a reference area if no value is provided ---*/ @@ -5128,8 +5128,8 @@ unsigned short iMarker, jMarker, iMarkerTP, iSpan, jSpan, kSpan = 0; nSpan_max = nSpan; My_nSpan = nSpan; nSpan = 0; My_MaxnSpan = nSpan_max; nSpan_max = 0; - SU2_MPI::Allreduce(&My_nSpan, &nSpan, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&My_MaxnSpan, &nSpan_max, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&My_nSpan, &nSpan, 1, MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&My_MaxnSpan, &nSpan_max, 1, MPI_INT, MPI_MAX, SU2_MPI::GetComm()); #endif /*--- initialize the vector that will contain the disordered values span-wise ---*/ @@ -5214,8 +5214,8 @@ unsigned short iMarker, jMarker, iMarkerTP, iSpan, jSpan, kSpan = 0; valueSpan[iSpan] = -1001.0; } - SU2_MPI::Allgather(MyValueSpan, nSpan_max , MPI_DOUBLE, MyTotValueSpan, nSpan_max, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(&nSpan_loc, 1 , MPI_INT, My_nSpan_loc, 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Allgather(MyValueSpan, nSpan_max , MPI_DOUBLE, MyTotValueSpan, nSpan_max, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nSpan_loc, 1 , MPI_INT, My_nSpan_loc, 1, MPI_INT, SU2_MPI::GetComm()); jSpan = 0; for (iSize = 0; iSize< size; iSize++){ @@ -5334,8 +5334,8 @@ unsigned short iMarker, jMarker, iMarkerTP, iSpan, jSpan, kSpan = 0; #ifdef HAVE_MPI MyMin= min; min = 0; MyMax= max; max = 0; - SU2_MPI::Allreduce(&MyMin, &min, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyMax, &max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyMin, &min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyMax, &max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif // cout <<"min " << min << endl; @@ -5858,9 +5858,9 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone MyIntMin = minIntAngPitch[iSpan]; minIntAngPitch[iSpan] = 10.0E+6; MyMax = maxAngPitch[iSpan]; maxAngPitch[iSpan] = -10.0E+6; - SU2_MPI::Allreduce(&MyMin, &minAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyIntMin, &minIntAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyMax, &maxAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyMin, &minAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyIntMin, &minIntAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyMax, &maxAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif @@ -5885,7 +5885,7 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone #ifdef HAVE_MPI My_nVert = nVert;nVert = 0; - SU2_MPI::Allreduce(&My_nVert, &nVert, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&My_nVert, &nVert, 1, MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- to be set for all the processor to initialize an appropriate number of frequency for the NR BC ---*/ @@ -5970,11 +5970,11 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone } } } - SU2_MPI::Gather(y_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, y_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(x_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, x_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(z_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, z_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(angCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, angCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(deltaAngCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, deltaAngCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(y_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, y_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(x_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, x_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(z_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, z_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(angCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, angCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(deltaAngCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, deltaAngCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); if (rank == MASTER_NODE){ for(iSpanVertex = 0; iSpanVertexSetDomainVolume(DomainVolume); if ((rank == MASTER_NODE) && (action == ALLOCATE)) { @@ -8199,7 +8199,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { if (size == SINGLE_NODE) return; - MPI_Comm comm = MPI_COMM_WORLD; + MPI_Comm comm = SU2_MPI::GetComm(); /*--- Linear partitioner object to help prepare parmetis data. ---*/ @@ -8532,21 +8532,21 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { su2double Global_Ortho_Min, Global_Ortho_Max; SU2_MPI::Allreduce(&orthoMin, &Global_Ortho_Min, 1, - MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&orthoMax, &Global_Ortho_Max, 1, - MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); su2double Global_AR_Min, Global_AR_Max; SU2_MPI::Allreduce(&arMin, &Global_AR_Min, 1, - MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&arMax, &Global_AR_Max, 1, - MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); su2double Global_VR_Min, Global_VR_Max; SU2_MPI::Allreduce(&vrMin, &Global_VR_Min, 1, - MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&vrMax, &Global_VR_Max, 1, - MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); /*--- Print the summary to the console for the user. ---*/ @@ -8624,7 +8624,7 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { bool *PointInDomain; nPointLocal = nPoint; - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); Point2Vertex = new unsigned long[nPointGlobal][2]; PointInDomain = new bool[nPointGlobal]; @@ -8903,7 +8903,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -8920,7 +8920,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(Restart_Vars, nRestart_Vars, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(Restart_Vars, nRestart_Vars, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -8951,7 +8951,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Broadcast the string names of the variables. ---*/ SU2_MPI::Bcast(mpi_str_buf, nFields*CGNS_STRING_SIZE, MPI_CHAR, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Now parse the string names and load into the config class in case we need them for writing visualization files (SU2_SOL). ---*/ @@ -9038,7 +9038,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Communicate metadata. ---*/ - SU2_MPI::Bcast(&Restart_Iter, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&Restart_Iter, 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Copy to a su2double structure (because of the SU2_MPI::Bcast doesn't work with passive data)---*/ @@ -9046,7 +9046,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { for (unsigned short iVar = 0; iVar < 8; iVar++) Restart_Meta[iVar] = Restart_Meta_Passive[iVar]; - SU2_MPI::Bcast(Restart_Meta, 8, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(Restart_Meta, 8, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); /*--- All ranks close the file after writing. ---*/ @@ -9164,7 +9164,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -9179,7 +9179,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -9413,7 +9413,7 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { unsigned long myUnmatched = unmatched; unmatched = 0; SU2_MPI::Allreduce(&myUnmatched, &unmatched, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); if ((unmatched > 0) && (rank == MASTER_NODE)) { cout << " Warning: there are " << unmatched; cout << " points with a match distance > 1e-10." << endl; @@ -11028,7 +11028,7 @@ void CPhysicalGeometry::SetGlobalMarkerRoughness(const CConfig* config) { auto sizeLocal = static_cast(nMarker_All); // number of local markers /*--- Communicate size of local marker array and make an array large enough to hold all data. ---*/ - SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Set the global array of displacements, needed to access the correct roughness element. ---*/ GlobalMarkerStorageDispl.resize(size); @@ -11050,5 +11050,5 @@ void CPhysicalGeometry::SetGlobalMarkerRoughness(const CConfig* config) { /*--- Finally, gather the roughness of all markers. ---*/ SU2_MPI::Allgatherv(localRough.data(), sizeLocal, MPI_DOUBLE, GlobalRoughness_Height.data(), - recvCounts.data(), GlobalMarkerStorageDispl.data(), MPI_DOUBLE, MPI_COMM_WORLD); + recvCounts.data(), GlobalMarkerStorageDispl.data(), MPI_DOUBLE, SU2_MPI::GetComm()); } diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp index 1a4a7d409b33..c81244c54cd9 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp @@ -637,7 +637,7 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -1127,37 +1127,37 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_DOUBLE, source, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_LONG: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_LONG, source, tag, MPI_COMM_WORLD, + count, MPI_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_CHAR: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_CHAR, source, tag, MPI_COMM_WORLD, + count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_SHORT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_SHORT, source, tag, MPI_COMM_WORLD, + count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_INT: SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_INT, source, tag, MPI_COMM_WORLD, + count, MPI_INT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; default: @@ -1202,37 +1202,37 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, switch (commType) { case COMM_TYPE_DOUBLE: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD, + count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_LONG: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_LONG, dest, tag, MPI_COMM_WORLD, + count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, MPI_COMM_WORLD, + count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_CHAR: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_CHAR, dest, tag, MPI_COMM_WORLD, + count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_SHORT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_SHORT, dest, tag, MPI_COMM_WORLD, + count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_INT: SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_INT, dest, tag, MPI_COMM_WORLD, + count, MPI_INT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; default: diff --git a/Common/src/graph_coloring_structure.cpp b/Common/src/graph_coloring_structure.cpp index f60871e18164..e26f462659ad 100644 --- a/Common/src/graph_coloring_structure.cpp +++ b/Common/src/graph_coloring_structure.cpp @@ -46,8 +46,8 @@ void CGraphColoringStructure::GraphVertexColoring( int myRank = 0; #ifdef HAVE_MPI - SU2_MPI::Comm_rank(MPI_COMM_WORLD, &myRank); - SU2_MPI::Comm_size(MPI_COMM_WORLD, &nRank); + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &myRank); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &nRank); #endif /*--- Determine the algorithm to use for the graph coloring. ---*/ @@ -81,7 +81,7 @@ void CGraphColoringStructure::GraphVertexColoring( /* Determine the size of the message to be received. */ SU2_MPI::Status status; - SU2_MPI::Probe(rank, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(rank, rank, SU2_MPI::GetComm(), &status); int sizeMess; SU2_MPI::Get_count(&status, MPI_UNSIGNED_LONG, &sizeMess); @@ -89,7 +89,7 @@ void CGraphColoringStructure::GraphVertexColoring( /* Allocate the memory for the receive buffer and receive the message. */ vector recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, rank, rank, - MPI_COMM_WORLD, &status); + SU2_MPI::GetComm(), &status); /* Store the data just received in the global vector for the graph. */ unsigned long ii = 0; @@ -195,7 +195,7 @@ void CGraphColoringStructure::GraphVertexColoring( for(int rank=1; rankSetnNonconvexElements(nNonconvexElements); @@ -513,8 +513,8 @@ void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfi MinDistance_Local = MinDistance; MinDistance = 0.0; #ifdef HAVE_MPI - SU2_MPI::Allreduce(&MaxDistance_Local, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MinDistance_Local, &MinDistance, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MaxDistance_Local, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MinDistance_Local, &MinDistance, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); #else MaxDistance = MaxDistance_Local; MinDistance = MinDistance_Local; diff --git a/Common/src/interface_interpolation/CInterpolator.cpp b/Common/src/interface_interpolation/CInterpolator.cpp index 22b0f631454f..afb3c2fff17c 100644 --- a/Common/src/interface_interpolation/CInterpolator.cpp +++ b/Common/src/interface_interpolation/CInterpolator.cpp @@ -46,8 +46,8 @@ bool CInterpolator::CheckInterfaceBoundary(int markDonor, int markTarget) { /*--- Determine whether the boundary is not on the rank because of * the partition or because it is not part of the zone. ---*/ int donorCheck = -1, targetCheck = -1; - SU2_MPI::Allreduce(&markDonor, &donorCheck, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&markTarget, &targetCheck, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&markDonor, &donorCheck, 1, MPI_INT, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&markTarget, &targetCheck, 1, MPI_INT, MPI_MAX, SU2_MPI::GetComm()); return (donorCheck != -1) && (targetCheck != -1); } @@ -74,9 +74,9 @@ void CInterpolator::Determine_ArraySize(int markDonor, int markTarget, Buffer_Send_nVertex_Donor[0] = nLocalVertex_Donor; /*--- Send Interface vertex information --*/ - SU2_MPI::Allreduce(&nLocalVertex_Donor, &MaxLocalVertex_Donor, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nLocalVertex_Donor, &MaxLocalVertex_Donor, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); SU2_MPI::Allgather(Buffer_Send_nVertex_Donor, 1, MPI_UNSIGNED_LONG, - Buffer_Receive_nVertex_Donor, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + Buffer_Receive_nVertex_Donor, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); } void CInterpolator::Collect_VertexInfo(int markDonor, int markTarget, @@ -105,9 +105,9 @@ void CInterpolator::Collect_VertexInfo(int markDonor, int markTarget, auto nBuffer_Point = MaxLocalVertex_Donor; SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, - Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, MPI_COMM_WORLD); + Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(Buffer_Send_GlobalPoint, nBuffer_Point, MPI_LONG, - Buffer_Receive_GlobalPoint, nBuffer_Point, MPI_LONG, MPI_COMM_WORLD); + Buffer_Receive_GlobalPoint, nBuffer_Point, MPI_LONG, SU2_MPI::GetComm()); } unsigned long CInterpolator::Collect_ElementInfo(int markDonor, unsigned short nDim, bool compress, @@ -120,7 +120,7 @@ unsigned long CInterpolator::Collect_ElementInfo(int markDonor, unsigned short n if (markDonor != -1) nElemDonor = donor_geometry->GetnElem_Bound(markDonor); allNumElem.resize(size); - SU2_MPI::Allgather(&nElemDonor, 1, MPI_UNSIGNED_LONG, allNumElem.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + SU2_MPI::Allgather(&nElemDonor, 1, MPI_UNSIGNED_LONG, allNumElem.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); auto nMaxElemDonor = *max_element(allNumElem.begin(), allNumElem.end()); @@ -144,9 +144,9 @@ unsigned long CInterpolator::Collect_ElementInfo(int markDonor, unsigned short n } SU2_MPI::Allgather(bufferSendNum.data(), bufferSendNum.size(), MPI_UNSIGNED_SHORT, - numNodes.data(), bufferSendNum.size(), MPI_UNSIGNED_SHORT, MPI_COMM_WORLD); + numNodes.data(), bufferSendNum.size(), MPI_UNSIGNED_SHORT, SU2_MPI::GetComm()); SU2_MPI::Allgather(bufferSendIdx.data(), bufferSendIdx.size(), MPI_LONG, - idxNodes.data(), bufferSendIdx.size(), MPI_LONG, MPI_COMM_WORLD); + idxNodes.data(), bufferSendIdx.size(), MPI_LONG, SU2_MPI::GetComm()); if (!compress) return accumulate(allNumElem.begin(), allNumElem.end(), 0ul); @@ -275,8 +275,8 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){ /*--- Reconstruct boundary by gathering data from all ranks ---*/ - SU2_MPI::Allreduce( &nLocalVertex, &nGlobalVertex, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nLocalLinkedNodes, &nGlobalLinkedNodes, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce( &nLocalVertex, &nGlobalVertex, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocalLinkedNodes, &nGlobalLinkedNodes, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); Buffer_Receive_Coord = new su2double [ nGlobalVertex * nDim ]; Buffer_Receive_GlobalPoint = new long[ nGlobalVertex ]; @@ -307,15 +307,15 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){ for(iRank = 1; iRank < nProcessor; iRank++){ - SU2_MPI::Recv( &iTmp2, 1, MPI_UNSIGNED_LONG, iRank, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv(&Buffer_Receive_LinkedNodes[tmp_index_2], iTmp2, MPI_UNSIGNED_LONG, iRank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::Recv( &iTmp2, 1, MPI_UNSIGNED_LONG, iRank, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(&Buffer_Receive_LinkedNodes[tmp_index_2], iTmp2, MPI_UNSIGNED_LONG, iRank, 1, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); - SU2_MPI::Recv( &iTmp, 1, MPI_UNSIGNED_LONG, iRank, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv(&Buffer_Receive_Coord[tmp_index*nDim], nDim*iTmp, MPI_DOUBLE, iRank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::Recv( &iTmp, 1, MPI_UNSIGNED_LONG, iRank, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(&Buffer_Receive_Coord[tmp_index*nDim], nDim*iTmp, MPI_DOUBLE, iRank, 1, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); - SU2_MPI::Recv( &Buffer_Receive_GlobalPoint[tmp_index], iTmp, MPI_LONG, iRank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv( &Buffer_Receive_nLinkedNodes[tmp_index], iTmp, MPI_UNSIGNED_LONG, iRank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv(&Buffer_Receive_StartLinkedNodes[tmp_index], iTmp, MPI_UNSIGNED_LONG, iRank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::Recv( &Buffer_Receive_GlobalPoint[tmp_index], iTmp, MPI_LONG, iRank, 1, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv( &Buffer_Receive_nLinkedNodes[tmp_index], iTmp, MPI_UNSIGNED_LONG, iRank, 1, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(&Buffer_Receive_StartLinkedNodes[tmp_index], iTmp, MPI_UNSIGNED_LONG, iRank, 1, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); for (iVertex = 0; iVertex < iTmp; iVertex++){ Buffer_Receive_Proc[ tmp_index + iVertex ] = iRank; @@ -327,15 +327,15 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){ } } else{ - SU2_MPI::Send( &nLocalLinkedNodes, 1, MPI_UNSIGNED_LONG, 0, 0, MPI_COMM_WORLD); - SU2_MPI::Send(Buffer_Send_LinkedNodes, nLocalLinkedNodes, MPI_UNSIGNED_LONG, 0, 1, MPI_COMM_WORLD); + SU2_MPI::Send( &nLocalLinkedNodes, 1, MPI_UNSIGNED_LONG, 0, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(Buffer_Send_LinkedNodes, nLocalLinkedNodes, MPI_UNSIGNED_LONG, 0, 1, SU2_MPI::GetComm()); - SU2_MPI::Send( &nLocalVertex, 1, MPI_UNSIGNED_LONG, 0, 0, MPI_COMM_WORLD); - SU2_MPI::Send(Buffer_Send_Coord, nDim * nLocalVertex, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD); + SU2_MPI::Send( &nLocalVertex, 1, MPI_UNSIGNED_LONG, 0, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(Buffer_Send_Coord, nDim * nLocalVertex, MPI_DOUBLE, 0, 1, SU2_MPI::GetComm()); - SU2_MPI::Send( Buffer_Send_GlobalPoint, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, MPI_COMM_WORLD); - SU2_MPI::Send( Buffer_Send_nLinkedNodes, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, MPI_COMM_WORLD); - SU2_MPI::Send(Buffer_Send_StartLinkedNodes, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, MPI_COMM_WORLD); + SU2_MPI::Send( Buffer_Send_GlobalPoint, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, SU2_MPI::GetComm()); + SU2_MPI::Send( Buffer_Send_nLinkedNodes, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, SU2_MPI::GetComm()); + SU2_MPI::Send(Buffer_Send_StartLinkedNodes, nLocalVertex, MPI_UNSIGNED_LONG, 0, 1, SU2_MPI::GetComm()); } #else for (iVertex = 0; iVertex < nDim * nGlobalVertex; iVertex++) @@ -378,13 +378,13 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){ } } - SU2_MPI::Bcast(Buffer_Receive_GlobalPoint, nGlobalVertex, MPI_LONG, 0, MPI_COMM_WORLD); - SU2_MPI::Bcast(Buffer_Receive_Coord, nGlobalVertex*nDim, MPI_DOUBLE, 0, MPI_COMM_WORLD); - SU2_MPI::Bcast(Buffer_Receive_Proc, nGlobalVertex, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD); + SU2_MPI::Bcast(Buffer_Receive_GlobalPoint, nGlobalVertex, MPI_LONG, 0, SU2_MPI::GetComm()); + SU2_MPI::Bcast(Buffer_Receive_Coord, nGlobalVertex*nDim, MPI_DOUBLE, 0, SU2_MPI::GetComm()); + SU2_MPI::Bcast(Buffer_Receive_Proc, nGlobalVertex, MPI_UNSIGNED_LONG, 0, SU2_MPI::GetComm()); - SU2_MPI::Bcast(Buffer_Receive_nLinkedNodes, nGlobalVertex, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD); - SU2_MPI::Bcast(Buffer_Receive_StartLinkedNodes, nGlobalVertex, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD); - SU2_MPI::Bcast(Buffer_Receive_LinkedNodes, nGlobalLinkedNodes, MPI_UNSIGNED_LONG, 0, MPI_COMM_WORLD); + SU2_MPI::Bcast(Buffer_Receive_nLinkedNodes, nGlobalVertex, MPI_UNSIGNED_LONG, 0, SU2_MPI::GetComm()); + SU2_MPI::Bcast(Buffer_Receive_StartLinkedNodes, nGlobalVertex, MPI_UNSIGNED_LONG, 0, SU2_MPI::GetComm()); + SU2_MPI::Bcast(Buffer_Receive_LinkedNodes, nGlobalLinkedNodes, MPI_UNSIGNED_LONG, 0, SU2_MPI::GetComm()); delete [] Buffer_Send_Coord; Buffer_Send_Coord = nullptr; delete [] Buffer_Send_GlobalPoint; Buffer_Send_GlobalPoint = nullptr; diff --git a/Common/src/interface_interpolation/CIsoparametric.cpp b/Common/src/interface_interpolation/CIsoparametric.cpp index 590c32bf7bc6..92e5aef651fe 100644 --- a/Common/src/interface_interpolation/CIsoparametric.cpp +++ b/Common/src/interface_interpolation/CIsoparametric.cpp @@ -266,9 +266,9 @@ void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { /*--- Final reduction of statistics. ---*/ su2double tmp = MaxDistance; unsigned long tmp1 = ErrorCounter, tmp2 = nGlobalVertexTarget; - SU2_MPI::Allreduce(&tmp, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&tmp1, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&tmp2, &nGlobalVertexTarget, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&tmp1, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&tmp2, &nGlobalVertexTarget, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); ErrorRate = 100*su2double(ErrorCounter) / nGlobalVertexTarget; diff --git a/Common/src/interface_interpolation/CMirror.cpp b/Common/src/interface_interpolation/CMirror.cpp index 502ae2714009..ed42afb51ff5 100644 --- a/Common/src/interface_interpolation/CMirror.cpp +++ b/Common/src/interface_interpolation/CMirror.cpp @@ -93,11 +93,11 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { /*--- Communicate vertex and donor node counts. ---*/ SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, - allNumVertexTarget.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + allNumVertexTarget.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); SU2_MPI::Allgather(&nVertexDonorLocal, 1, MPI_UNSIGNED_LONG, - allNumVertexDonor.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + allNumVertexDonor.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); SU2_MPI::Allgather(&nNodeDonorLocal, 1, MPI_UNSIGNED_LONG, - allNumNodeDonor.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + allNumNodeDonor.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Copy donor interpolation matrix (triplet format). ---*/ vector sendGlobalIndex(nNodeDonorLocal); @@ -175,15 +175,15 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { GlobalIndex[iSend] = new long [numCoeff]; DonorIndex[iSend] = new long [numCoeff]; DonorCoeff[iSend] = new su2double [numCoeff]; - SU2_MPI::Recv(GlobalIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv(DonorIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - SU2_MPI::Recv(DonorCoeff[iSend], numCoeff, MPI_DOUBLE, jProcessor, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::Recv(GlobalIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(DonorIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(DonorCoeff[iSend], numCoeff, MPI_DOUBLE, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); } else if (rank == jProcessor) { /*--- "I'm" the donor, send. ---*/ - SU2_MPI::Send(sendGlobalIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, MPI_COMM_WORLD); - SU2_MPI::Send(sendDonorIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, MPI_COMM_WORLD); - SU2_MPI::Send(sendDonorCoeff.data(), numCoeff, MPI_DOUBLE, iProcessor, 0, MPI_COMM_WORLD); + SU2_MPI::Send(sendGlobalIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(sendDonorIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(sendDonorCoeff.data(), numCoeff, MPI_DOUBLE, iProcessor, 0, SU2_MPI::GetComm()); } } } diff --git a/Common/src/interface_interpolation/CNearestNeighbor.cpp b/Common/src/interface_interpolation/CNearestNeighbor.cpp index e1de1ff93021..c4cdd7830876 100644 --- a/Common/src/interface_interpolation/CNearestNeighbor.cpp +++ b/Common/src/interface_interpolation/CNearestNeighbor.cpp @@ -177,10 +177,10 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { delete[] Buffer_Receive_nVertex_Donor; unsigned long tmp = totalTargetPoints; - SU2_MPI::Allreduce(&tmp, &totalTargetPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &totalTargetPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); su2double tmp1 = AvgDistance, tmp2 = MaxDistance; - SU2_MPI::Allreduce(&tmp1, &AvgDistance, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&tmp2, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp1, &AvgDistance, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&tmp2, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); AvgDistance /= totalTargetPoints; } diff --git a/Common/src/interface_interpolation/CRadialBasisFunction.cpp b/Common/src/interface_interpolation/CRadialBasisFunction.cpp index fcbf242537af..82bd1ebef0d0 100644 --- a/Common/src/interface_interpolation/CRadialBasisFunction.cpp +++ b/Common/src/interface_interpolation/CRadialBasisFunction.cpp @@ -250,25 +250,25 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { #ifdef HAVE_MPI /*--- For simplicity, broadcast small information about the interpolation matrix. ---*/ - SU2_MPI::Bcast(&nPolynomial, 1, MPI_INT, iProcessor, MPI_COMM_WORLD); - SU2_MPI::Bcast(keepPolynomialRow.data(), nDim, MPI_INT, iProcessor, MPI_COMM_WORLD); + SU2_MPI::Bcast(&nPolynomial, 1, MPI_INT, iProcessor, SU2_MPI::GetComm()); + SU2_MPI::Bcast(keepPolynomialRow.data(), nDim, MPI_INT, iProcessor, SU2_MPI::GetComm()); /*--- Send C_inv_trunc only to the ranks that need it (those with target points), * partial broadcast. MPI wrapper not used due to passive double. ---*/ vector allNumVertex(nProcessor); SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, - allNumVertex.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + allNumVertex.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); if (rank == iProcessor) { for (int jProcessor = 0; jProcessor < nProcessor; ++jProcessor) if ((jProcessor != iProcessor) && (allNumVertex[jProcessor] != 0)) MPI_Send(C_inv_trunc.data(), C_inv_trunc.size(), - MPI_DOUBLE, jProcessor, 0, MPI_COMM_WORLD); + MPI_DOUBLE, jProcessor, 0, SU2_MPI::GetComm()); } else if (nVertexTarget != 0) { C_inv_trunc.resize(1+nPolynomial+nGlobalVertexDonor, nGlobalVertexDonor); MPI_Recv(C_inv_trunc.data(), C_inv_trunc.size(), MPI_DOUBLE, - iProcessor, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + iProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); } #endif @@ -403,7 +403,7 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { /*--- Final reduction of interpolation statistics and basic sanity checks. ---*/ auto Reduce = [](SU2_MPI::Op op, unsigned long &val) { auto tmp = val; - SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, op, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, op, SU2_MPI::GetComm()); }; Reduce(MPI_SUM, totalTargetPoints); Reduce(MPI_SUM, totalDonorPoints); @@ -412,8 +412,8 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { Reduce(MPI_MAX, MaxDonors); #ifdef HAVE_MPI passivedouble tmp1 = AvgCorrection, tmp2 = MaxCorrection; - MPI_Allreduce(&tmp1, &AvgCorrection, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&tmp2, &MaxCorrection, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&tmp1, &AvgCorrection, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + MPI_Allreduce(&tmp2, &MaxCorrection, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif if (totalTargetPoints == 0) SU2_MPI::Error("Somehow there are no target interpolation points.", CURRENT_FUNCTION); diff --git a/Common/src/linear_algebra/CPastixWrapper.cpp b/Common/src/linear_algebra/CPastixWrapper.cpp index 9a1c67d86e36..08e115138e60 100644 --- a/Common/src/linear_algebra/CPastixWrapper.cpp +++ b/Common/src/linear_algebra/CPastixWrapper.cpp @@ -113,7 +113,7 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * #ifdef HAVE_MPI vector domain_sizes(mpi_size); - MPI_Allgather(&nPointDomain, 1, MPI_UNSIGNED_LONG, domain_sizes.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + MPI_Allgather(&nPointDomain, 1, MPI_UNSIGNED_LONG, domain_sizes.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); for (int i=0; i::Initialize(CGeometry *geometry, const CConfig * /*--- Send and Receive data ---*/ MPI_Sendrecv(Buffer_Send.data(), nVertexS, MPI_UNSIGNED_LONG, sender, 0, Buffer_Recv.data(), nVertexR, MPI_UNSIGNED_LONG, recver, 0, - MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::GetComm(), MPI_STATUS_IGNORE); /*--- Store received data---*/ for (unsigned long iVertex = 0; iVertex < nVertexR; iVertex++) diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index dd6aaae8f620..1f74bbdee210 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -1112,8 +1112,8 @@ unsigned long CSysMatrix::BuildLineletPreconditioner(CGeometry *geom } Local_nLineLets = nLinelet; - SU2_MPI::Allreduce(&Local_nPoints, &Global_nPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_nLineLets, &Global_nLineLets, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_nPoints, &Global_nPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nLineLets, &Global_nLineLets, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Memory allocation --*/ diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index d90c54fee50c..7c9dbb1fe62d 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -210,10 +210,10 @@ struct CLimiterDetails SU2_OMP_MASTER { localMin = sharedMin; - SU2_MPI::Allreduce(localMin.data(), sharedMin.data(), varEnd, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(localMin.data(), sharedMin.data(), varEnd, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); localMax = sharedMax; - SU2_MPI::Allreduce(localMax.data(), sharedMax.data(), varEnd, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(localMax.data(), sharedMax.data(), varEnd, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); } SU2_OMP_BARRIER diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 8cfcdcd299b3..7ccdd2c07070 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -347,10 +347,10 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi /*--- If the reducer strategy is not being forced (by EDGE_COLORING_GROUP_SIZE=0) print some messages. ---*/ if (config.GetEdgeColoringGroupSize() != 1 << 30) { su2double minEff = 1.0; - SU2_MPI::Reduce(¶llelEff, &minEff, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(¶llelEff, &minEff, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); int tmp = ReducerStrategy, numRanksUsingReducer = 0; - SU2_MPI::Reduce(&tmp, &numRanksUsingReducer, 1, MPI_INT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&tmp, &numRanksUsingReducer, 1, MPI_INT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); if (minEff < COLORING_EFF_THRESH) { cout << "WARNING: On " << numRanksUsingReducer << " MPI ranks the coloring efficiency was less than " @@ -1599,7 +1599,7 @@ void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometr auto Allreduce = [](su2double x) { su2double tmp = x; x = 0.0; - SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); return x; }; AllBoundInvCoeff.CD = Allreduce(AllBoundInvCoeff.CD); @@ -1636,7 +1636,7 @@ void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometr su2double* buffer = new su2double[nMarkerMon]; auto Allreduce_inplace = [buffer](int size, su2double* x) { - SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); for (int i = 0; i < size; ++i) x[i] = buffer[i]; }; @@ -1920,7 +1920,7 @@ void CFVMFlowSolverBase::Momentum_Forces(const CGeometry* geometr auto Allreduce = [](su2double x) { su2double tmp = x; x = 0.0; - SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); return x; }; @@ -1957,7 +1957,7 @@ void CFVMFlowSolverBase::Momentum_Forces(const CGeometry* geometr su2double* buffer = new su2double[nMarkerMon]; auto Allreduce_inplace = [buffer](int size, su2double* x) { - SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); for (int i = 0; i < size; ++i) x[i] = buffer[i]; }; @@ -2384,7 +2384,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr auto Allreduce = [](su2double x) { su2double tmp = x; x = 0.0; - SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); return x; }; AllBoundViscCoeff.CD = Allreduce(AllBoundViscCoeff.CD); @@ -2423,7 +2423,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr su2double* buffer = new su2double[nMarkerMon]; auto Allreduce_inplace = [buffer](int size, su2double* x) { - SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); for (int i = 0; i < size; ++i) x[i] = buffer[i]; }; diff --git a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp index 05a85782420c..dc12ddaf30df 100644 --- a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp +++ b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp @@ -208,8 +208,8 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { /*--- Communicate the total number of nodes on this domain. ---*/ SU2_MPI::Gather(&Buffer_Send_nPoin, 1, MPI_UNSIGNED_LONG, - Buffer_Recv_nPoin, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nLocalPoint, &MaxLocalPoint, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); + Buffer_Recv_nPoin, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocalPoint, &MaxLocalPoint, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); /*--- Send and Recv buffers. ---*/ @@ -300,15 +300,15 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { /*--- Gather the coordinate data on the master node using MPI. ---*/ SU2_MPI::Gather(Buffer_Send_X, (int)MaxLocalPoint, MPI_DOUBLE, - Buffer_Recv_X, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + Buffer_Recv_X, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); SU2_MPI::Gather(Buffer_Send_Y, (int)MaxLocalPoint, MPI_DOUBLE, - Buffer_Recv_Y, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + Buffer_Recv_Y, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); if (dimension == 3) { SU2_MPI::Gather(Buffer_Send_Z, (int)MaxLocalPoint, MPI_DOUBLE, - Buffer_Recv_Z, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + Buffer_Recv_Z, (int)MaxLocalPoint, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); } SU2_MPI::Gather(Buffer_Send_Str, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, - Buffer_Recv_Str, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, MPI_COMM_WORLD); + Buffer_Recv_Str, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); /*--- The master node unpacks and sorts this variable by marker tag. ---*/ diff --git a/SU2_CFD/src/definition_structure.cpp b/SU2_CFD/src/definition_structure.cpp index f37d74a9db02..b0a4b0d2d54b 100644 --- a/SU2_CFD/src/definition_structure.cpp +++ b/SU2_CFD/src/definition_structure.cpp @@ -46,8 +46,8 @@ void Partition_Analysis(CGeometry *geometry, CConfig *config) { int size = SINGLE_NODE; #ifdef HAVE_MPI - SU2_MPI::Comm_rank(MPI_COMM_WORLD, &rank); - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); #endif nPointTotal = geometry->GetnPoint(); @@ -119,7 +119,7 @@ void Partition_Analysis(CGeometry *geometry, CConfig *config) { Profile_File << "\"Rank\", \"nNeighbors\", \"nPointTotal\", \"nEdge\", \"nPointGhost\", \"nSendTotal\", \"nRecvTotal\", \"nElemTotal\", \"nElemBoundary\", \"nElemHalo\", \"nnz\"" << endl; Profile_File.close(); } - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Loop through the map and write the results to the file ---*/ @@ -129,7 +129,7 @@ void Partition_Analysis(CGeometry *geometry, CConfig *config) { Profile_File << rank << ", " << nNeighbors << ", " << nPointTotal << ", " << nEdge << "," << nPointGhost << ", " << nSendTotal << ", " << nRecvTotal << ", " << nElemTotal << "," << nElemBound << ", " << nElemHalo << ", " << nnz << endl; Profile_File.close(); } - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); } delete [] isHalo; @@ -151,8 +151,8 @@ void Partition_Analysis_FEM(CGeometry *geometry, CConfig *config) { int size = SINGLE_NODE; #ifdef HAVE_MPI - SU2_MPI::Comm_rank(MPI_COMM_WORLD, &rank); - SU2_MPI::Comm_size(MPI_COMM_WORLD, &size); + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); #endif /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary @@ -218,7 +218,7 @@ void Partition_Analysis_FEM(CGeometry *geometry, CConfig *config) { Profile_File << "\"Rank\", \"nNeighSend\", \"nNeighRecv\", \"nElemOwned\", \"nElemSendTotal\", \"nElemRecvTotal\", \"nDOFOwned\", \"nDOFSendTotal\", \"nDOFRecvTotal\"" << endl; Profile_File.close(); } - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Loop through the map and write the results to the file ---*/ @@ -230,7 +230,7 @@ void Partition_Analysis_FEM(CGeometry *geometry, CConfig *config) { << nDOFSendTotal << ", " << nDOFRecvTotal << endl; Profile_File.close(); } - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); } } diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 33eab6df187c..241b39068382 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -569,7 +569,7 @@ void CDiscAdjMultizoneDriver::SetRecording(unsigned short kind_recording, Kind_T #ifdef CODI_REVERSE_TYPE if (size > SINGLE_NODE) { su2double myMem = AD::globalTape.getTapeValues().getUsedMemorySize(), totMem = 0.0; - SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); if (rank == MASTER_NODE) { cout << "MPI\n"; cout << "-------------------------------------\n"; diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 8cc5edd4437b..48a9463e00db 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -296,7 +296,7 @@ void CDiscAdjSinglezoneDriver::SetRecording(unsigned short kind_recording){ #ifdef CODI_REVERSE_TYPE if (size > SINGLE_NODE) { su2double myMem = AD::globalTape.getTapeValues().getUsedMemorySize(), totMem = 0.0; - SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); if (rank == MASTER_NODE) { cout << "MPI\n"; cout << "-------------------------------------\n"; diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index e1e14188a4de..68019153cdbe 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -264,7 +264,7 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) { } #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Run a predictor step ---*/ diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index 30fe1077d670..0729a2c1458f 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -132,7 +132,7 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { } #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Run a predictor step ---*/ diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 678361fb7bf4..811b1b5608cd 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -283,9 +283,9 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon /*--- Gather the data on the master node. ---*/ - SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); /*--- Set plunge and pitch on the master node ---*/ diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 97eba31f2c11..71f76e7d0726 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -94,7 +94,7 @@ void CInterface::BroadcastData(const CInterpolator& interpolator, * sums) to perform an Allgatherv of donor indices and variables. ---*/ vector nAllVertexDonor(size), nAllVarCounts(size), displIdx(size,0), displVar(size); - SU2_MPI::Allgather(&nLocalVertexDonor, 1, MPI_INT, nAllVertexDonor.data(), 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Allgather(&nLocalVertexDonor, 1, MPI_INT, nAllVertexDonor.data(), 1, MPI_INT, SU2_MPI::GetComm()); for (int i = 0; i < size; ++i) { nAllVarCounts[i] = nAllVertexDonor[i] * nVar; @@ -131,10 +131,10 @@ void CInterface::BroadcastData(const CInterpolator& interpolator, su2activematrix donorVar(nGlobalVertexDonor, nVar); SU2_MPI::Allgatherv(sendDonorIdx.data(), sendDonorIdx.size(), MPI_UNSIGNED_LONG, donorIdx.data(), - nAllVertexDonor.data(), displIdx.data(), MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + nAllVertexDonor.data(), displIdx.data(), MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); SU2_MPI::Allgatherv(sendDonorVar.data(), sendDonorVar.size(), MPI_DOUBLE, donorVar.data(), - nAllVarCounts.data(), displVar.data(), MPI_DOUBLE, MPI_COMM_WORLD); + nAllVarCounts.data(), displVar.data(), MPI_DOUBLE, SU2_MPI::GetComm()); /*--- This rank does not need to do more work. ---*/ if (markTarget < 0) continue; @@ -242,8 +242,8 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ BuffDonorFlag[iSize] = -1; } - SU2_MPI::Allgather(&Marker_Donor, 1 , MPI_INT, BuffMarkerDonor, 1, MPI_INT, MPI_COMM_WORLD); - SU2_MPI::Allgather(&Donor_Flag, 1 , MPI_INT, BuffDonorFlag, 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Allgather(&Marker_Donor, 1 , MPI_INT, BuffMarkerDonor, 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&Donor_Flag, 1 , MPI_INT, BuffDonorFlag, 1, MPI_INT, SU2_MPI::GetComm()); Marker_Donor= -1; Donor_Flag= -1; @@ -468,22 +468,22 @@ void CInterface::AllgatherAverage(CSolver *donor_solution, CSolver *target_solut } SU2_MPI::Allgather(avgDensityDonor, nSpanDonor , MPI_DOUBLE, BuffAvgDensityDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgPressureDonor, nSpanDonor , MPI_DOUBLE, BuffAvgPressureDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgNormalVelDonor, nSpanDonor , MPI_DOUBLE, BuffAvgNormalVelDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgTangVelDonor, nSpanDonor , MPI_DOUBLE, BuffAvgTangVelDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avg3DVelDonor, nSpanDonor , MPI_DOUBLE, BuffAvg3DVelDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgNuDonor, nSpanDonor , MPI_DOUBLE, BuffAvgNuDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgKineDonor, nSpanDonor , MPI_DOUBLE, BuffAvgKineDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); SU2_MPI::Allgather(avgOmegaDonor, nSpanDonor , MPI_DOUBLE, BuffAvgOmegaDonor, - nSpanDonor, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(&Marker_Donor, 1 , MPI_INT, BuffMarkerDonor, 1, MPI_INT, MPI_COMM_WORLD); + nSpanDonor, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&Marker_Donor, 1 , MPI_INT, BuffMarkerDonor, 1, MPI_INT, SU2_MPI::GetComm()); for (iSpan = 0; iSpan < nSpanDonor; iSpan++){ avgDensityDonor[iSpan] = -1.0; diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index e7c82a93efbb..f1806e7a290b 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -382,19 +382,19 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi #ifdef HAVE_MPI - SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #else @@ -831,7 +831,7 @@ void CFlowOutput::Set_CpInverseDesign(CSolver *solver, CGeometry *geometry, CCon if (!(Surface_file.fail())) { nPointLocal = geometry->GetnPoint(); - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); Point2Vertex = new unsigned long[nPointGlobal][2]; PointInDomain = new bool[nPointGlobal]; @@ -920,7 +920,7 @@ void CFlowOutput::Set_CpInverseDesign(CSolver *solver, CGeometry *geometry, CCon #ifdef HAVE_MPI su2double MyPressDiff = PressDiff; - SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif } diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 541489766c0c..30b70e83fef6 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -549,7 +549,7 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, unsigned short f /*--- Only sort if there is at least one processor that has this marker ---*/ int globalMarkerSize = 0, localMarkerSize = marker.size(); - SU2_MPI::Allreduce(&localMarkerSize, &globalMarkerSize, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&localMarkerSize, &globalMarkerSize, 1, MPI_INT, MPI_SUM, SU2_MPI::GetComm()); if (globalMarkerSize > 0){ @@ -921,7 +921,7 @@ bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) { /*--- Convergence criteria ---*/ sbuf_conv[0] = convergence; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); /*-- Compute global convergence criteria in the master node --*/ @@ -931,7 +931,7 @@ bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) { else sbuf_conv[0] = 0; } - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, SU2_MPI::GetComm()); if (sbuf_conv[0] == 1) { convergence = true; } else { convergence = false; } diff --git a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp index df37c06faf1c..7ffd2fb96702 100644 --- a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp @@ -71,11 +71,11 @@ void CCSVFileWriter::Write_Data(){ to the master node with collective calls. ---*/ SU2_MPI::Allreduce(&nLocalVertex_Surface, &MaxLocalVertex_Surface, 1, - MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); SU2_MPI::Gather(&Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Allocate buffers for send/recv of the data and global IDs. ---*/ @@ -113,10 +113,10 @@ void CCSVFileWriter::Write_Data(){ /*--- Collective comms of the solution data and global IDs. ---*/ SU2_MPI::Gather(bufD_Send, (int)MaxLocalVertex_Surface*fieldNames.size(), MPI_DOUBLE, - bufD_Recv, (int)MaxLocalVertex_Surface*fieldNames.size(), MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + bufD_Recv, (int)MaxLocalVertex_Surface*fieldNames.size(), MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); SU2_MPI::Gather(bufL_Send, (int)MaxLocalVertex_Surface, MPI_UNSIGNED_LONG, - bufL_Recv, (int)MaxLocalVertex_Surface, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + bufL_Recv, (int)MaxLocalVertex_Surface, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); /*--- The master rank alone writes the surface CSV file. ---*/ diff --git a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp index ae8425da1eeb..61244dd63964 100644 --- a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp @@ -62,7 +62,7 @@ CFEMDataSorter::CFEMDataSorter(CConfig *config, CGeometry *geometry, const vecto } SU2_MPI::Allreduce(&nLocalPointsBeforeSort, &nGlobalPointBeforeSort, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Create a linear partition --- */ diff --git a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp index a66663304d2c..d3deb547df44 100644 --- a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp @@ -241,7 +241,7 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElem_Cum[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -377,7 +377,7 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, int source = ii; int tag = ii + 1; SU2_MPI::Irecv(&(connRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, - MPI_COMM_WORLD, &(recv_req[iMessage])); + SU2_MPI::GetComm(), &(recv_req[iMessage])); iMessage++; } } @@ -393,7 +393,7 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, int dest = ii; int tag = rank + 1; SU2_MPI::Isend(&(connSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, - MPI_COMM_WORLD, &(send_req[iMessage])); + SU2_MPI::GetComm(), &(send_req[iMessage])); iMessage++; } } @@ -409,7 +409,7 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, int source = ii; int tag = ii + 1; SU2_MPI::Irecv(&(haloRecv[ll]), count, MPI_UNSIGNED_SHORT, source, tag, - MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + SU2_MPI::GetComm(), &(recv_req[iMessage+nRecvs])); iMessage++; } } @@ -425,7 +425,7 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, int dest = ii; int tag = rank + 1; SU2_MPI::Isend(&(haloSend[ll]), count, MPI_UNSIGNED_SHORT, dest, tag, - MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + SU2_MPI::GetComm(), &(send_req[iMessage+nSends])); iMessage++; } } diff --git a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp index b8ba27ce7cf4..eeef9bdd0efa 100644 --- a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp @@ -142,7 +142,7 @@ void CParallelDataSorter::SortOutputData() { int source = ii; int tag = ii + 1; SU2_MPI::Irecv(&(doubleBuffer[ll]), count, MPI_DOUBLE, source, tag, - MPI_COMM_WORLD, &(recv_req[iMessage])); + SU2_MPI::GetComm(), &(recv_req[iMessage])); iMessage++; } } @@ -158,7 +158,7 @@ void CParallelDataSorter::SortOutputData() { int dest = ii; int tag = rank + 1; SU2_MPI::Isend(&(connSend[ll]), count, MPI_DOUBLE, dest, tag, - MPI_COMM_WORLD, &(send_req[iMessage])); + SU2_MPI::GetComm(), &(send_req[iMessage])); iMessage++; } } @@ -174,7 +174,7 @@ void CParallelDataSorter::SortOutputData() { int source = ii; int tag = ii + 1; SU2_MPI::Irecv(&(idRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, - MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + SU2_MPI::GetComm(), &(recv_req[iMessage+nRecvs])); iMessage++; } } @@ -190,7 +190,7 @@ void CParallelDataSorter::SortOutputData() { int dest = ii; int tag = rank + 1; SU2_MPI::Isend(&(idSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, - MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + SU2_MPI::GetComm(), &(send_req[iMessage+nSends])); iMessage++; } } @@ -262,7 +262,7 @@ void CParallelDataSorter::SortOutputData() { /*--- Reduce the total number of points we will write in the output files. ---*/ SU2_MPI::Allreduce(&nPoints, &nPointsGlobal, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Free temporary memory from communications ---*/ @@ -298,7 +298,7 @@ void CParallelDataSorter::PrepareSendBuffers(std::vector& globalI many cells it will receive from each other processor. ---*/ SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, - &(nPoint_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send coordinates. First check how many messages we will be sending and receiving. Here we also put @@ -414,7 +414,7 @@ void CParallelDataSorter::SetTotalElements(){ /*--- Reduce the total number of cells we will be writing in the output files. ---*/ - SU2_MPI::Allreduce(nElemPerType.data(), nElemPerTypeGlobal.data(), N_ELEM_TYPES, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(nElemPerType.data(), nElemPerTypeGlobal.data(), N_ELEM_TYPES, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); nElemGlobal = std::accumulate(nElemPerTypeGlobal.begin(), nElemPerTypeGlobal.end(), 0); nElem = std::accumulate(nElemPerType.begin(), nElemPerType.end(), 0); @@ -451,10 +451,10 @@ void CParallelDataSorter::SetTotalElements(){ /*--- Communicate the local counts to all ranks for building offsets. ---*/ SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElem_Cum[1]), 1, MPI_INT, SU2_MPI::GetComm()); SU2_MPI::Alltoall(&(nElemConn_Send[1]), 1, MPI_INT, - &(nElemConn_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + &(nElemConn_Cum[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Put the counters into cumulative storage format. ---*/ diff --git a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp index 579aa00a2397..a882011c27bf 100644 --- a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp @@ -216,14 +216,14 @@ bool CFileWriter::OpenMPIFile(){ to write a fresh output file, so we delete any existing files and create a new one. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fileName.c_str(), + ierr = MPI_File_open(SU2_MPI::GetComm(), fileName.c_str(), MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, MPI_INFO_NULL, &fhw); if (ierr != MPI_SUCCESS) { MPI_File_close(&fhw); if (rank == 0) MPI_File_delete(fileName.c_str(), MPI_INFO_NULL); - ierr = MPI_File_open(MPI_COMM_WORLD, fileName.c_str(), + ierr = MPI_File_open(SU2_MPI::GetComm(), fileName.c_str(), MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, MPI_INFO_NULL, &fhw); } @@ -264,7 +264,7 @@ bool CFileWriter::CloseMPIFile(){ su2double my_fileSize = fileSize; SU2_MPI::Allreduce(&my_fileSize, &fileSize, 1, - MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Compute and store the bandwidth ---*/ diff --git a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp index f1efcadf975e..a4a73b9a63b8 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp @@ -75,7 +75,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.close(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Each processor opens the file. ---*/ @@ -99,7 +99,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -124,7 +124,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Write connectivity data. ---*/ @@ -196,7 +196,7 @@ void CParaviewFileWriter::Write_Data(){ } Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -209,7 +209,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif for (iProcessor = 0; iProcessor < size; iProcessor++) { @@ -224,7 +224,7 @@ void CParaviewFileWriter::Write_Data(){ } Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -236,7 +236,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif unsigned short varStart = 2; @@ -263,7 +263,7 @@ void CParaviewFileWriter::Write_Data(){ //skip Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif VarCounter++; } @@ -273,7 +273,7 @@ void CParaviewFileWriter::Write_Data(){ //skip Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif VarCounter++; } @@ -288,7 +288,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Write surface and volumetric point coordinates. ---*/ @@ -307,7 +307,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -323,7 +323,7 @@ void CParaviewFileWriter::Write_Data(){ Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Write surface and volumetric point coordinates. ---*/ @@ -340,7 +340,7 @@ void CParaviewFileWriter::Write_Data(){ } Paraview_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } diff --git a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp index aba6a6bc5765..33281e83190a 100644 --- a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp @@ -157,7 +157,7 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ for (unsigned long i = 0; i < num_halo_nodes; ++i) ++num_nodes_to_receive[neighbor_partitions[i]]; num_nodes_to_send.resize(size); - SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, SU2_MPI::GetComm()); /* Now send the global node numbers whose data we need, and receive the same from all other ranks. @@ -182,7 +182,7 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); /* Now actually send and receive the data */ data_to_send.resize(max(1, total_num_nodes_to_send * fieldNames.size())); @@ -211,7 +211,7 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ SU2_MPI::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); } @@ -244,12 +244,12 @@ void CSTLFileWriter::GatherCoordData(){ to the master node with collective calls. ---*/ SU2_MPI::Allreduce(&nLocalTriaAll, &max_nLocalTriaAll, 1, - MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); SU2_MPI::Gather(&nLocalTriaAll , 1, MPI_UNSIGNED_LONG, buffRecvTriaCount, 1, MPI_UNSIGNED_LONG, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Allocate buffer for send/recv of the coordinate data. Only the master rank allocates buffers for the recv. ---*/ buffSendCoords = new su2double[max_nLocalTriaAll*N_POINTS_TRIANGLE*3]; /* Triangle has 3 Points with 3 coords each */ @@ -262,7 +262,7 @@ void CSTLFileWriter::GatherCoordData(){ /*--- Collective comms of the solution data and global IDs. ---*/ SU2_MPI::Gather(buffSendCoords, static_cast(max_nLocalTriaAll*N_POINTS_TRIANGLE*3), MPI_DOUBLE, buffRecvCoords, static_cast(max_nLocalTriaAll*N_POINTS_TRIANGLE*3), MPI_DOUBLE, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Free temporary memory. ---*/ delete [] buffSendCoords; diff --git a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp index 0e0de2555528..e7facb24ebb7 100644 --- a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp @@ -76,7 +76,7 @@ void CSU2FileWriter::Write_Data(){ /*--- Wait for iProcessor to finish and close the file. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); } /*--- Compute and store the write time. ---*/ diff --git a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp index 5a0bf38d09e3..0c81dcc33d8f 100644 --- a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp @@ -114,7 +114,7 @@ void CSU2MeshFileWriter::Write_Data() { } /*--- Communicate offset, implies a barrier. ---*/ - SU2_MPI::Allreduce(&nElem, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nElem, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); } /*--- Write the node coordinates. ---*/ @@ -150,7 +150,7 @@ void CSU2MeshFileWriter::Write_Data() { } /*--- Communicate offset, implies a barrier. ---*/ - SU2_MPI::Allreduce(&myPoint, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myPoint, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); } if (rank == MASTER_NODE) { @@ -248,5 +248,5 @@ void CSU2MeshFileWriter::Write_Data() { output_file.close(); } - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); } diff --git a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp index 1a938d40883f..d548dd655b42 100644 --- a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp @@ -58,7 +58,7 @@ CSurfaceFEMDataSorter::CSurfaceFEMDataSorter(CConfig *config, CGeometry *geometr } SU2_MPI::Allreduce(&nLocalPointsBeforeSort, &nGlobalPointBeforeSort, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Create the linear partitioner --- */ @@ -154,7 +154,7 @@ void CSurfaceFEMDataSorter::SortOutputData() { vector nDOFRecv(size); SU2_MPI::Alltoall(nDOFSend.data(), 1, MPI_UNSIGNED_LONG, - nDOFRecv.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + nDOFRecv.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /* Determine the number of messages this rank will receive. */ int nRankRecv = 0; @@ -172,7 +172,7 @@ void CSurfaceFEMDataSorter::SortOutputData() { for(int i=0; i num_nodes_to_send(size); - SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, MPI_COMM_WORLD); + SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, SU2_MPI::GetComm()); /* Now send the global node numbers whose data we need, and receive the same from all other ranks. @@ -237,7 +237,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); /* Now actually send and receive the data */ vector data_to_send(max(1, total_num_nodes_to_send * (int)fieldNames.size())); @@ -260,7 +260,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ } CBaseMPIWrapper::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); } else { /* Zone will be gathered to and output by MASTER_NODE */ @@ -290,7 +290,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ vector var_data; unsigned long nPoint = dataSorter->GetnPoints(); vector num_points(size); - SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, &num_points[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, &num_points[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); for(int iRank = 0; iRank < size; ++iRank) { int64_t rank_num_points = num_points[iRank]; @@ -308,7 +308,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ } else { /* Receive data from other rank. */ var_data.resize(max((int64_t)1, (int64_t)fieldNames.size() * rank_num_points)); - CBaseMPIWrapper::Recv(&var_data[0], fieldNames.size() * rank_num_points, MPI_DOUBLE, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + CBaseMPIWrapper::Recv(&var_data[0], fieldNames.size() * rank_num_points, MPI_DOUBLE, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); for (iVar = 0; err == 0 && iVar < fieldNames.size(); iVar++) { err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &var_data[iVar * rank_num_points]); if (err) cout << rank << ": Error outputting Tecplot surface variable values." << endl; @@ -320,7 +320,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ else { /* Send data to MASTER_NODE */ unsigned long nPoint = dataSorter->GetnPoints(); - SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector var_data; size_t var_data_size = fieldNames.size() * dataSorter->GetnPoints(); @@ -330,7 +330,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ var_data.push_back(dataSorter->GetData(iVar,i)); if (var_data.size() > 0) - CBaseMPIWrapper::Send(&var_data[0], static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, MPI_COMM_WORLD); + CBaseMPIWrapper::Send(&var_data[0], static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, SU2_MPI::GetComm()); } } @@ -431,7 +431,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ vector connectivity_sizes(size); unsigned long unused = 0; - SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, &connectivity_sizes[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, &connectivity_sizes[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector connectivity; for(int iRank = 0; iRank < size; ++iRank) { if (iRank == rank) { @@ -462,7 +462,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ } else { /* Receive node map and write out. */ connectivity.resize(max((unsigned long)1, connectivity_sizes[iRank])); - SU2_MPI::Recv(&connectivity[0], connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + SU2_MPI::Recv(&connectivity[0], connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, connectivity_sizes[iRank], &connectivity[0]); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } @@ -473,7 +473,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ unsigned long connectivity_size; connectivity_size = 2 * nParallel_Line + 4 * (nParallel_Tria + nParallel_Quad); - SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector connectivity; connectivity.reserve(connectivity_size); for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { @@ -496,7 +496,7 @@ void CTecplotBinaryFileWriter::Write_Data(){ } if (connectivity.empty()) connectivity.resize(1); /* Avoid crash */ - SU2_MPI::Send(&connectivity[0], connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, MPI_COMM_WORLD); + SU2_MPI::Send(&connectivity[0], connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, SU2_MPI::GetComm()); } } #else diff --git a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp index 4236ab560a2a..c0631451dd3e 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp @@ -118,7 +118,7 @@ void CTecplotFileWriter::Write_Data(){ } #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif /*--- Each processor opens the file. ---*/ @@ -142,7 +142,7 @@ void CTecplotFileWriter::Write_Data(){ Tecplot_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -204,7 +204,7 @@ void CTecplotFileWriter::Write_Data(){ } Tecplot_File.flush(); #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index b3aabf724d9a..c10a2bf1d866 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -4685,7 +4685,7 @@ void COutputLegacy::SetCp_InverseDesign(CSolver *solver_container, CGeometry *ge nPointLocal = geometry->GetnPoint(); #ifdef HAVE_MPI - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else nPointGlobal = nPointLocal; #endif @@ -4811,7 +4811,7 @@ void COutputLegacy::SetCp_InverseDesign(CSolver *solver_container, CGeometry *ge #ifdef HAVE_MPI su2double MyPressDiff = PressDiff; PressDiff = 0.0; - SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- Update the total Cp difference coeffient ---*/ @@ -4837,7 +4837,7 @@ void COutputLegacy::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeomet nPointLocal = geometry->GetnPoint(); #ifdef HAVE_MPI - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else nPointGlobal = nPointLocal; #endif @@ -4962,7 +4962,7 @@ void COutputLegacy::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeomet #ifdef HAVE_MPI su2double MyHeatFluxDiff = HeatFluxDiff; HeatFluxDiff = 0.0; - SU2_MPI::Allreduce(&MyHeatFluxDiff, &HeatFluxDiff, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyHeatFluxDiff, &HeatFluxDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- Update the total HeatFlux difference coeffient ---*/ @@ -5102,7 +5102,7 @@ void COutputLegacy::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry #else int nProcessor; - SU2_MPI::Comm_size(MPI_COMM_WORLD, &nProcessor); + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &nProcessor); unsigned long nLocalVertex_NearField = 0, MaxLocalVertex_NearField = 0; int iProcessor; @@ -5132,9 +5132,9 @@ void COutputLegacy::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry /*--- Send Near-Field vertex information --*/ - SU2_MPI::Allreduce(&nLocalVertex_NearField, &nVertex_NearField, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nLocalVertex_NearField, &MaxLocalVertex_NearField, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nLocalVertex_NearField, &nVertex_NearField, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocalVertex_NearField, &MaxLocalVertex_NearField, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); delete [] Buffer_Send_nVertex; su2double *Buffer_Send_Xcoord = new su2double[MaxLocalVertex_NearField]; @@ -5197,12 +5197,12 @@ void COutputLegacy::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry /*--- Send all the information --*/ - SU2_MPI::Gather(Buffer_Send_Xcoord, nBuffer_Xcoord, MPI_DOUBLE, Buffer_Receive_Xcoord, nBuffer_Xcoord, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Ycoord, nBuffer_Ycoord, MPI_DOUBLE, Buffer_Receive_Ycoord, nBuffer_Ycoord, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Zcoord, nBuffer_Zcoord, MPI_DOUBLE, Buffer_Receive_Zcoord, nBuffer_Zcoord, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_IdPoint, nBuffer_IdPoint, MPI_UNSIGNED_LONG, Buffer_Receive_IdPoint, nBuffer_IdPoint, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Pressure, nBuffer_Pressure, MPI_DOUBLE, Buffer_Receive_Pressure, nBuffer_Pressure, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_FaceArea, nBuffer_FaceArea, MPI_DOUBLE, Buffer_Receive_FaceArea, nBuffer_FaceArea, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(Buffer_Send_Xcoord, nBuffer_Xcoord, MPI_DOUBLE, Buffer_Receive_Xcoord, nBuffer_Xcoord, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Ycoord, nBuffer_Ycoord, MPI_DOUBLE, Buffer_Receive_Ycoord, nBuffer_Ycoord, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Zcoord, nBuffer_Zcoord, MPI_DOUBLE, Buffer_Receive_Zcoord, nBuffer_Zcoord, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_IdPoint, nBuffer_IdPoint, MPI_UNSIGNED_LONG, Buffer_Receive_IdPoint, nBuffer_IdPoint, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Pressure, nBuffer_Pressure, MPI_DOUBLE, Buffer_Receive_Pressure, nBuffer_Pressure, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_FaceArea, nBuffer_FaceArea, MPI_DOUBLE, Buffer_Receive_FaceArea, nBuffer_FaceArea, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); delete [] Buffer_Send_Xcoord; delete [] Buffer_Send_Ycoord; delete [] Buffer_Send_Zcoord; @@ -5592,7 +5592,7 @@ void COutputLegacy::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry /*--- Send the value of the NearField coefficient to all the processors ---*/ - SU2_MPI::Bcast(&InverseDesign, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&InverseDesign, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); /*--- Store the value of the NearField coefficient ---*/ @@ -5692,8 +5692,8 @@ void COutputLegacy::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometr if (rank == MASTER_NODE) Buffer_Recv_nVertex = new unsigned long [nProcessor]; #ifdef HAVE_MPI - SU2_MPI::Allreduce(&nLocalVertex_Surface, &MaxLocalVertex_Surface, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Gather(&Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nLocalVertex_Surface, &MaxLocalVertex_Surface, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Gather(&Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); #else MaxLocalVertex_Surface = nLocalVertex_Surface; Buffer_Recv_nVertex[MASTER_NODE] = Buffer_Send_nVertex[MASTER_NODE]; @@ -5840,19 +5840,19 @@ void COutputLegacy::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometr #ifdef HAVE_MPI - SU2_MPI::Gather(Buffer_Send_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_PT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_PT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_TT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_TT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_P, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_P, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_T, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_T, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_q, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_q, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_Area, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Area, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(Buffer_Send_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_PT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_PT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_TT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_TT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_P, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_P, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_T, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_T, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_q, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_q, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Area, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Area, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); #else @@ -7568,19 +7568,19 @@ void COutputLegacy::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geo #ifdef HAVE_MPI if (config->GetComm_Level() == COMM_FULL) { - SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } #else diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 1e94251fdd02..fde9093bc583 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -35,7 +35,7 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geom int rank = MASTER_NODE; #ifdef HAVE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(SU2_MPI::GetComm(), &rank); #endif /* --- Initialize boundary conditions customization, this is achieve through the Python wrapper --- */ @@ -855,7 +855,7 @@ void CFluidDriver::StaticMeshUpdate() { int rank = MASTER_NODE; #ifdef HAVE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(SU2_MPI::GetComm(), &rank); #endif for(iZone = 0; iZone < nZone; iZone++) { @@ -958,7 +958,7 @@ void CFluidDriver::BoundaryConditionsUpdate(){ unsigned short iZone; #ifdef HAVE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(SU2_MPI::GetComm(), &rank); #endif if(rank == MASTER_NODE) cout << "Updating boundary conditions." << endl; diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index 3ffa769de6f6..ea07d1cd5bd8 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -316,7 +316,7 @@ CAdjEulerSolver::CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned #ifdef HAVE_MPI Area_Monitored = 0.0; - SU2_MPI::Allreduce(&myArea_Monitored, &Area_Monitored, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myArea_Monitored, &Area_Monitored, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #else Area_Monitored = myArea_Monitored; #endif @@ -478,7 +478,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Communicate the counts to iDomain with non-blocking sends ---*/ - SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, MPI_COMM_WORLD, &req); + SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } else { @@ -504,7 +504,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Recv the data by probing for the current sender, jDomain, first and then receiving the values from it. ---*/ - SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, SU2_MPI::GetComm(), &status); } } @@ -514,7 +514,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Initialize the counters for the larger send buffers (by domain) ---*/ @@ -568,7 +568,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo SU2_MPI::Isend(&Buffer_Send_AdjVar[PointTotal_Counter*(nVar+3)], nPointTotal_s[iDomain]*(nVar+3), MPI_DOUBLE, iDomain, - iDomain, MPI_COMM_WORLD, &req); + iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } @@ -612,7 +612,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- The next section begins the recv of all data for the interior points/elements in the mesh. First, create the domain structures for @@ -632,7 +632,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Receive the buffers with the coords, global index, and colors ---*/ SU2_MPI::Recv(Buffer_Receive_AdjVar, nPointTotal_r[iDomain]*(nVar+3) , MPI_DOUBLE, - iDomain, rank, MPI_COMM_WORLD, &status); + iDomain, rank, SU2_MPI::GetComm(), &status); /*--- Loop over all of the points that we have recv'd and store the coords, global index vertex and markers ---*/ @@ -664,7 +664,7 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Free all of the memory used for communicating points and elements ---*/ @@ -711,7 +711,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { nDomain = size; - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- This loop gets the array sizes of points for each rank to send to each other rank. ---*/ @@ -763,7 +763,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Communicate the counts to iDomain with non-blocking sends ---*/ - SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, MPI_COMM_WORLD, &req); + SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } else { @@ -789,7 +789,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Recv the data by probing for the current sender, jDomain, first and then receiving the values from it. ---*/ - SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, SU2_MPI::GetComm(), &status); } } @@ -799,7 +799,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Initialize the counters for the larger send buffers (by domain) ---*/ @@ -852,7 +852,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { SU2_MPI::Isend(&Buffer_Send_AdjVar[PointTotal_Counter*(nVar+3)], nPointTotal_s[iDomain]*(nVar+3), MPI_DOUBLE, iDomain, - iDomain, MPI_COMM_WORLD, &req); + iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } @@ -896,7 +896,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- The next section begins the recv of all data for the interior points/elements in the mesh. First, create the domain structures for @@ -916,7 +916,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Receive the buffers with the coords, global index, and colors ---*/ SU2_MPI::Recv(Buffer_Receive_AdjVar, nPointTotal_r[iDomain]*(nVar+3) , MPI_DOUBLE, - iDomain, rank, MPI_COMM_WORLD, &status); + iDomain, rank, SU2_MPI::GetComm(), &status); /*--- Loop over all of the points that we have recv'd and store the @@ -949,7 +949,7 @@ void CAdjEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Free all of the memory used for communicating points and elements ---*/ @@ -1620,7 +1620,7 @@ void CAdjEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (config->GetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI unsigned long MyErrorCounter = nonPhysicalPoints; nonPhysicalPoints = 0; - SU2_MPI::Allreduce(&MyErrorCounter, &nonPhysicalPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyErrorCounter, &nonPhysicalPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #endif if (iMesh == MESH_0) config->SetNonphysical_Points(nonPhysicalPoints); } @@ -1832,7 +1832,7 @@ void CAdjEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont if (config->GetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI - SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); #else counter_global = counter_local; #endif @@ -2696,12 +2696,12 @@ void CAdjEulerSolver::Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver su2double MyTotal_Sens_Temp = Total_Sens_Temp; Total_Sens_Temp = 0.0; su2double MyTotal_Sens_BPress = Total_Sens_BPress; Total_Sens_BPress = 0.0; - SU2_MPI::Allreduce(&MyTotal_Sens_Geo, &Total_Sens_Geo, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyTotal_Sens_Geo, &Total_Sens_Geo, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif @@ -4752,7 +4752,7 @@ void CAdjEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf #ifndef HAVE_MPI rbuf_NotMatching = sbuf_NotMatching; #else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); #endif if (rbuf_NotMatching != 0) { SU2_MPI::Error(string("The solution file ") + filename + string(" doesn't match with the mesh file!\n") + diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 980b7b32dde3..439aa053d6f7 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -254,7 +254,7 @@ CAdjNSSolver::CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short #ifdef HAVE_MPI Area_Monitored = 0.0; - SU2_MPI::Allreduce(&myArea_Monitored, &Area_Monitored, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myArea_Monitored, &Area_Monitored, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #else Area_Monitored = myArea_Monitored; #endif @@ -395,7 +395,7 @@ void CAdjNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (config->GetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI unsigned long MyErrorCounter = nonPhysicalPoints; nonPhysicalPoints = 0; - SU2_MPI::Allreduce(&MyErrorCounter, &nonPhysicalPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyErrorCounter, &nonPhysicalPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #endif if (iMesh == MESH_0) config->SetNonphysical_Points(nonPhysicalPoints); } @@ -1155,11 +1155,11 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con su2double MyTotal_Sens_Press = Total_Sens_Press; Total_Sens_Press = 0.0; su2double MyTotal_Sens_Temp = Total_Sens_Temp; Total_Sens_Temp = 0.0; - SU2_MPI::Allreduce(&MyTotal_Sens_Geo, &Total_Sens_Geo, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotal_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyTotal_Sens_Geo, &Total_Sens_Geo, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotal_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif diff --git a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp index 59b5643032d6..01c8a58bf99d 100644 --- a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp @@ -161,7 +161,7 @@ CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned sh #ifndef HAVE_MPI rbuf_NotMatching = sbuf_NotMatching; #else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); #endif if (rbuf_NotMatching != 0) { SU2_MPI::Error(string("The solution file ") + filename + string(" doesn't match with the mesh file!\n") + diff --git a/SU2_CFD/src/solvers/CBaselineSolver.cpp b/SU2_CFD/src/solvers/CBaselineSolver.cpp index e669add5f441..7900acc2a9ba 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver.cpp @@ -157,7 +157,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -175,7 +175,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Broadcast the number of variables to all procs and store more clearly. ---*/ - SU2_MPI::Bcast(var_buf, nVar_Buf, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(var_buf, nVar_Buf, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -208,7 +208,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Broadcast the string names of the variables. ---*/ SU2_MPI::Bcast(mpi_str_buf, nVar*CGNS_STRING_SIZE, MPI_CHAR, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); fields.push_back("Point_ID"); @@ -283,7 +283,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -298,7 +298,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ diff --git a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp index 63b07e05d521..faf3c855c8fd 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp @@ -65,7 +65,7 @@ CBaselineSolver_FEM::CBaselineSolver_FEM(CGeometry *geometry, CConfig *config) { /*--- Determine the global number of DOFs. ---*/ #ifdef HAVE_MPI - SU2_MPI::Allreduce(&nDOFsLocOwned, &nDOFsGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nDOFsLocOwned, &nDOFsGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else nDOFsGlobal = nDOFsLocOwned; #endif @@ -157,7 +157,7 @@ void CBaselineSolver_FEM::SetOutputVariables(CGeometry *geometry, CConfig *confi char fname[100]; strcpy(fname, filename.c_str()); - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -174,7 +174,7 @@ void CBaselineSolver_FEM::SetOutputVariables(CGeometry *geometry, CConfig *confi /*--- Broadcast the number of variables to all procs and store more clearly. ---*/ - SU2_MPI::Bcast(var_buf, nVar_Buf, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(var_buf, nVar_Buf, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -244,7 +244,7 @@ void CBaselineSolver_FEM::SetOutputVariables(CGeometry *geometry, CConfig *confi char fname[100]; strcpy(fname, filename.c_str()); - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -259,7 +259,7 @@ void CBaselineSolver_FEM::SetOutputVariables(CGeometry *geometry, CConfig *confi /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -368,7 +368,7 @@ void CBaselineSolver_FEM::LoadRestart(CGeometry **geometry, CSolver ***solver, C #ifdef HAVE_MPI unsigned short sbuf_NotMatching = rbuf_NotMatching; - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); #endif if (rbuf_NotMatching != 0) diff --git a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp index 06bbc899e635..a0d9d81596e0 100644 --- a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp @@ -639,10 +639,10 @@ void CDiscAdjFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *c } } - SU2_MPI::Allreduce(Local_Sens_E, Global_Sens_E, nMPROP, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Local_Sens_Nu, Global_Sens_Nu, nMPROP, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Local_Sens_Rho, Global_Sens_Rho, nMPROP, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Local_Sens_Rho_DL, Global_Sens_Rho_DL, nMPROP, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Local_Sens_E, Global_Sens_E, nMPROP, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Local_Sens_Nu, Global_Sens_Nu, nMPROP, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Local_Sens_Rho, Global_Sens_Rho, nMPROP, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Local_Sens_Rho_DL, Global_Sens_Rho_DL, nMPROP, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Extract the adjoint values of the electric field in the case that it is a parameter of the problem. ---*/ @@ -651,7 +651,7 @@ void CDiscAdjFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *c if (local_index) Local_Sens_EField[iVar] = AD::GetDerivative(AD_Idx_EField[iVar]); else Local_Sens_EField[iVar] = SU2_TYPE::GetDerivative(EField[iVar]); } - SU2_MPI::Allreduce(Local_Sens_EField, Global_Sens_EField, nEField, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Local_Sens_EField, Global_Sens_EField, nEField, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } if (fea_dv) { @@ -659,7 +659,7 @@ void CDiscAdjFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *c if (local_index) Local_Sens_DV[iVar] = AD::GetDerivative(AD_Idx_DV_Val[iVar]); else Local_Sens_DV[iVar] = SU2_TYPE::GetDerivative(DV_Val[iVar]); } - SU2_MPI::Allreduce(Local_Sens_DV, Global_Sens_DV, nDV, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Local_Sens_DV, Global_Sens_DV, nDV, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } /*--- Extract the flow traction sensitivities ---*/ diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index bae0c0de8fc1..efed6499cd09 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -483,10 +483,10 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_Temp = SU2_TYPE::GetDerivative(Temperature); Local_Sens_Press = SU2_TYPE::GetDerivative(Pressure); - SU2_MPI::Allreduce(&Local_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_Sens_Mach, &Total_Sens_Mach, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_AoA, &Total_Sens_AoA, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } if ((config->GetKind_Regime() == COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && config->GetBoolTurbomachinery()){ @@ -495,8 +495,8 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_BPress = SU2_TYPE::GetDerivative(BPressure); Local_Sens_Temperature = SU2_TYPE::GetDerivative(Temperature); - SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_Temperature, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_Temperature, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } if ((config->GetKind_Regime() == INCOMPRESSIBLE) && @@ -509,9 +509,9 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf Local_Sens_BPress = SU2_TYPE::GetDerivative(BPressure); Local_Sens_Temp = SU2_TYPE::GetDerivative(Temperature); - SU2_MPI::Allreduce(&Local_Sens_ModVel, &Total_Sens_ModVel, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_Sens_ModVel, &Total_Sens_ModVel, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_BPress, &Total_Sens_BPress, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } if ((config->GetKind_Regime() == INCOMPRESSIBLE) && @@ -521,7 +521,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf su2double Local_Sens_Temp_Rad; Local_Sens_Temp_Rad = SU2_TYPE::GetDerivative(TemperatureRad); - SU2_MPI::Allreduce(&Local_Sens_Temp_Rad, &Total_Sens_Temp_Rad, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Local_Sens_Temp_Rad, &Total_Sens_Temp_Rad, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Store it in the Total_Sens_Temp container so it's accessible without the need of a new method ---*/ Total_Sens_Temp = Total_Sens_Temp_Rad; @@ -768,7 +768,7 @@ void CDiscAdjSolver::SetSurface_Sensitivity(CGeometry *geometry, CConfig *config Sens_Geo[iMarker_Monitoring] = 0.0; } - SU2_MPI::Allreduce(MySens_Geo, Sens_Geo, config->GetnMarker_Monitoring(), MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(MySens_Geo, Sens_Geo, config->GetnMarker_Monitoring(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); delete [] MySens_Geo; #endif @@ -886,7 +886,7 @@ void CDiscAdjSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi if (iPoint_Global_Local < nPointDomain) { sbuf_NotMatching = 1; } - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); if (rbuf_NotMatching != 0) { SU2_MPI::Error(string("The solution file ") + filename + string(" doesn't match with the mesh file!\n") + diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 83221d895ccc..02ea8acb36ef 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -336,7 +336,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, if (config->GetComm_Level() == COMM_FULL) { - SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); if ((rank == MASTER_NODE) && (counter_global != 0)) cout << "Warning. The original solution contains " << counter_global << " points that are not physical." << endl; @@ -916,7 +916,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Communicate the counts to iDomain with non-blocking sends ---*/ - SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, MPI_COMM_WORLD, &req); + SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } else { @@ -942,7 +942,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Recv the data by probing for the current sender, jDomain, first and then receiving the values from it. ---*/ - SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, SU2_MPI::GetComm(), &status); } } @@ -952,7 +952,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Initialize the counters for the larger send buffers (by domain) ---*/ @@ -1014,12 +1014,12 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet SU2_MPI::Isend(&Buffer_Send_PrimVar[PointTotal_Counter*(nPrimVar_)], nPointTotal_s[iDomain]*(nPrimVar_), MPI_DOUBLE, iDomain, - iDomain, MPI_COMM_WORLD, &req); + iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); SU2_MPI::Isend(&Buffer_Send_Data[PointTotal_Counter*(3)], nPointTotal_s[iDomain]*(3), MPI_LONG, iDomain, - iDomain+nDomain, MPI_COMM_WORLD, &req); + iDomain+nDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } @@ -1070,7 +1070,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- The next section begins the recv of all data for the interior points/elements in the mesh. First, create the domain structures for @@ -1091,10 +1091,10 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Receive the buffers with the coords, global index, and colors ---*/ SU2_MPI::Recv(Buffer_Receive_PrimVar, nPointTotal_r[iDomain]*(nPrimVar_) , MPI_DOUBLE, - iDomain, rank, MPI_COMM_WORLD, &status); + iDomain, rank, SU2_MPI::GetComm(), &status); SU2_MPI::Recv(Buffer_Receive_Data, nPointTotal_r[iDomain]*(3) , MPI_LONG, - iDomain, rank+nDomain, MPI_COMM_WORLD, &status); + iDomain, rank+nDomain, SU2_MPI::GetComm(), &status); /*--- Loop over all of the points that we have recv'd and store the coords, global index vertex and markers ---*/ @@ -1129,7 +1129,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Free all of the memory used for communicating points and elements ---*/ @@ -1226,7 +1226,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Communicate the counts to iDomain with non-blocking sends ---*/ - SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, MPI_COMM_WORLD, &req); + SU2_MPI::Isend(&nPointTotal_s[iDomain], 1, MPI_UNSIGNED_LONG, iDomain, iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } else { @@ -1252,7 +1252,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Recv the data by probing for the current sender, jDomain, first and then receiving the values from it. ---*/ - SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Recv(&nPointTotal_r[jDomain], 1, MPI_UNSIGNED_LONG, jDomain, rank, SU2_MPI::GetComm(), &status); } } @@ -1262,7 +1262,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Initialize the counters for the larger send buffers (by domain) ---*/ @@ -1313,7 +1313,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { SU2_MPI::Isend(&Buffer_Send_PrimVar[PointTotal_Counter*(nPrimVar+3)], nPointTotal_s[iDomain]*(nPrimVar+3), MPI_DOUBLE, iDomain, - iDomain, MPI_COMM_WORLD, &req); + iDomain, SU2_MPI::GetComm(), &req); SU2_MPI::Request_free(&req); } @@ -1363,7 +1363,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- The next section begins the recv of all data for the interior points/elements in the mesh. First, create the domain structures for @@ -1383,7 +1383,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Receive the buffers with the coords, global index, and colors ---*/ SU2_MPI::Recv(Buffer_Receive_PrimVar, nPointTotal_r[iDomain]*(nPrimVar+3) , MPI_DOUBLE, - iDomain, rank, MPI_COMM_WORLD, &status); + iDomain, rank, SU2_MPI::GetComm(), &status); /*--- Loop over all of the points that we have recv'd and store the coords, global index vertex and markers ---*/ @@ -1421,7 +1421,7 @@ void CEulerSolver::Set_MPI_Nearfield(CGeometry *geometry, CConfig *config) { /*--- Wait for the non-blocking sends to complete. ---*/ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); /*--- Free all of the memory used for communicating points and elements ---*/ @@ -2207,7 +2207,7 @@ void CEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_con SU2_OMP_MASTER { unsigned long tmp = ErrorCounter; - SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); config->SetNonphysical_Points(ErrorCounter); } SU2_OMP_BARRIER @@ -2512,10 +2512,10 @@ void CEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, SU2_OMP_MASTER if (config->GetComm_Level() == COMM_FULL) { su2double rbuf_time; - SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; - SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; } SU2_OMP_BARRIER @@ -2567,7 +2567,7 @@ void CEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, SU2_OMP_MASTER { - SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = glbDtND; config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); @@ -2836,7 +2836,7 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain SU2_OMP_MASTER { counter_local = ErrorCounter; - SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); config->SetNonphysical_Reconstr(ErrorCounter); } SU2_OMP_BARRIER @@ -4080,32 +4080,32 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns /*--- All the ranks to compute the total value ---*/ - SU2_MPI::Allreduce(Inlet_MassFlow_Local, Inlet_MassFlow_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_ReverseMassFlow_Local, Inlet_ReverseMassFlow_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Pressure_Local, Inlet_Pressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Mach_Local, Inlet_Mach_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_MinPressure_Local, Inlet_MinPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_MaxPressure_Local, Inlet_MaxPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_TotalPressure_Local, Inlet_TotalPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Temperature_Local, Inlet_Temperature_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_TotalTemperature_Local, Inlet_TotalTemperature_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_RamDrag_Local, Inlet_RamDrag_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Force_Local, Inlet_Force_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Power_Local, Inlet_Power_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_Area_Local, Inlet_Area_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_XCG_Local, Inlet_XCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Inlet_YCG_Local, Inlet_YCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - if (nDim == 3) SU2_MPI::Allreduce(Inlet_ZCG_Local, Inlet_ZCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - - SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Pressure_Local, Outlet_Pressure_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_TotalPressure_Local, Outlet_TotalPressure_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_TotalTemperature_Local, Outlet_TotalTemperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_GrossThrust_Local, Outlet_GrossThrust_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Force_Local, Outlet_Force_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Power_Local, Outlet_Power_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Inlet_MassFlow_Local, Inlet_MassFlow_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_ReverseMassFlow_Local, Inlet_ReverseMassFlow_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Pressure_Local, Inlet_Pressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Mach_Local, Inlet_Mach_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_MinPressure_Local, Inlet_MinPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_MaxPressure_Local, Inlet_MaxPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_TotalPressure_Local, Inlet_TotalPressure_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Temperature_Local, Inlet_Temperature_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_TotalTemperature_Local, Inlet_TotalTemperature_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_RamDrag_Local, Inlet_RamDrag_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Force_Local, Inlet_Force_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Power_Local, Inlet_Power_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_Area_Local, Inlet_Area_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_XCG_Local, Inlet_XCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Inlet_YCG_Local, Inlet_YCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + if (nDim == 3) SU2_MPI::Allreduce(Inlet_ZCG_Local, Inlet_ZCG_Total, nMarker_Inlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + + SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Pressure_Local, Outlet_Pressure_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_TotalPressure_Local, Outlet_TotalPressure_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Temperature_Local, Outlet_Temperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_TotalTemperature_Local, Outlet_TotalTemperature_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_GrossThrust_Local, Outlet_GrossThrust_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Force_Local, Outlet_Force_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Power_Local, Outlet_Power_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Compute the value of the average surface temperature and pressure and set the value in the config structure for future use ---*/ @@ -5084,7 +5084,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con if (!ActDisk_Info) config->SetInitial_BCThrust(0.0); MyBCThrust = config->GetInitial_BCThrust(); - SU2_MPI::Allreduce(&MyBCThrust, &BCThrust, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyBCThrust, &BCThrust, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); config->SetInitial_BCThrust(BCThrust); } @@ -6977,12 +6977,12 @@ void CEulerSolver::PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNum cktemp_out2 = complex(0.0,0.0); - SU2_MPI::Allreduce(&MyRe_inf, &Re_inf, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyIm_inf, &Im_inf, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyRe_out1, &Re_out1, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyIm_out1, &Im_out1, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyRe_out2, &Re_out2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyIm_out2, &Im_out2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyRe_inf, &Re_inf, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyIm_inf, &Im_inf, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyRe_out1, &Re_out1, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyIm_out1, &Im_out1, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyRe_out2, &Re_out2, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyIm_out2, &Im_out2, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); cktemp_inf = complex(Re_inf,Im_inf); cktemp_out1 = complex(Re_out1,Im_out1); @@ -10324,8 +10324,8 @@ void CEulerSolver::PreprocessAverage(CSolver **solver, CGeometry *geometry, CCon su2double MyTotalAreaDensity = TotalAreaDensity; su2double MyTotalAreaPressure = TotalAreaPressure; - SU2_MPI::Allreduce(&MyTotalAreaDensity, &TotalAreaDensity, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyTotalAreaPressure, &TotalAreaPressure, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyTotalAreaDensity, &TotalAreaDensity, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyTotalAreaPressure, &TotalAreaPressure, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); su2double* MyTotalAreaVelocity = new su2double[nDim]; @@ -10333,7 +10333,7 @@ void CEulerSolver::PreprocessAverage(CSolver **solver, CGeometry *geometry, CCon MyTotalAreaVelocity[iDim] = TotalAreaVelocity[iDim]; } - SU2_MPI::Allreduce(MyTotalAreaVelocity, TotalAreaVelocity, nDim, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(MyTotalAreaVelocity, TotalAreaVelocity, nDim, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); delete [] MyTotalAreaVelocity; @@ -10652,7 +10652,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC auto Allreduce = [](su2double x) { su2double tmp = x; x = 0.0; - SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &x, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); return x; }; @@ -10677,7 +10677,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC su2double* buffer = new su2double[max(nVar,nDim)]; auto Allreduce_inplace = [buffer](int size, su2double* x) { - SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); for(int i=0; i numPoints(size); unsigned long num = myPoints.size(); - SU2_MPI::Allgather(&num, 1, MPI_UNSIGNED_LONG, numPoints.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + SU2_MPI::Allgather(&num, 1, MPI_UNSIGNED_LONG, numPoints.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Global to local map for the halo points of the rank (not covered by the CGeometry map). ---*/ unordered_map Global2Local; @@ -746,13 +746,13 @@ void CFEASolver::Set_VertexEliminationSchedule(CGeometry *geometry, const vector for (int i = 0; i < size; ++i) { /*--- Send our point list. ---*/ if (rank == i) { - SU2_MPI::Bcast(myPoints.data(), numPoints[i], MPI_UNSIGNED_LONG, rank, MPI_COMM_WORLD); + SU2_MPI::Bcast(myPoints.data(), numPoints[i], MPI_UNSIGNED_LONG, rank, SU2_MPI::GetComm()); continue; } /*--- Receive point list. ---*/ vector theirPoints(numPoints[i]); - SU2_MPI::Bcast(theirPoints.data(), numPoints[i], MPI_UNSIGNED_LONG, i, MPI_COMM_WORLD); + SU2_MPI::Bcast(theirPoints.data(), numPoints[i], MPI_UNSIGNED_LONG, i, SU2_MPI::GetComm()); for (auto iPointGlobal : theirPoints) { /*--- Check if the rank has the point. ---*/ @@ -1475,7 +1475,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, } // end SU2_OMP_PARALLEL su2double tmp = MaxVonMises_Stress; - SU2_MPI::Allreduce(&tmp, &MaxVonMises_Stress, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &MaxVonMises_Stress, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); /*--- Set the value of the MaxVonMises_Stress as the CFEA coeffient ---*/ @@ -2860,8 +2860,8 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, CConfig *config, } - SU2_MPI::Allreduce(&sbuf_numAitk, &rbuf_numAitk, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&sbuf_denAitk, &rbuf_denAitk, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_numAitk, &rbuf_numAitk, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&sbuf_denAitk, &rbuf_denAitk, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); WAitkDyn = GetWAitken_Dyn(); @@ -3011,7 +3011,7 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ atomicAdd(obj_fun_local, objective_function); } - SU2_MPI::Allreduce(&objective_function, &Total_OFRefGeom, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&objective_function, &Total_OFRefGeom, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); Total_OFRefGeom *= config->GetRefGeom_Penalty() / geometry->GetGlobal_nPointDomain(); Total_OFRefGeom += PenaltyValue; @@ -3054,7 +3054,7 @@ void CFEASolver::Compute_OFRefNode(CGeometry *geometry, const CConfig *config){ } } - SU2_MPI::Allreduce(dist, dist_reduce, MAXNVAR, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(dist, dist_reduce, MAXNVAR, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); Total_OFRefNode = config->GetRefNode_Penalty() * Norm(int(MAXNVAR),dist_reduce) + PenaltyValue; @@ -3107,11 +3107,11 @@ void CFEASolver::Compute_OFVolFrac(CGeometry *geometry, const CConfig *config) } su2double tmp; - SU2_MPI::Allreduce(&total_volume,&tmp,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(&total_volume,&tmp,1,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); total_volume = tmp; - SU2_MPI::Allreduce(&integral,&tmp,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(&integral,&tmp,1,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); integral = tmp; - SU2_MPI::Allreduce(&discreteness,&tmp,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(&discreteness,&tmp,1,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); discreteness = tmp; Total_OFDiscreteness = discreteness/total_volume; @@ -3167,7 +3167,7 @@ void CFEASolver::Compute_OFCompliance(CGeometry *geometry, const CConfig *config atomicAdd(comp_local, compliance); } - SU2_MPI::Allreduce(&compliance, &Total_OFCompliance, 1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); + SU2_MPI::Allreduce(&compliance, &Total_OFCompliance, 1,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); } @@ -3240,8 +3240,8 @@ void CFEASolver::Stiffness_Penalty(CGeometry *geometry, CNumerics **numerics, CC // Reduce value across processors for parallelization - SU2_MPI::Allreduce(&weightedValue, &weightedValue_reduce, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&totalVolume, &totalVolume_reduce, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&weightedValue, &weightedValue_reduce, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&totalVolume, &totalVolume_reduce, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); su2double ratio = 1.0 - weightedValue_reduce/totalVolume_reduce; @@ -3379,7 +3379,7 @@ void CFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *config) #ifdef HAVE_MPI if (rank == MASTER_NODE) rec_buf = new float[nElemDomain]; /*--- Need to use this version of Reduce instead of the wrapped one because we use float ---*/ - MPI_Reduce(send_buf,rec_buf,nElemDomain,MPI_FLOAT,MPI_SUM,MASTER_NODE,MPI_COMM_WORLD); + MPI_Reduce(send_buf,rec_buf,nElemDomain,MPI_FLOAT,MPI_SUM,MASTER_NODE,SU2_MPI::GetComm()); #else rec_buf = send_buf; #endif diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index d923e4fadf89..5ec7465a6cc8 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -390,7 +390,7 @@ CFEM_DG_EulerSolver::CFEM_DG_EulerSolver(CGeometry *geometry, CConfig *config, u /*--- Determine the global number of DOFs. ---*/ #ifdef HAVE_MPI - SU2_MPI::Allreduce(&nDOFsLocOwned, &nDOFsGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nDOFsLocOwned, &nDOFsGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else nDOFsGlobal = nDOFsLocOwned; #endif @@ -1318,7 +1318,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, #ifdef HAVE_MPI SU2_MPI::Allgather(&nDOFsLocOwned, 1, MPI_UNSIGNED_LONG, &nDOFsPerRank[1], 1, - MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); #else nDOFsPerRank[1] = nDOFsLocOwned; #endif @@ -1369,7 +1369,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Send the data using non-blocking sends to avoid deadlock. */ int dest = ranksSend[i]; SU2_MPI::Isend(sendBuf[i].data(), sendBuf[i].size(), MPI_UNSIGNED_LONG, - dest, dest, MPI_COMM_WORLD, &sendReqs[i]); + dest, dest, SU2_MPI::GetComm(), &sendReqs[i]); } /* Create a map of the receive rank to the index in ranksRecv. */ @@ -1383,7 +1383,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Block until a message arrives and determine the source and size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -1393,7 +1393,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, and determine the actual index of this rank in ranksRecv. */ vector recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, MPI_COMM_WORLD, &status); + source, rank, SU2_MPI::GetComm(), &status); map::const_iterator MI = rankToIndRecvBuf.find(source); source = MI->second; @@ -1415,7 +1415,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else @@ -1523,7 +1523,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Send the data using non-blocking sends to avoid deadlock. */ int dest = ranksRecv[i]; SU2_MPI::Isend(invSendBuf[i].data(), invSendBuf[i].size(), MPI_UNSIGNED_LONG, - dest, dest+1, MPI_COMM_WORLD, &invSendReqs[i]); + dest, dest+1, SU2_MPI::GetComm(), &invSendReqs[i]); } /* Create a map of the inverse receive (i.e. the original send) rank @@ -1539,7 +1539,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Block until a message arrives and determine the source and size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank+1, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -1549,7 +1549,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, and determine the actual index of this rank in ranksSend. */ vector recvBuf(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+1, MPI_COMM_WORLD, &status); + source, rank+1, SU2_MPI::GetComm(), &status); map::const_iterator MI = rankToIndSendBuf.find(source); source = MI->second; @@ -1576,7 +1576,7 @@ void CFEM_DG_EulerSolver::DetermineGraphDOFs(const CMeshFEM *FEMGeometry, /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #else /*--- Sequential implementation. Just add the data of the halo DOFs @@ -1718,7 +1718,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom const int ind = MI->second; SU2_MPI::Isend(sendBuf[ind].data(), sendBuf[ind].size(), MPI_UNSIGNED_LONG, - dest, dest+2, MPI_COMM_WORLD, &sendReqs[i]); + dest, dest+2, SU2_MPI::GetComm(), &sendReqs[i]); } /* Loop over the ranks from which I receive data to be processed. The number @@ -1730,7 +1730,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom /* Block until a message arrives and determine the source and size of the message. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank+2, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank+2, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; int sizeMess; @@ -1742,7 +1742,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom sendReturnBuf[i].resize(sizeMess); SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+2, MPI_COMM_WORLD, &status); + source, rank+2, SU2_MPI::GetComm(), &status); /* Loop over the data just received and fill the return send buffer with the color of the DOFs. */ @@ -1758,7 +1758,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom /* Send the return buffer back to the calling rank. Again use non-blocking sends to avoid deadlock. */ SU2_MPI::Isend(sendReturnBuf[i].data(), sendReturnBuf[i].size(), MPI_INT, - source, source+3, MPI_COMM_WORLD, &sendReturnReqs[i]); + source, source+3, SU2_MPI::GetComm(), &sendReturnReqs[i]); } /* Complete the first round of non-blocking sends. */ @@ -1770,7 +1770,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom /* Block until a message arrives and determine the source of the message and its index in the original send buffers. */ SU2_MPI::Status status; - SU2_MPI::Probe(MPI_ANY_SOURCE, rank+3, MPI_COMM_WORLD, &status); + SU2_MPI::Probe(MPI_ANY_SOURCE, rank+3, SU2_MPI::GetComm(), &status); int source = status.MPI_SOURCE; MI = rankCommToInd.find(source); @@ -1780,7 +1780,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom a blocking receive. */ vector recvBuf(sendBuf[ind].size()); SU2_MPI::Recv(recvBuf.data(), recvBuf.size(), MPI_INT, - source, rank+3, MPI_COMM_WORLD, &status); + source, rank+3, SU2_MPI::GetComm(), &status); /* Loop over the data just received and add them to the map mapMatrixIndToColor .*/ @@ -1793,7 +1793,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom /* Wild cards have been used in the communication, so synchronize the ranks to avoid problems. */ - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif @@ -2433,7 +2433,7 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { } #ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); + SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif } @@ -2750,7 +2750,7 @@ void CFEM_DG_EulerSolver::Initiate_MPI_Communication(CConfig *config, /* Send the data using non-blocking sends. */ int dest = ranksSendMPI[timeLevel][i]; int tag = dest + timeLevel; - SU2_MPI::Isend(sendBuf, ii, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD, + SU2_MPI::Isend(sendBuf, ii, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &commRequests[timeLevel][indComm]); } @@ -2762,7 +2762,7 @@ void CFEM_DG_EulerSolver::Initiate_MPI_Communication(CConfig *config, int tag = rank + timeLevel; SU2_MPI::Irecv(commRecvBuf[timeLevel][i].data(), commRecvBuf[timeLevel][i].size(), - MPI_DOUBLE, source, tag, MPI_COMM_WORLD, + MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), &commRequests[timeLevel][indComm]); } } @@ -2996,7 +2996,7 @@ void CFEM_DG_EulerSolver::Initiate_MPI_ReverseCommunication(CConfig *config, /* Send the data using non-blocking sends. */ int dest = ranksRecvMPI[timeLevel][i]; int tag = dest + timeLevel + 20; - SU2_MPI::Isend(recvBuf, ii, MPI_DOUBLE, dest, tag, MPI_COMM_WORLD, + SU2_MPI::Isend(recvBuf, ii, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &commRequests[timeLevel][indComm]); } @@ -3008,7 +3008,7 @@ void CFEM_DG_EulerSolver::Initiate_MPI_ReverseCommunication(CConfig *config, int tag = rank + timeLevel + 20; SU2_MPI::Irecv(commSendBuf[timeLevel][i].data(), commSendBuf[timeLevel][i].size(), - MPI_DOUBLE, source, tag, MPI_COMM_WORLD, + MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), &commRequests[timeLevel][indComm]); } } @@ -3206,7 +3206,7 @@ void CFEM_DG_EulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_co if (config->GetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI unsigned long MyErrorCounter = ErrorCounter; - SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #endif if (iMesh == MESH_0) config->SetNonphysical_Points(ErrorCounter); } @@ -3726,10 +3726,10 @@ void CFEM_DG_EulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_con if ((config->GetComm_Level() == COMM_FULL) || time_stepping) { #ifdef HAVE_MPI su2double rbuf_time = Min_Delta_Time; - SU2_MPI::Allreduce(&rbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&rbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); rbuf_time = Max_Delta_Time; - SU2_MPI::Allreduce(&rbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&rbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif } @@ -4147,7 +4147,7 @@ void CFEM_DG_EulerSolver::TolerancesADERPredictorStep(void) { #ifdef HAVE_MPI SU2_MPI::Allreduce(URef, TolSolADER.data(), nVar, MPI_DOUBLE, MPI_MAX, - MPI_COMM_WORLD); + SU2_MPI::GetComm()); #else for(unsigned short i=0; iGetComm_Level() == COMM_FULL) { SU2_MPI::Allreduce(locBuf.data(), globBuf.data(), nCommSize, MPI_DOUBLE, - MPI_SUM, MPI_COMM_WORLD); + MPI_SUM, SU2_MPI::GetComm()); } /*--- Copy the data back from globBuf into the required variables. ---*/ @@ -7262,7 +7262,7 @@ void CFEM_DG_EulerSolver::SetResidual_RMS_FEM(CGeometry *geometry, /*--- The local L2 norms must be added to obtain the global value. Also check for divergence. ---*/ vector rbufRes(nVar); - SU2_MPI::Allreduce(Residual_RMS, rbufRes.data(), nVar, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Residual_RMS, rbufRes.data(), nVar, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); for(unsigned short iVar=0; iVar rbufPoint(nVar*size); SU2_MPI::Allgather(Point_Max, nVar, MPI_UNSIGNED_LONG, rbufPoint.data(), - nVar, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); + nVar, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); vector sbufCoor(nDim*nVar); for(unsigned short iVar=0; iVar rbufCoor(nDim*nVar*size); SU2_MPI::Allgather(sbufCoor.data(), nVar*nDim, MPI_DOUBLE, rbufCoor.data(), - nVar*nDim, MPI_DOUBLE, MPI_COMM_WORLD); + nVar*nDim, MPI_DOUBLE, SU2_MPI::GetComm()); for(unsigned short iVar=0; iVarGetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI unsigned long nBadDOFsLoc = nBadDOFs; - SU2_MPI::Reduce(&nBadDOFsLoc, &nBadDOFs, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nBadDOFsLoc, &nBadDOFs, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); #endif if((rank == MASTER_NODE) && (nBadDOFs != 0)) diff --git a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp index 8672eb91ec5c..ec563e340110 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp @@ -850,7 +850,7 @@ void CFEM_DG_NSSolver::Friction_Forces(const CGeometry* geometry, const CConfig* /* Sum up all the data from all ranks. The result will be available on all ranks. */ if (config->GetComm_Level() == COMM_FULL) { SU2_MPI::Allreduce(locBuf.data(), globBuf.data(), nCommSize, MPI_DOUBLE, - MPI_SUM, MPI_COMM_WORLD); + MPI_SUM, SU2_MPI::GetComm()); } /*--- Copy the data back from globBuf into the required variables. ---*/ @@ -877,7 +877,7 @@ void CFEM_DG_NSSolver::Friction_Forces(const CGeometry* geometry, const CConfig* su2double localMax = AllBound_MaxHeatFlux_Visc; if (config->GetComm_Level() == COMM_FULL) { SU2_MPI::Allreduce(&localMax, &AllBound_MaxHeatFlux_Visc, 1, MPI_DOUBLE, - MPI_MAX, MPI_COMM_WORLD); + MPI_MAX, SU2_MPI::GetComm()); } #endif @@ -1301,10 +1301,10 @@ void CFEM_DG_NSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai if ((config->GetComm_Level() == COMM_FULL) || time_stepping) { #ifdef HAVE_MPI su2double rbuf_time = Min_Delta_Time; - SU2_MPI::Allreduce(&rbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&rbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); rbuf_time = Max_Delta_Time; - SU2_MPI::Allreduce(&rbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&rbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif } diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 21618f92304c..4130587ec2cc 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -50,7 +50,7 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM dynamic_grid = config->GetDynamic_Grid(); #ifdef HAVE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(SU2_MPI::GetComm(), &rank); #endif /*--- Dimension of the problem --> temperature is the only conservative variable ---*/ @@ -314,7 +314,7 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * int rank = MASTER_NODE; #ifdef HAVE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_rank(SU2_MPI::GetComm(), &rank); #endif int counter = 0; @@ -381,7 +381,7 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * #ifndef HAVE_MPI rbuf_NotMatching = sbuf_NotMatching; #else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); #endif if (rbuf_NotMatching != 0) { if (rank == MASTER_NODE) { @@ -391,8 +391,8 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * #ifndef HAVE_MPI exit(EXIT_FAILURE); #else - MPI_Barrier(MPI_COMM_WORLD); - MPI_Abort(MPI_COMM_WORLD,1); + MPI_Barrier(SU2_MPI::GetComm()); + MPI_Abort(SU2_MPI::GetComm(),1); MPI_Finalize(); #endif } @@ -754,8 +754,8 @@ void CHeatSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) { } } - SU2_MPI::Allreduce(Local_Surface_Areas, Surface_Areas, config->GetnMarker_HeatFlux(), MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_HeatFlux_Areas_Monitor, &Total_HeatFlux_Areas_Monitor, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Local_Surface_Areas, Surface_Areas, config->GetnMarker_HeatFlux(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_HeatFlux_Areas_Monitor, &Total_HeatFlux_Areas_Monitor, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); Total_HeatFlux_Areas = 0.0; for( iMarker_HeatFlux = 0; iMarker_HeatFlux < config->GetnMarker_HeatFlux(); iMarker_HeatFlux++ ) { @@ -1264,8 +1264,8 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C #ifdef HAVE_MPI MyAllBound_HeatFlux = AllBound_HeatFlux; MyAllBound_AverageT = AllBound_AverageT; - SU2_MPI::Allreduce(&MyAllBound_HeatFlux, &AllBound_HeatFlux, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyAllBound_AverageT, &AllBound_AverageT, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyAllBound_HeatFlux, &AllBound_HeatFlux, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyAllBound_AverageT, &AllBound_AverageT, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #endif if (Total_HeatFlux_Areas_Monitor != 0.0) { @@ -1448,13 +1448,13 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Min_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; sbuf_time = Max_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; #endif } @@ -1464,8 +1464,8 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_Time = rbuf_time; #endif for (iPoint = 0; iPoint < nPointDomain; iPoint++) @@ -1480,8 +1480,8 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_UnstTimeND; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = rbuf_time; #endif config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index e3df3da16efb..6862311beb5d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -985,7 +985,7 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai if (config->GetComm_Level() == COMM_FULL) { #ifdef HAVE_MPI unsigned long MyErrorCounter = ErrorCounter; ErrorCounter = 0; - SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #endif if (iMesh == MESH_0) config->SetNonphysical_Points(ErrorCounter); } @@ -1151,13 +1151,13 @@ void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contain #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Min_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; sbuf_time = Max_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; #endif } @@ -1168,8 +1168,8 @@ void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contain #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_Time = rbuf_time; #endif /*--- If the unsteady CFL is set to zero, it uses the defined @@ -1205,8 +1205,8 @@ void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contain #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_UnstTimeND; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = rbuf_time; #endif config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); @@ -1431,7 +1431,7 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont if (config->GetComm_Level() == COMM_FULL) { if (iMesh == MESH_0) { - SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); config->SetNonphysical_Reconstr(counter_global); } } @@ -2216,7 +2216,7 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co #ifdef HAVE_MPI su2double myMaxVel2 = maxVel2; maxVel2 = 0.0; - SU2_MPI::Allreduce(&myMaxVel2, &maxVel2, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myMaxVel2, &maxVel2, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif Beta = max(1e-10,maxVel2); @@ -3374,9 +3374,9 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, #ifdef HAVE_MPI - SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_MassFlow_Local, Outlet_MassFlow_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Density_Local, Outlet_Density_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); #else diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 976da459e9e3..130894855f90 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -147,9 +147,9 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container su2double MyOmega_Max = Omega_Max; Omega_Max = 0.0; su2double MyStrainMag_Max = StrainMag_Max; StrainMag_Max = 0.0; - SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyErrorCounter, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif if (iMesh == MESH_0) @@ -366,13 +366,13 @@ void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Min_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; sbuf_time = Max_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; #endif } @@ -382,8 +382,8 @@ void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_Time = rbuf_time; #endif /*--- If the unsteady CFL is set to zero, it uses the defined @@ -418,8 +418,8 @@ void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_UnstTimeND; - SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&sbuf_time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&rbuf_time, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = rbuf_time; #endif config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 5704f6c7bbd1..b2ceac739d48 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -249,9 +249,9 @@ void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool upd SU2_OMP_MASTER { elCount = ElemCounter; maxVol = MaxVolume; minVol = MinVolume; - SU2_MPI::Allreduce(&elCount, &ElemCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&maxVol, &MaxVolume, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&minVol, &MinVolume, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&elCount, &ElemCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&maxVol, &MaxVolume, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&minVol, &MinVolume, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); } SU2_OMP_BARRIER @@ -379,8 +379,8 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { { MaxDistance_Local = MaxDistance; MinDistance_Local = MinDistance; - SU2_MPI::Allreduce(&MaxDistance_Local, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MinDistance_Local, &MinDistance, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MaxDistance_Local, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MinDistance_Local, &MinDistance, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); } SU2_OMP_BARRIER } diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 86aa426bef54..8e6c4346ef12 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -254,7 +254,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, /*--- Warning message about non-physical points ---*/ if (config->GetComm_Level() == COMM_FULL) { - SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &counter_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); if ((rank == MASTER_NODE) && (counter_global != 0)) cout << "Warning. The original solution contains "<< counter_global << " points that are not physical." << endl; @@ -351,7 +351,7 @@ void CNEMOEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver if ((iMesh == MESH_0) && (config->GetComm_Level() == COMM_FULL)) { unsigned long tmp = ErrorCounter; - SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); config->SetNonphysical_Points(ErrorCounter); } @@ -614,10 +614,10 @@ void CNEMOEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai SU2_OMP_MASTER if (config->GetComm_Level() == COMM_FULL) { su2double rbuf_time; - SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; - SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; } SU2_OMP_BARRIER @@ -666,7 +666,7 @@ void CNEMOEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai SU2_OMP_MASTER { - SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = glbDtND; config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); @@ -991,7 +991,7 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con SU2_OMP_MASTER { counter_local = ErrorCounter; - SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&counter_local, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); config->SetNonphysical_Reconstr(ErrorCounter); } SU2_OMP_BARRIER @@ -3087,7 +3087,7 @@ void CNEMOEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CCon #ifndef HAVE_MPI rbuf_NotMatching = sbuf_NotMatching; #else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); #endif if (rbuf_NotMatching != 0) { SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 1f72a622ada8..d0f5b8996dc2 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -136,8 +136,8 @@ void CNEMONSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_containe su2double MyOmega_Max = Omega_Max; //su2double MyStrainMag_Max = StrainMag_Max; - //SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + //SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); } } diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 9ea15c36e10a..4bd7ba28d6e0 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -181,8 +181,8 @@ void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, C su2double MyOmega_Max = Omega_Max; su2double MyStrainMag_Max = StrainMag_Max; - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); } SU2_OMP_BARRIER } @@ -391,7 +391,7 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf /*--- Add buffet metric information using all the nodes ---*/ su2double MyTotal_Buffet_Metric = Total_Buffet_Metric; - SU2_MPI::Allreduce(&MyTotal_Buffet_Metric, &Total_Buffet_Metric, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyTotal_Buffet_Metric, &Total_Buffet_Metric, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Add the buffet metric on the surfaces using all the nodes ---*/ @@ -401,7 +401,7 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf MySurface_Buffet_Metric[iMarker_Monitoring] = Surface_Buffet_Metric[iMarker_Monitoring]; } - SU2_MPI::Allreduce(MySurface_Buffet_Metric, Surface_Buffet_Metric, config->GetnMarker_Monitoring(), MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(MySurface_Buffet_Metric, Surface_Buffet_Metric, config->GetnMarker_Monitoring(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); delete [] MySurface_Buffet_Metric; diff --git a/SU2_CFD/src/solvers/CRadP1Solver.cpp b/SU2_CFD/src/solvers/CRadP1Solver.cpp index 3d4533d3a210..76bcf61681fc 100644 --- a/SU2_CFD/src/solvers/CRadP1Solver.cpp +++ b/SU2_CFD/src/solvers/CRadP1Solver.cpp @@ -662,10 +662,10 @@ void CRadP1Solver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, su2double sbuf_time; sbuf_time = Min_Delta_Time; - SU2_MPI::Allreduce(&sbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_time, &Min_Delta_Time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); sbuf_time = Max_Delta_Time; - SU2_MPI::Allreduce(&sbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&sbuf_time, &Max_Delta_Time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); } } diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index bb318fd4a0fc..d07c9476ca43 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2235,9 +2235,9 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, SU2_OMP_MASTER { /* MPI reduction. */ myCFLMin = Min_CFL_Local; myCFLMax = Max_CFL_Local; myCFLSum = Avg_CFL_Local; - SU2_MPI::Allreduce(&myCFLMin, &Min_CFL_Local, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&myCFLMax, &Max_CFL_Local, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&myCFLSum, &Avg_CFL_Local, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&myCFLMin, &Min_CFL_Local, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&myCFLMax, &Max_CFL_Local, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&myCFLSum, &Avg_CFL_Local, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); Avg_CFL_Local /= su2double(geometry[iMesh]->GetGlobal_nPointDomain()); } SU2_OMP_BARRIER @@ -2283,8 +2283,8 @@ void CSolver::SetResidual_RMS(CGeometry *geometry, CConfig *config) { if (config->GetComm_Level() == COMM_FULL) { unsigned long Local_nPointDomain = geometry->GetnPointDomain(); - SU2_MPI::Allreduce(sbuf_residual, rbuf_residual, nVar, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(sbuf_residual, rbuf_residual, nVar, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); } else { @@ -2329,9 +2329,9 @@ void CSolver::SetResidual_RMS(CGeometry *geometry, CConfig *config) { sbuf_coord[iVar*nDim+iDim] = Coord[iDim]; } - SU2_MPI::Allgather(sbuf_residual, nVar, MPI_DOUBLE, rbuf_residual, nVar, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(sbuf_point, nVar, MPI_UNSIGNED_LONG, rbuf_point, nVar, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - SU2_MPI::Allgather(sbuf_coord, nVar*nDim, MPI_DOUBLE, rbuf_coord, nVar*nDim, MPI_DOUBLE, MPI_COMM_WORLD); + SU2_MPI::Allgather(sbuf_residual, nVar, MPI_DOUBLE, rbuf_residual, nVar, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(sbuf_point, nVar, MPI_UNSIGNED_LONG, rbuf_point, nVar, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(sbuf_coord, nVar*nDim, MPI_DOUBLE, rbuf_coord, nVar*nDim, MPI_DOUBLE, SU2_MPI::GetComm()); for (iVar = 0; iVar < nVar; iVar++) { for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { @@ -2386,8 +2386,8 @@ void CSolver::SetResidual_BGS(CGeometry *geometry, CConfig *config) { Local_nPointDomain = geometry->GetnPointDomain(); - SU2_MPI::Allreduce(sbuf_residual, rbuf_residual, nVar, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(sbuf_residual, rbuf_residual, nVar, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); for (iVar = 0; iVar < nVar; iVar++) { @@ -2422,9 +2422,9 @@ void CSolver::SetResidual_BGS(CGeometry *geometry, CConfig *config) { sbuf_coord[iVar*nDim+iDim] = Coord[iDim]; } - SU2_MPI::Allgather(sbuf_residual, nVar, MPI_DOUBLE, rbuf_residual, nVar, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(sbuf_point, nVar, MPI_UNSIGNED_LONG, rbuf_point, nVar, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - SU2_MPI::Allgather(sbuf_coord, nVar*nDim, MPI_DOUBLE, rbuf_coord, nVar*nDim, MPI_DOUBLE, MPI_COMM_WORLD); + SU2_MPI::Allgather(sbuf_residual, nVar, MPI_DOUBLE, rbuf_residual, nVar, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(sbuf_point, nVar, MPI_UNSIGNED_LONG, rbuf_point, nVar, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(sbuf_coord, nVar*nDim, MPI_DOUBLE, rbuf_coord, nVar*nDim, MPI_DOUBLE, SU2_MPI::GetComm()); for (iVar = 0; iVar < nVar; iVar++) { for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { @@ -3150,7 +3150,7 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, const CConfig *config, /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -3166,7 +3166,7 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, const CConfig *config, /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -3335,7 +3335,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, const CConfig *config /*--- All ranks open the file using MPI. ---*/ - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); + ierr = MPI_File_open(SU2_MPI::GetComm(), fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); /*--- Error check opening the file. ---*/ @@ -3352,7 +3352,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, const CConfig *config /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - SU2_MPI::Bcast(Restart_Vars, nRestart_Vars, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Bcast(Restart_Vars, nRestart_Vars, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Check that this is an SU2 binary file. SU2 binary files have the hex representation of "SU2" as the first int in the file. ---*/ @@ -3382,7 +3382,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, const CConfig *config /*--- Broadcast the string names of the variables. ---*/ SU2_MPI::Bcast(mpi_str_buf, nFields*CGNS_STRING_SIZE, MPI_CHAR, - MASTER_NODE, MPI_COMM_WORLD); + MASTER_NODE, SU2_MPI::GetComm()); /*--- Now parse the string names and load into the config class in case we need them for writing visualization files (SU2_SOL). ---*/ @@ -3948,7 +3948,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry, } // end iMarker loop - SU2_MPI::Allreduce(&local_failure, &global_failure, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&local_failure, &global_failure, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); if (global_failure > 0) { SU2_MPI::Error("Prescribed inlet data does not match markers within tolerance.", CURRENT_FUNCTION); From d6ec4271c80f32fbafe68d223cddbd6a80249360 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 30 Jan 2021 17:06:13 +0000 Subject: [PATCH 184/326] simplify fea comms --- Common/include/option_structure.hpp | 3 - SU2_CFD/src/solvers/CFEASolver.cpp | 94 +++++++---------------------- SU2_CFD/src/solvers/CSolver.cpp | 48 --------------- 3 files changed, 23 insertions(+), 122 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 7c9b5df7a6a2..5a3c8213c379 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2156,8 +2156,6 @@ enum MPI_QUANTITIES { SOLUTION_OLD = 1, /*!< \brief Conservative solution old communication. */ SOLUTION_GRADIENT = 2, /*!< \brief Conservative solution gradient communication. */ SOLUTION_LIMITER = 3, /*!< \brief Conservative solution limiter communication. */ - SOLUTION_PRED = 5, /*!< \brief Solution predicted communication. */ - SOLUTION_PRED_OLD = 6, /*!< \brief Solution predicted old communication. */ SOLUTION_GEOMETRY = 7, /*!< \brief Geometry solution communication. */ PRIMITIVE_GRADIENT = 8, /*!< \brief Primitive gradient communication. */ PRIMITIVE_LIMITER = 9, /*!< \brief Primitive limiter communication. */ @@ -2177,7 +2175,6 @@ enum MPI_QUANTITIES { SOLUTION_MATRIXTRANS = 23, /*!< \brief Matrix transposed solution communication. */ NEIGHBORS = 24, /*!< \brief Neighbor point count communication (for JST). */ SOLUTION_FEA = 25, /*!< \brief FEA solution communication. */ - SOLUTION_FEA_OLD = 26, /*!< \brief FEA solution old communication. */ MESH_DISPLACEMENTS = 27, /*!< \brief Mesh displacements at the interface. */ SOLUTION_TIME_N = 28, /*!< \brief Solution at time n. */ SOLUTION_TIME_N1 = 29, /*!< \brief Solution at time n-1. */ diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 24ad61b4ec1e..91b0f107094e 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -233,18 +233,6 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CSolver() { /*--- Penalty value - to maintain constant the stiffness in optimization problems - TODO: this has to be improved ---*/ PenaltyValue = 0.0; - /*--- Perform the MPI communication of the solution ---*/ - - InitiateComms(geometry, config, SOLUTION_FEA); - CompleteComms(geometry, config, SOLUTION_FEA); - - /*--- If dynamic, we also need to communicate the old solution ---*/ - - if (dynamic) { - InitiateComms(geometry, config, SOLUTION_FEA_OLD); - CompleteComms(geometry, config, SOLUTION_FEA_OLD); - } - if (size != SINGLE_NODE) { vector essentialMarkers; for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -2289,7 +2277,7 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { /*--- Update solution. ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (iPoint = 0; iPoint < nPoint; iPoint++) { /*--- Displacement component of the solution. ---*/ for (iVar = 0; iVar < nVar; iVar++) nodes->Add_DeltaSolution(iPoint, iVar, LinSysSol(iPoint,iVar)); @@ -2297,7 +2285,7 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { if (dynamic) { SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (iPoint = 0; iPoint < nPoint; iPoint++) { for (iVar = 0; iVar < nVar; iVar++) { /*--- Acceleration component of the solution. ---*/ @@ -2321,12 +2309,6 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { } } } - - /*--- Perform the MPI communication of the solution ---*/ - - InitiateComms(geometry, config, SOLUTION_FEA); - CompleteComms(geometry, config, SOLUTION_FEA); - } // end SU2_OMP_PARALLEL } @@ -2341,13 +2323,14 @@ void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config /*--- Update solution and set it to be the solution after applying relaxation. ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint=0; iPoint < nPointDomain; iPoint++) { + for (iPoint=0; iPoint < nPoint; iPoint++) { nodes->SetSolution(iPoint, nodes->GetSolution_Pred(iPoint)); + nodes->SetSolution_Pred_Old(iPoint, nodes->GetSolution(iPoint)); } if (dynamic) { SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (iPoint = 0; iPoint < nPoint; iPoint++) { for (iVar = 0; iVar < nVar; iVar++) { /*--- Acceleration component of the solution ---*/ @@ -2372,20 +2355,6 @@ void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config } } - /*--- Perform the MPI communication of the solution ---*/ - - InitiateComms(geometry, config, SOLUTION_FEA); - CompleteComms(geometry, config, SOLUTION_FEA); - - /*--- After the solution has been communicated, set the 'old' predicted solution as the solution. ---*/ - /*--- Loop over n points (as we have already communicated everything. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPoint; iPoint++) { - for (iVar = 0; iVar < nVar; iVar++) { - nodes->SetSolution_Pred_Old(iPoint,iVar,nodes->GetSolution(iPoint,iVar)); - } - } - } // end SU2_OMP_PARALLEL } @@ -2504,15 +2473,10 @@ void CFEASolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *confi /*--- Update displacement components of the solution. ---*/ SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) for (unsigned short iVar = 0; iVar < nVar; iVar++) nodes->Add_DeltaSolution(iPoint, iVar, LinSysSol(iPoint,iVar)); - /*--- Perform the MPI communication of the solution, displacements only. ---*/ - - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - } void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *config) { @@ -2523,7 +2487,7 @@ void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *c /*--- Compute solution at t_n+1, and update velocities and accelerations ---*/ SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { unsigned short iVar; @@ -2567,11 +2531,6 @@ void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *c } - /*--- Perform the MPI communication of the solution ---*/ - - InitiateComms(geometry, config, SOLUTION_FEA); - CompleteComms(geometry, config, SOLUTION_FEA); - } void CFEASolver::GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig *config) { @@ -2623,7 +2582,7 @@ void CFEASolver::PredictStruct_Displacement(CGeometry *geometry, CConfig *config /*--- To nPointDomain: we need to communicate the predicted solution after setting it. ---*/ SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) - for (unsigned long iPoint=0; iPoint < nPointDomain; iPoint++) { + for (unsigned long iPoint=0; iPoint < nPoint; iPoint++) { unsigned short iDim; @@ -2656,9 +2615,6 @@ void CFEASolver::PredictStruct_Displacement(CGeometry *geometry, CConfig *config } - InitiateComms(geometry, config, SOLUTION_PRED); - CompleteComms(geometry, config, SOLUTION_PRED); - } void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, CConfig *config, unsigned long iOuterIter) { @@ -2758,7 +2714,7 @@ void CFEASolver::SetAitken_Relaxation(CGeometry *geometry, CConfig *config) { // To nPointDomain; we need to communicate the solutions (predicted, old and old predicted) after this routine SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) - for (unsigned long iPoint=0; iPoint < nPointDomain; iPoint++) { + for (unsigned long iPoint=0; iPoint < nPoint; iPoint++) { /*--- Retrieve pointers to the predicted and calculated solutions ---*/ su2double* dispPred = nodes->GetSolution_Pred(iPoint); @@ -2776,9 +2732,6 @@ void CFEASolver::SetAitken_Relaxation(CGeometry *geometry, CConfig *config) { } } - InitiateComms(geometry, config, SOLUTION_PRED_OLD); - CompleteComms(geometry, config, SOLUTION_PRED_OLD); - } void CFEASolver::OutputForwardModeGradient(const CConfig *config, bool newFile, @@ -3166,15 +3119,8 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c for (unsigned short iVar = 0; iVar < nVar; iVar++) { nodes->SetSolution(iPoint_Local, iVar, Sol[iVar]); if (dynamic) { - nodes->Set_Solution_time_n(iPoint_Local, iVar, Sol[iVar]); nodes->SetSolution_Vel(iPoint_Local, iVar, Sol[iVar+nVar]); - nodes->SetSolution_Vel_time_n(iPoint_Local, iVar, Sol[iVar+nVar]); nodes->SetSolution_Accel(iPoint_Local, iVar, Sol[iVar+2*nVar]); - nodes->SetSolution_Accel_time_n(iPoint_Local, iVar, Sol[iVar+2*nVar]); - } - if (fluid_structure && !dynamic) { - nodes->SetSolution_Pred(iPoint_Local, iVar, Sol[iVar]); - nodes->SetSolution_Pred_Old(iPoint_Local, iVar, Sol[iVar]); } if (fluid_structure && discrete_adjoint){ nodes->SetSolution_Old(iPoint_Local, iVar, Sol[iVar]); @@ -3196,19 +3142,25 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c /*--- MPI. If dynamic, we also need to communicate the old solution. ---*/ - solver[MESH_0][FEA_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION_FEA); - solver[MESH_0][FEA_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION_FEA); + InitiateComms(geometry[MESH_0], config, SOLUTION_FEA); + CompleteComms(geometry[MESH_0], config, SOLUTION_FEA); if (dynamic) { - solver[MESH_0][FEA_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION_FEA_OLD); - solver[MESH_0][FEA_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION_FEA_OLD); + nodes->Set_Solution_time_n(); + nodes->SetSolution_Vel_time_n(); + nodes->SetSolution_Accel_time_n(); } + if (fluid_structure && !dynamic) { - solver[MESH_0][FEA_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION_PRED); - solver[MESH_0][FEA_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION_PRED); + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { + nodes->SetSolution_Pred(iPoint, nodes->GetSolution(iPoint)); + nodes->SetSolution_Pred_Old(iPoint, nodes->GetSolution(iPoint)); + } + } - solver[MESH_0][FEA_SOL]->InitiateComms(geometry[MESH_0], config, SOLUTION_PRED_OLD); - solver[MESH_0][FEA_SOL]->CompleteComms(geometry[MESH_0], config, SOLUTION_PRED_OLD); + if (fluid_structure && discrete_adjoint) { + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + nodes->SetSolution_Old(iPoint, nodes->GetSolution(iPoint)); } /*--- Delete the class memory that is used to load the restart. ---*/ diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index d28508f23504..6cf7acd5a498 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -1630,18 +1630,6 @@ void CSolver::GetCommCountAndType(const CConfig* config, COUNT_PER_POINT = nVar; MPI_TYPE = COMM_TYPE_DOUBLE; break; - case SOLUTION_FEA_OLD: - COUNT_PER_POINT = nVar*3; - MPI_TYPE = COMM_TYPE_DOUBLE; - break; - case SOLUTION_PRED: - COUNT_PER_POINT = nVar; - MPI_TYPE = COMM_TYPE_DOUBLE; - break; - case SOLUTION_PRED_OLD: - COUNT_PER_POINT = nVar*3; - MPI_TYPE = COMM_TYPE_DOUBLE; - break; case AUXVAR_GRADIENT: COUNT_PER_POINT = nDim*base_nodes->GetnAuxVar(); MPI_TYPE = COMM_TYPE_DOUBLE; @@ -1789,24 +1777,6 @@ void CSolver::InitiateComms(CGeometry *geometry, } } break; - case SOLUTION_FEA_OLD: - for (iVar = 0; iVar < nVar; iVar++) { - bufDSend[buf_offset+iVar] = base_nodes->GetSolution_time_n(iPoint, iVar); - bufDSend[buf_offset+nVar+iVar] = base_nodes->GetSolution_Vel_time_n(iPoint, iVar); - bufDSend[buf_offset+nVar*2+iVar] = base_nodes->GetSolution_Accel_time_n(iPoint, iVar); - } - break; - case SOLUTION_PRED: - for (iVar = 0; iVar < nVar; iVar++) - bufDSend[buf_offset+iVar] = base_nodes->GetSolution_Pred(iPoint, iVar); - break; - case SOLUTION_PRED_OLD: - for (iVar = 0; iVar < nVar; iVar++) { - bufDSend[buf_offset+iVar] = base_nodes->GetSolution_Old(iPoint, iVar); - bufDSend[buf_offset+nVar+iVar] = base_nodes->GetSolution_Pred(iPoint, iVar); - bufDSend[buf_offset+nVar*2+iVar] = base_nodes->GetSolution_Pred_Old(iPoint, iVar); - } - break; case MESH_DISPLACEMENTS: for (iDim = 0; iDim < nDim; iDim++) bufDSend[buf_offset+iDim] = base_nodes->GetBound_Disp(iPoint, iDim); @@ -1967,24 +1937,6 @@ void CSolver::CompleteComms(CGeometry *geometry, } } break; - case SOLUTION_FEA_OLD: - for (iVar = 0; iVar < nVar; iVar++) { - base_nodes->Set_Solution_time_n(iPoint, iVar, bufDRecv[buf_offset+iVar]); - base_nodes->SetSolution_Vel_time_n(iPoint, iVar, bufDRecv[buf_offset+nVar+iVar]); - base_nodes->SetSolution_Accel_time_n(iPoint, iVar, bufDRecv[buf_offset+nVar*2+iVar]); - } - break; - case SOLUTION_PRED: - for (iVar = 0; iVar < nVar; iVar++) - base_nodes->SetSolution_Pred(iPoint, iVar, bufDRecv[buf_offset+iVar]); - break; - case SOLUTION_PRED_OLD: - for (iVar = 0; iVar < nVar; iVar++) { - base_nodes->SetSolution_Old(iPoint, iVar, bufDRecv[buf_offset+iVar]); - base_nodes->SetSolution_Pred(iPoint, iVar, bufDRecv[buf_offset+nVar+iVar]); - base_nodes->SetSolution_Pred_Old(iPoint, iVar, bufDRecv[buf_offset+nVar*2+iVar]); - } - break; case MESH_DISPLACEMENTS: for (iDim = 0; iDim < nDim; iDim++) base_nodes->SetBound_Disp(iPoint, iDim, bufDRecv[buf_offset+iDim]); From 446db59aed439ca74d5246e6880fa3fa89a6de24 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 30 Jan 2021 19:46:28 +0000 Subject: [PATCH 185/326] reduce number of methods for predicted solution --- SU2_CFD/include/variables/CFEAVariable.hpp | 52 +------------------ SU2_CFD/include/variables/CVariable.hpp | 40 +------------- .../src/iteration/CDiscAdjFEAIteration.cpp | 12 ++--- SU2_CFD/src/solvers/CFEASolver.cpp | 28 +++++----- TestCases/parallel_regression_AD.py | 2 +- 5 files changed, 27 insertions(+), 107 deletions(-) diff --git a/SU2_CFD/include/variables/CFEAVariable.hpp b/SU2_CFD/include/variables/CFEAVariable.hpp index a400e09ff3a7..9c2153432cea 100644 --- a/SU2_CFD/include/variables/CFEAVariable.hpp +++ b/SU2_CFD/include/variables/CFEAVariable.hpp @@ -251,13 +251,6 @@ class CFEAVariable : public CVariable { */ inline su2double *GetSolution_Accel_time_n(unsigned long iPoint) final { return Solution_Accel_time_n[iPoint]; } - /*! - * \brief Set the value of the solution predictor. - */ - inline void SetSolution_Pred(unsigned long iPoint) final { - for (unsigned long iVar = 0; iVar < nVar; iVar++) Solution_Pred(iPoint,iVar) = Solution(iPoint,iVar); - } - /*! * \brief Set the value of the old solution. * \param[in] val_solution_pred - Pointer to the residual vector. @@ -266,34 +259,11 @@ class CFEAVariable : public CVariable { for (unsigned long iVar = 0; iVar < nVar; iVar++) Solution_Pred(iPoint,iVar) = val_solution_pred[iVar]; } - /*! - * \brief Set the value of the predicted solution. - * \param[in] iVar - Index of the variable - * \param[in] val_solution_pred - Value of the predicted solution. - */ - inline void SetSolution_Pred(unsigned long iPoint, unsigned long iVar, su2double val_solution_pred) final { - Solution_Pred(iPoint,iVar) = val_solution_pred; - } - - /*! - * \brief Get the value of the solution predictor. - * \param[in] iVar - Index of the variable. - * \return Pointer to the old solution vector. - */ - inline su2double GetSolution_Pred(unsigned long iPoint, unsigned long iVar) const final { return Solution_Pred(iPoint,iVar); } - /*! * \brief Get the solution at time n. * \return Pointer to the solution (at time n) vector. */ - inline su2double *GetSolution_Pred(unsigned long iPoint) final { return Solution_Pred[iPoint]; } - - /*! - * \brief Set the value of the solution predictor. - */ - inline void SetSolution_Pred_Old(unsigned long iPoint) final { - for (unsigned long iVar = 0; iVar < nVar; iVar++) Solution_Pred_Old(iPoint,iVar) = Solution_Pred(iPoint,iVar); - } + inline const su2double *GetSolution_Pred(unsigned long iPoint) const final { return Solution_Pred[iPoint]; } /*! * \brief Set the value of the old solution. @@ -303,29 +273,11 @@ class CFEAVariable : public CVariable { for (unsigned long iVar = 0; iVar < nVar; iVar++) Solution_Pred_Old(iPoint,iVar) = val_solution_pred_old[iVar]; } - /*! - * \brief A virtual member. Set the value of the old solution predicted. - * \param[in] iVar - Index of the variable - * \param[in] val_solution_pred_old - Value of the old predicted solution. - */ - inline void SetSolution_Pred_Old(unsigned long iPoint, unsigned long iVar, su2double val_solution_pred_old) final { - Solution_Pred_Old(iPoint,iVar) = val_solution_pred_old; - } - - /*! - * \brief Get the value of the solution predictor. - * \param[in] iVar - Index of the variable. - * \return Pointer to the old solution vector. - */ - inline su2double GetSolution_Pred_Old(unsigned long iPoint, unsigned long iVar) const final { - return Solution_Pred_Old(iPoint,iVar); - } - /*! * \brief Get the solution at time n. * \return Pointer to the solution (at time n) vector. */ - inline su2double *GetSolution_Pred_Old(unsigned long iPoint) final { return Solution_Pred_Old[iPoint]; } + inline const su2double *GetSolution_Pred_Old(unsigned long iPoint) const final { return Solution_Pred_Old[iPoint]; } /*! * \brief A virtual member. diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 8ef19aeeb595..fdcfd15161dc 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2203,40 +2203,17 @@ class CVariable { */ inline virtual void Set_OldSolution_Accel() {} - /*! - * \brief A virtual member. Set the value of the solution predictor. - */ - inline virtual void SetSolution_Pred(unsigned long iPoint) {} - /*! * \brief A virtual member. Set the value of the old solution. * \param[in] solution_pred - Pointer to the residual vector. */ inline virtual void SetSolution_Pred(unsigned long iPoint, const su2double *solution_pred) {} - /*! - * \brief A virtual member. Set the value of the solution predicted. - * \param[in] solution_old - Pointer to the residual vector. - */ - inline virtual void SetSolution_Pred(unsigned long iPoint, unsigned long iVar, su2double solution_pred) {} - - /*! - * \brief A virtual member. Get the value of the solution predictor. - * \param[in] iVar - Index of the variable. - * \return Pointer to the old solution vector. - */ - inline virtual su2double GetSolution_Pred(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! * \brief A virtual member. Get the solution at time n. * \return Pointer to the solution (at time n) vector. */ - inline virtual su2double *GetSolution_Pred(unsigned long iPoint) {return nullptr; } - - /*! - * \brief A virtual member. Set the value of the solution predictor. - */ - inline virtual void SetSolution_Pred_Old(unsigned long iPoint) {} + inline virtual const su2double *GetSolution_Pred(unsigned long iPoint) const { return nullptr; } /*! * \brief A virtual member. Set the value of the old solution. @@ -2244,24 +2221,11 @@ class CVariable { */ inline virtual void SetSolution_Pred_Old(unsigned long iPoint, const su2double *solution_pred_Old) {} - /*! - * \brief A virtual member. Set the value of the old solution predicted. - * \param[in] solution_pred_old - Pointer to the residual vector. - */ - inline virtual void SetSolution_Pred_Old(unsigned long iPoint, unsigned long iVar, su2double solution_pred_old) {} - - /*! - * \brief A virtual member. Get the value of the solution predictor. - * \param[in] iVar - Index of the variable. - * \return Pointer to the old solution vector. - */ - inline virtual su2double GetSolution_Pred_Old(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! * \brief A virtual member. Get the solution at time n. * \return Pointer to the solution (at time n) vector. */ - inline virtual su2double *GetSolution_Pred_Old(unsigned long iPoint) { return nullptr; } + inline virtual const su2double *GetSolution_Pred_Old(unsigned long iPoint) const { return nullptr; } /*! * \brief A virtual member. diff --git a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp index 8cdf6d85f501..b0887c79a41e 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp @@ -364,12 +364,6 @@ void CDiscAdjFEAIteration::SetDependencies(CSolver***** solver, CGeometry**** ge break; } - /*--- FSI specific dependencies. ---*/ - if (fsi) { - /*--- Set relation between solution and predicted displacements, which are the transferred ones. ---*/ - dir_solver->PredictStruct_Displacement(structural_geometry, config[iZone]); - } - /*--- MPI dependencies. ---*/ dir_solver->InitiateComms(structural_geometry, config[iZone], SOLUTION_FEA); @@ -380,6 +374,12 @@ void CDiscAdjFEAIteration::SetDependencies(CSolver***** solver, CGeometry**** ge structural_geometry->CompleteComms(structural_geometry, config[iZone], COORDINATES); } + /*--- FSI specific dependencies. ---*/ + if (fsi) { + /*--- Set relation between solution and predicted displacements, which are the transferred ones. ---*/ + dir_solver->PredictStruct_Displacement(structural_geometry, config[iZone]); + } + /*--- Topology optimization dependencies. ---*/ /*--- We only differentiate wrt to this variable in the adjoint secondary recording. ---*/ diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 91b0f107094e..d387456a902c 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2590,26 +2590,28 @@ void CFEASolver::PredictStruct_Displacement(CGeometry *geometry, CConfig *config case 1: { const su2double* solDisp = nodes->GetSolution(iPoint); const su2double* solVel = nodes->GetSolution_Vel(iPoint); - su2double* valPred = nodes->GetSolution_Pred(iPoint); + su2double valPred[MAXNVAR] = {0.0}; - for (iDim=0; iDim < nDim; iDim++) { + for (iDim=0; iDim < nDim; iDim++) valPred[iDim] = solDisp[iDim] + Delta_t*solVel[iDim]; - } + + nodes->SetSolution_Pred(iPoint, valPred); } break; case 2: { const su2double* solDisp = nodes->GetSolution(iPoint); const su2double* solVel = nodes->GetSolution_Vel(iPoint); const su2double* solVel_tn = nodes->GetSolution_Vel_time_n(iPoint); - su2double* valPred = nodes->GetSolution_Pred(iPoint); + su2double valPred[MAXNVAR] = {0.0}; - for (iDim=0; iDim < nDim; iDim++) { + for (iDim=0; iDim < nDim; iDim++) valPred[iDim] = solDisp[iDim] + 0.5*Delta_t*(3*solVel[iDim]-solVel_tn[iDim]); - } + + nodes->SetSolution_Pred(iPoint, valPred); } break; default: { - nodes->SetSolution_Pred(iPoint); + nodes->SetSolution_Pred(iPoint, nodes->GetSolution(iPoint)); } break; } @@ -2717,19 +2719,21 @@ void CFEASolver::SetAitken_Relaxation(CGeometry *geometry, CConfig *config) { for (unsigned long iPoint=0; iPoint < nPoint; iPoint++) { /*--- Retrieve pointers to the predicted and calculated solutions ---*/ - su2double* dispPred = nodes->GetSolution_Pred(iPoint); + const su2double* dispPred = nodes->GetSolution_Pred(iPoint); const su2double* dispCalc = nodes->GetSolution(iPoint); /*--- Set predicted solution as the old predicted solution ---*/ - nodes->SetSolution_Pred_Old(iPoint); + nodes->SetSolution_Pred_Old(iPoint, dispPred); /*--- Set calculated solution as the old solution (needed for dynamic Aitken relaxation) ---*/ nodes->SetSolution_Old(iPoint, dispCalc); /*--- Apply the Aitken relaxation ---*/ - for (unsigned short iDim=0; iDim < nDim; iDim++) { - dispPred[iDim] = (1.0 - WAitken)*dispPred[iDim] + WAitken*dispCalc[iDim]; - } + su2double newDispPred[MAXNVAR] = {0.0}; + for (unsigned short iDim=0; iDim < nDim; iDim++) + newDispPred[iDim] = (1.0 - WAitken)*dispPred[iDim] + WAitken*dispCalc[iDim]; + + nodes->SetSolution_Pred(iPoint, newDispPred); } } diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index b545e806bd6d..212b41525ebb 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -261,7 +261,7 @@ def main(): discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 - discadj_fea.test_vals = [-2.849526, -3.238467, -3.6413e-04, -8.7087] #last 4 columns + discadj_fea.test_vals = [-2.849496, -3.238424, -3.6413e-04, -8.7087] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 From 1728597fcc3542dd28e9b8ac5768c1cf84d71b8f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 1 Feb 2021 14:06:14 +0100 Subject: [PATCH 186/326] Fixed filediff reg test for streamwise flow --- Common/src/CConfig.cpp | 1 - .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 85223beacb2f..9b59fac6c38b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1109,7 +1109,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); - addDoubleArrayOption("BODY_FORCE_VECTOR", 3, body_force); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); /*!\brief BINARY_RESTART \n DESCRIPTION: Read binary SU2 native restart files. \n Options: YES, NO \ingroup Config */ diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index c13b64a6f0a6..64786afda6e4 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 399999.9724328518, 399999.9724328518, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 +0 , 0.0 , 399999.9724328518, 2.2205000000378153e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 From 3462ddacbaf5259f454c25f68fc9a6724a85ae2a Mon Sep 17 00:00:00 2001 From: Alessandro Gastaldi Date: Mon, 1 Feb 2021 14:53:21 +0100 Subject: [PATCH 187/326] Remove dummy MPI_COMM_WORLD altogether --- Common/include/parallelization/mpi_structure.cpp | 8 ++++++++ Common/include/parallelization/mpi_structure.hpp | 1 - SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp | 10 +++++----- SU2_CFD/src/SU2_CFD.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 ++-- SU2_DEF/src/SU2_DEF.cpp | 2 +- SU2_DOT/src/SU2_DOT.cpp | 6 +++--- SU2_GEO/src/SU2_GEO.cpp | 2 +- SU2_SOL/src/SU2_SOL.cpp | 2 +- UnitTests/test_driver.cpp | 2 +- 10 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Common/include/parallelization/mpi_structure.cpp b/Common/include/parallelization/mpi_structure.cpp index c707cef4877e..962426d1d4d7 100644 --- a/Common/include/parallelization/mpi_structure.cpp +++ b/Common/include/parallelization/mpi_structure.cpp @@ -27,9 +27,17 @@ #include "mpi_structure.hpp" + +/* Initialise the MPI Communicator Rank and Size */ int CBaseMPIWrapper::Rank = 0; int CBaseMPIWrapper::Size = 1; + +/* Set the default MPI Communicator */ +#ifdef HAVE_MPI CBaseMPIWrapper::Comm CBaseMPIWrapper::currentComm = MPI_COMM_WORLD; +#else +CBaseMPIWrapper::Comm CBaseMPIWrapper::currentComm = 0; // dummy value +#endif #ifdef HAVE_MPI int CBaseMPIWrapper::MinRankError; diff --git a/Common/include/parallelization/mpi_structure.hpp b/Common/include/parallelization/mpi_structure.hpp index b4640bfbcd93..f538db18f6f6 100644 --- a/Common/include/parallelization/mpi_structure.hpp +++ b/Common/include/parallelization/mpi_structure.hpp @@ -467,7 +467,6 @@ class CMediMPIWrapper : public CBaseMPIWrapper { #else // HAVE_MPI -#define MPI_COMM_WORLD 0 #define MPI_UNSIGNED_LONG 1 #define MPI_LONG 2 #define MPI_UNSIGNED_SHORT 3 diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 36adc6c7c366..131ade3eda69 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -458,10 +458,10 @@ class CFVMFlowSolverBase : public CSolver { SU2_OMP_MASTER if (config->GetComm_Level() == COMM_FULL) { su2double rbuf_time; - SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Min_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Min_Delta_Time = rbuf_time; - SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Max_Delta_Time, &rbuf_time, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); Max_Delta_Time = rbuf_time; } SU2_OMP_BARRIER @@ -513,7 +513,7 @@ class CFVMFlowSolverBase : public CSolver { SU2_OMP_MASTER { - SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Global_Delta_UnstTimeND, &glbDtND, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); Global_Delta_UnstTimeND = glbDtND; config->SetDelta_UnstTimeND(Global_Delta_UnstTimeND); @@ -1068,8 +1068,8 @@ class CFVMFlowSolverBase : public CSolver { su2double MyOmega_Max = Omega_Max; su2double MyStrainMag_Max = StrainMag_Max; - SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); } SU2_OMP_BARRIER } diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index 25246cc1d21d..a73cb5126dc9 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); /*--- Uncomment the following line if runtime NaN catching is desired. ---*/ // feenableexcept(FE_INVALID | FE_OVERFLOW); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 3f40c1474929..85a14c212dce 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -835,7 +835,7 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ SU2_OMP_MASTER { unsigned long tmp = ErrorCounter; - SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&tmp, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); config->SetNonphysical_Points(ErrorCounter); } SU2_OMP_BARRIER @@ -1660,7 +1660,7 @@ void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_co SU2_OMP_MASTER { maxVel2 = MaxVel2; - SU2_MPI::Allreduce(&maxVel2, &MaxVel2, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&maxVel2, &MaxVel2, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); config->SetMax_Vel2(max(1e-10, MaxVel2)); } diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index ad0f705d1e2a..41852e1ef958 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_MPI::Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); rank = SU2_MPI::GetRank(); size = SU2_MPI::GetSize(); diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 61e3acb3d96c..6a1fb804e93c 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_MPI::Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); const int rank = SU2_MPI::GetRank(); const int size = SU2_MPI::GetSize(); @@ -644,7 +644,7 @@ void SetProjection_FD(CGeometry *geometry, CConfig *config, CSurfaceMovement *su } } - SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); Gradient[iDV][0] += localGradient; } } @@ -770,7 +770,7 @@ void SetProjection_AD(CGeometry *geometry, CConfig *config, CSurfaceMovement *su for (iDV_Value = 0; iDV_Value < nDV_Value; iDV_Value++){ DV_Value = config->GetDV_Value(iDV, iDV_Value); my_Gradient = SU2_TYPE::GetDerivative(DV_Value); - SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Angle of Attack design variable (this is different, the value comes form the input file) ---*/ diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index 1e6b07815f5f..9bfff3e3fbf0 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization ---*/ SU2_MPI::Init(&argc,&argv); - SU2_MPI::Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); rank = SU2_MPI::GetRank(); size = SU2_MPI::GetSize(); diff --git a/SU2_SOL/src/SU2_SOL.cpp b/SU2_SOL/src/SU2_SOL.cpp index c0cfcf719e8b..68b4da4e4752 100644 --- a/SU2_SOL/src/SU2_SOL.cpp +++ b/SU2_SOL/src/SU2_SOL.cpp @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization ---*/ SU2_MPI::Init(&argc,&argv); - SU2_MPI::Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); const int rank = SU2_MPI::GetRank(); const int size = SU2_MPI::GetSize(); diff --git a/UnitTests/test_driver.cpp b/UnitTests/test_driver.cpp index d53ef2b9063d..0fd92e5dc054 100644 --- a/UnitTests/test_driver.cpp +++ b/UnitTests/test_driver.cpp @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_Comm MPICommunicator(MPI_COMM_WORLD); + SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); /*--- Run the test driver supplied by Catch ---*/ int result = Catch::Session().run(argc, argv); From a99f29909a370f51b1ef8d9d3b9a301ca87fc562 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 1 Feb 2021 15:22:54 +0100 Subject: [PATCH 188/326] fix ref file for reg tests again --- .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 64786afda6e4..3cf10d5cc4aa 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 399999.9724328518, 2.2205000000378153e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 +0 , 0.0 , 399999.9724328518, 3.330700000025998e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 From 6fe6c8e629f162a627c9e4eae4a985500b663cf2 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 2 Feb 2021 00:41:16 +0000 Subject: [PATCH 189/326] working prototype --- Common/include/CConfig.hpp | 6 + Common/include/linear_algebra/CSysMatrix.hpp | 4 + Common/include/linear_algebra/CSysSolve.hpp | 4 +- Common/include/linear_algebra/CSysVector.hpp | 9 +- Common/include/option_structure.hpp | 3 +- Common/src/CConfig.cpp | 3 +- Common/src/linear_algebra/CPastixWrapper.cpp | 3 + Common/src/linear_algebra/CSysMatrix.cpp | 11 +- Common/src/linear_algebra/CSysSolve.cpp | 15 +- Common/src/linear_algebra/CSysSolve_b.cpp | 4 +- Common/src/linear_algebra/CSysVector.cpp | 5 +- SU2_CFD/include/integration/CIntegration.hpp | 7 +- .../integration/CNewtonIntegration.hpp | 144 +++++++ SU2_CFD/include/solvers/CEulerSolver.hpp | 14 +- .../include/solvers/CFVMFlowSolverBase.hpp | 119 +++--- .../include/solvers/CFVMFlowSolverBase.inl | 26 +- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 14 +- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 12 +- SU2_CFD/include/solvers/CSolver.hpp | 23 +- SU2_CFD/include/solvers/CSolverFactory.hpp | 35 +- SU2_CFD/include/solvers/CTurbSolver.hpp | 31 +- .../src/integration/CIntegrationFactory.cpp | 4 + .../src/integration/CNewtonIntegration.cpp | 402 ++++++++++++++++++ SU2_CFD/src/iteration/CFluidIteration.cpp | 52 ++- SU2_CFD/src/solvers/CEulerSolver.cpp | 8 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 8 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 9 +- SU2_CFD/src/solvers/CSolverFactory.cpp | 43 +- SU2_CFD/src/solvers/CTurbSolver.cpp | 83 ++-- 29 files changed, 881 insertions(+), 220 deletions(-) create mode 100644 SU2_CFD/include/integration/CNewtonIntegration.hpp create mode 100644 SU2_CFD/src/integration/CNewtonIntegration.cpp diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3aa76c0faa40..be22ae418141 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -416,6 +416,7 @@ class CConfig { unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */ bool UseVectorization; /*!< \brief Whether to use vectorized numerics schemes. */ + bool CoupledNewton; /*!< \brief Use a coupled Newton method to solve the equations. */ unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */ unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */ @@ -3970,6 +3971,11 @@ class CConfig { */ bool GetUseVectorization(void) const { return UseVectorization; } + /*! + * \brief Get whether to use a coupled Newton method. + */ + bool GetCoupledNewton(void) const { return CoupledNewton; } + /*! * \brief Get the relaxation coefficient of the linear solver for the implicit formulation. * \return relaxation coefficient of the linear solver for the implicit formulation. diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index cfde0c3b1f1e..abf394ae8997 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -922,4 +922,8 @@ class CSysMatrix { #ifdef CODI_REVERSE_TYPE template<> template<> FORCEINLINE su2mixedfloat CSysMatrix::ActiveAssign(const su2double& val) { return SU2_TYPE::GetValue(val); } +#ifdef USE_MIXED_PRECISION +template<> template<> +FORCEINLINE passivedouble CSysMatrix::ActiveAssign(const su2double& val) { return SU2_TYPE::GetValue(val); } +#endif #endif diff --git a/Common/include/linear_algebra/CSysSolve.hpp b/Common/include/linear_algebra/CSysSolve.hpp index d3a507f6a4f7..61a3cb5b78f5 100644 --- a/Common/include/linear_algebra/CSysSolve.hpp +++ b/Common/include/linear_algebra/CSysSolve.hpp @@ -312,10 +312,12 @@ class CSysSolve { * \param[out] residual - final normalized residual * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. + * \param[in] xIsZero - If true assume x = 0. */ unsigned long FGMRES_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config) const; + ScalarType & residual, bool monitoring, const CConfig *config, + bool xIsZero = false) const; /*! * \brief Biconjugate Gradient Stabilized Method (BCGSTAB) diff --git a/Common/include/linear_algebra/CSysVector.hpp b/Common/include/linear_algebra/CSysVector.hpp index 2896b8ea8784..4d03069df960 100644 --- a/Common/include/linear_algebra/CSysVector.hpp +++ b/Common/include/linear_algebra/CSysVector.hpp @@ -66,7 +66,7 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> ScalarType* vec_val = nullptr; /*!< \brief Storage, 64 byte aligned (do not use normal new/delete). */ unsigned long nElm = 0; /*!< \brief Total number of elements (or number elements on this processor). */ unsigned long nElmDomain = 0; /*!< \brief Total number of elements without Ghost cells. */ - unsigned long nVar = 0; /*!< \brief Number of elements in a block. */ + unsigned long nVar = 1; /*!< \brief Number of elements in a block. */ /*! * \brief Generic initialization from a scalar or array. @@ -111,7 +111,7 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> * \param[in] size - Number of elements locally. * \param[in] val - Default value for elements. */ - CSysVector(unsigned long size, ScalarType val = 0.0) { Initialize(size, size, 1, &val, false); } + explicit CSysVector(unsigned long size, ScalarType val = 0.0) { Initialize(size, size, 1, &val, false); } /*! * \brief Construct from size and value (block version). @@ -129,7 +129,7 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> * \param[in] size - Number of elements locally. * \param[in] u_array - Vector stored as array being copied. */ - explicit CSysVector(unsigned long size, const ScalarType* u_array) { Initialize(size, size, 1, u_array, true); } + CSysVector(unsigned long size, const ScalarType* u_array) { Initialize(size, size, 1, u_array, true); } /*! * \brief Constructor from array (block version). @@ -138,8 +138,7 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> * \param[in] numVar - number of variables in each block * \param[in] u_array - vector stored as array being copied */ - explicit CSysVector(unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, - const ScalarType* u_array) { + CSysVector(unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, const ScalarType* u_array) { Initialize(numBlk, numBlkDomain, numVar, u_array, true); } diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 5a3c8213c379..743d8cbc771f 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -77,7 +77,7 @@ const unsigned int MAX_PARAMETERS = 10; /*!< \brief Maximum number of para const unsigned int MAX_NUMBER_PERIODIC = 10; /*!< \brief Maximum number of periodic boundary conditions. */ const unsigned int MAX_STRING_SIZE = 200; /*!< \brief Maximum number of domains. */ const unsigned int MAX_NUMBER_FFD = 15; /*!< \brief Maximum number of FFDBoxes for the FFD. */ -const unsigned int MAX_SOLS = 12; /*!< \brief Maximum number of solutions at the same time (dimension of solution container array). */ +enum: unsigned int{MAX_SOLS = 12}; /*!< \brief Maximum number of solutions at the same time (dimension of solution container array). */ const unsigned int MAX_TERMS = 6; /*!< \brief Maximum number of terms in the numerical equations (dimension of solver container array). */ const unsigned int MAX_ZONES = 3; /*!< \brief Maximum number of zones. */ const unsigned int MAX_FE_KINDS = 4; /*!< \brief Maximum number of Finite Elements. */ @@ -441,7 +441,6 @@ static const MapType Measurements_Map = { enum RUNTIME_TYPE { RUNTIME_FLOW_SYS = 2, /*!< \brief One-physics case, the code is solving the flow equations(Euler and Navier-Stokes). */ RUNTIME_TURB_SYS = 3, /*!< \brief One-physics case, the code is solving the turbulence model. */ - RUNTIME_ADJPOT_SYS = 5, /*!< \brief One-physics case, the code is solving the adjoint potential flow equation. */ RUNTIME_ADJFLOW_SYS = 6, /*!< \brief One-physics case, the code is solving the adjoint equations is being solved (Euler and Navier-Stokes). */ RUNTIME_ADJTURB_SYS = 7, /*!< \brief One-physics case, the code is solving the adjoint turbulence model. */ RUNTIME_MULTIGRID_SYS = 14, /*!< \brief Full Approximation Storage Multigrid system of equations. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 54d4a277bcc3..714af89d5efe 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1572,6 +1572,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Offset parameter for the buffet sensor */ addDoubleOption("BUFFET_LAMBDA", Buffet_lambda, 0.0); + /* DESCRIPTION: Use a coupled Newton method. */ + addBoolOption("COUPLED_NEWTON_METHOD", CoupledNewton, false); /* DESCRIPTION: Number of samples for quasi-Newton methods. */ addUnsignedShortOption("QUASI_NEWTON_NUM_SAMPLES", nQuasiNewtonSamples, 0); /* DESCRIPTION: Whether to use vectorized numerical schemes, less robust against transients. */ @@ -7922,7 +7924,6 @@ unsigned short CConfig::GetContainerPosition(unsigned short val_eqsystem) { case RUNTIME_TRANS_SYS: return TRANS_SOL; case RUNTIME_HEAT_SYS: return HEAT_SOL; case RUNTIME_FEA_SYS: return FEA_SOL; - case RUNTIME_ADJPOT_SYS: return ADJFLOW_SOL; case RUNTIME_ADJFLOW_SYS: return ADJFLOW_SOL; case RUNTIME_ADJTURB_SYS: return ADJTURB_SOL; case RUNTIME_ADJFEA_SYS: return ADJFEA_SOL; diff --git a/Common/src/linear_algebra/CPastixWrapper.cpp b/Common/src/linear_algebra/CPastixWrapper.cpp index 9a1c67d86e36..f92f8536a1e4 100644 --- a/Common/src/linear_algebra/CPastixWrapper.cpp +++ b/Common/src/linear_algebra/CPastixWrapper.cpp @@ -333,5 +333,8 @@ void CPastixWrapper::Factorize(CGeometry *geometry, const CConfig *c template class CPastixWrapper; #else template class CPastixWrapper; +#ifdef USE_MIXED_PRECISION +template class CPastixWrapper; +#endif #endif #endif diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index dd6aaae8f620..a4e1130c86e0 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -1413,9 +1413,18 @@ template void CSysMatrix::InitiateComms(const CSysVector::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); -#if defined(CODI_REVERSE_TYPE) || defined(USE_MIXED_PRECISION) +#ifdef USE_MIXED_PRECISION +template class CSysMatrix; +template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); +template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); /*--- In reverse AD (or mixed precision) the passive matrix is also used to communicate active (or double) vectors resp.. ---*/ template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; #endif +#ifdef CODI_REVERSE_TYPE +template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +#endif #endif // CODI_FORWARD_TYPE diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index db9e415098dd..c151a958fbc6 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -338,7 +338,8 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & template unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector & b, CSysVector & x, const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { + ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, + const CConfig *config, bool xIsZero) const { const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); @@ -388,8 +389,13 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector::Solve_b(CSysMatrix & Jacobian, template class CSysSolve; #else template class CSysSolve; +#ifdef USE_MIXED_PRECISION +template class CSysSolve; +#endif #endif diff --git a/Common/src/linear_algebra/CSysSolve_b.cpp b/Common/src/linear_algebra/CSysSolve_b.cpp index 4d30bec3faae..062708f9dc7c 100644 --- a/Common/src/linear_algebra/CSysSolve_b.cpp +++ b/Common/src/linear_algebra/CSysSolve_b.cpp @@ -70,5 +70,7 @@ void CSysSolve_b::Solve_b(const codi::RealReverse::Real* x, codi::Re } template class CSysSolve_b; - +#ifdef USE_MIXED_PRECISION +template class CSysSolve_b; +#endif #endif diff --git a/Common/src/linear_algebra/CSysVector.cpp b/Common/src/linear_algebra/CSysVector.cpp index 7bcd0fe7d913..0c941c5c8000 100644 --- a/Common/src/linear_algebra/CSysVector.cpp +++ b/Common/src/linear_algebra/CSysVector.cpp @@ -69,7 +69,10 @@ CSysVector::~CSysVector() { /*--- Explicit instantiations ---*/ /*--- We allways need su2double (regardless if it is passive or active). ---*/ template class CSysVector; -#if defined(CODI_REVERSE_TYPE) || defined(USE_MIXED_PRECISION) +#ifdef USE_MIXED_PRECISION /*--- In reverse AD (or with mixed precision) we will also have passive (or float) vectors. ---*/ template class CSysVector; #endif +#ifdef CODI_REVERSE_TYPE +template class CSysVector; +#endif diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 0c88a5d05596..96acf5f6ed00 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -87,6 +87,11 @@ class CIntegration { */ virtual ~CIntegration(void) = default; + /*! + * \brief Return true if the integration already considers all solvers. + */ + inline virtual bool IsFullyCoupled(void) const { return false; } + /*! * \brief Get the indicator of the convergence for the direct, adjoint and linearized problem. * \return TRUE means that the convergence criteria is satisfied; @@ -108,7 +113,6 @@ class CIntegration { */ 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; @@ -116,7 +120,6 @@ class CIntegration { */ 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; diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp new file mode 100644 index 000000000000..14fcc8f1cbd5 --- /dev/null +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -0,0 +1,144 @@ +/*! + * \file CNewtonIntegration.hpp + * \brief Coupled Newton integration. + * \author P. Gomes + * \version 7.1.0 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "CIntegration.hpp" +#include "../../../Common/include/linear_algebra/CSysSolve.hpp" + +/*! + * \class CNewtonIntegration + * \brief Class for time integration using a coupled Newton method, based + * on matrix-free products with the true Jacobian via finite differences. + */ +class CNewtonIntegration final : public CIntegration { +public: +#ifdef CODI_FORWARD_TYPE + using Scalar = su2double; + using MixedScalar = su2double; +#else + /*--- No point having single precision matrix-free products. ---*/ + using Scalar = passivedouble; + /*--- The block preconditioners may still use single precision. ---*/ + using MixedScalar = su2mixedfloat; +#endif + +private: + /*--- Residual evaluation modes, explicit for products, default to allow preconditioners to be built. ---*/ + enum ResEvalType {EXPLICIT, DEFAULT}; + + bool thread_safe; /*!< \brief If all target solvers support OpenMP. */ + unsigned long omp_chunk_size; /*!< \brief Chunk size used in light point loops. */ + + unsigned short KindFlowSol = 0; + unsigned short KindSol2EqSys[MAX_SOLS] = {0}; /*!< \brief Deduce runtime equations from solver position. */ + + Scalar finDiffStep = 0.0; /*!< \brief Based on RMS(solution), used in matrix-free products. */ + + CConfig* config = nullptr; + CSolver** solvers = nullptr; + CGeometry* geometry = nullptr; + CNumerics*** numerics = nullptr; + + std::vector kindSol; /*!< \brief Positions of the target solvers. */ + std::vector nVars; /*!< \brief Number of variables for each target solver. */ + + /*--- Residual, solution, and linear solver for the coupled problem. ---*/ + CSysVector LinSysRes; + CSysVector LinSysSol; + CSysSolve LinSolver; + + /*--- Preconditioner objects for each active solver. ---*/ + std::vector*> preconditioners; + + /*--- If mixed precision is used these temporaries are + * used to interface with the preconditioners. ---*/ + mutable std::vector > precondIn, precondOut; + + template::value> = 0> + inline CSysVector& GetPrecVecIn(size_t i) const { return precondIn[i]; } + + template::value> = 0> + inline CSysVector& GetPrecVecOut(size_t i) const { return precondOut[i]; } + + /*--- Otherwise we borrow the memory of the solvers. ---*/ + template::value> = 0> + inline CSysVector& GetPrecVecIn(size_t i) const { return solvers[kindSol[i]]->LinSysRes; } + + template::value> = 0> + inline CSysVector& GetPrecVecOut(size_t i) const { return solvers[kindSol[i]]->LinSysSol; } + + /*! + * \brief List target solvers, gather their info, etc.. + */ + void Setup(); + + /*! + * \brief Evaluate the nonlinear residual of target solvers, which should be capable of alternating + * between implicit and explicit iterations to save time during matrix-free products. + */ + void ComputeResiduals(ResEvalType type); + +public: + /*! + * \brief Constructor. + */ + CNewtonIntegration(); + + /*! + * \brief Destructor. + */ + ~CNewtonIntegration(); + + /*! + * \brief Return true if the integration already considers all solvers. + */ + inline bool IsFullyCoupled(void) const override { return true; } + + /*! + * \brief This class overrides this method to make it a drop-in replacement for CMultigridIntegration. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). + * \param[in] config - Definition of the particular problem. + * \param[in] RunTime_EqSystem - System of equations which is going to be solved. + * \param[in] iZone - Current zone. + * \param[in] iInst - Current instance. + */ + void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, + CNumerics ******numerics_container, CConfig **config, + unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) override; + + /*! + * \brief Implementation of matrix-vector product with the real Jacobian of the nonlinear residuals. + */ + void MatrixFreeProduct(const CSysVector& u, CSysVector& v); + + /*! + * \brief Implementation of the block-Jacobi preconditioner. + */ + void BlockJacobiPrecond(const CSysVector& u, CSysVector& v) const; + +}; diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 22857bc2a5f7..983c74c01535 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -799,14 +799,18 @@ class CEulerSolver : public CFVMFlowSolverBase { CConfig *config) final; /*! - * \brief Update the solution using an implicit Euler scheme. + * \brief Prepare an implicit iteration. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - void ImplicitEuler_Iteration(CGeometry *geometry, - CSolver **solver_container, - CConfig *config) final; + void PrepareImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) final; + + /*! + * \brief Complete an implicit iteration. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + */ + void CompleteImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) final; /*! * \brief Provide the mass flow rate. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 36adc6c7c366..0fe5b09b5d6e 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -267,6 +267,12 @@ class CFVMFlowSolverBase : public CSolver { CNumerics *numerics, CConfig *config); using CSolver::Viscous_Residual; /*--- Silence warning ---*/ + /*! + * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear + * iteration for stability. + */ + void ComputeUnderRelaxationFactor(const CConfig* config); + /*! * \brief General implementation to load a flow solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. @@ -836,21 +842,18 @@ class CFVMFlowSolverBase : public CSolver { } /*! - * \brief Generic implementation of implicit Euler iteration with an optional preconditioner applied to the diagonal. - * \param[in] compute_ur - Whether to use automatic under-relaxation for the update. + * \brief Generic implementation to prepare an implicit iteration with an optional preconditioner applied to the diagonal. * \tparam DiagonalPrecond - A function object implementing: * - active: A boolean variable to determine if the preconditioner should be used. * - (config, iPoint, delta): Compute and return a matrix type compatible with the Jacobian matrix, * where "delta" is V/dt. */ template - void ImplicitEuler_Iteration_impl(DiagonalPrecond& preconditioner, CGeometry *geometry, - CSolver **solver_container, CConfig *config, bool compute_ur) { + void PrepareImplicitIteration_impl(DiagonalPrecond& preconditioner, CGeometry *geometry, CConfig *config) { - const bool adjoint = config->GetContinuous_Adjoint(); + const bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - /*--- Set shared residual variables to 0 and declare - * local ones for current thread to work on. ---*/ + /*--- Set shared residual variables to 0 and declare local ones for current thread to work on. ---*/ SU2_OMP_MASTER for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -863,42 +866,47 @@ class CFVMFlowSolverBase : public CSolver { const su2double* coordMax[MAXNVAR] = {nullptr}; unsigned long idxMax[MAXNVAR] = {0}; - /*--- Build implicit system ---*/ - - SU2_OMP(for schedule(static,omp_chunk_size) nowait) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Read the residual ---*/ - - su2double* local_Res_TruncError = nodes->GetResTruncError(iPoint); + /*--- Add pseudotime term to Jacobian. ---*/ - /*--- Read the volume ---*/ + if (implicit) { + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); + /*--- Modify matrix diagonal to improve diagonal dominance. ---*/ - /*--- Modify matrix diagonal to assure diagonal dominance ---*/ + if (nodes->GetDelta_Time(iPoint) != 0.0) { - if (nodes->GetDelta_Time(iPoint) != 0.0) { + su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); - su2double Delta = Vol / nodes->GetDelta_Time(iPoint); + su2double Delta = Vol / nodes->GetDelta_Time(iPoint); - if (preconditioner.active) { - Jacobian.AddBlock2Diag(iPoint, preconditioner(config, iPoint, Delta)); + if (preconditioner.active) + Jacobian.AddBlock2Diag(iPoint, preconditioner(config, iPoint, Delta)); + else + Jacobian.AddVal2Diag(iPoint, Delta); } else { - Jacobian.AddVal2Diag(iPoint, Delta); + Jacobian.SetVal2Diag(iPoint, 1.0); } } - else { - Jacobian.SetVal2Diag(iPoint, 1.0); + } + + /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ + + SU2_OMP(for schedule(static,omp_chunk_size) nowait) + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Multigrid contribution to residual. ---*/ + + su2double* local_Res_TruncError = nodes->GetResTruncError(iPoint); + + if (nodes->GetDelta_Time(iPoint) == 0.0) { for (unsigned short iVar = 0; iVar < nVar; iVar++) { LinSysRes(iPoint,iVar) = 0.0; local_Res_TruncError[iVar] = 0.0; } } - /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { unsigned long total_index = iPoint*nVar + iVar; LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); @@ -918,35 +926,26 @@ class CFVMFlowSolverBase : public CSolver { AddRes_RMS(iVar, resRMS[iVar]); AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); } + SU2_OMP_BARRIER - /*--- Initialize residual and solution at the ghost points ---*/ - - SU2_OMP(sections nowait) - { - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysRes.SetBlock_Zero(iPoint); - - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysSol.SetBlock_Zero(iPoint); - } - - /*--- Solve or smooth the linear system. ---*/ - - auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + /*--- Compute the root mean square residual ---*/ SU2_OMP_MASTER - { - SetIterLinSolver(iter); - SetResLinSolver(System.GetResidual()); - } + SetResidual_RMS(geometry, config); SU2_OMP_BARRIER + } + + /*! + * \brief Generic implementation to complete an implicit iteration, i.e. update the solution. + * \tparam compute_ur - Whether to use automatic under-relaxation for the update. + */ + template + void CompleteImplicitIteration_impl(CGeometry *geometry, CConfig *config) { - if (compute_ur) ComputeUnderRelaxationFactor(solver_container, config); + if (compute_ur) ComputeUnderRelaxationFactor(config); - /*--- Update solution (system written in terms of increments) ---*/ + /*--- Update solution with under-relaxation and communicate it. ---*/ - if (!adjoint) { + if (!config->GetContinuous_Adjoint()) { SU2_OMP_FOR_STAT(omp_chunk_size) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -960,23 +959,13 @@ class CFVMFlowSolverBase : public CSolver { CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); } - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); + /*--- For verification cases, compute the global error metrics. ---*/ SU2_OMP_MASTER - { - /*--- Compute the root mean square residual ---*/ - - SetResidual_RMS(geometry, config); - - /*--- For verification cases, compute the global error metrics. ---*/ - - ComputeVerificationError(geometry, config); - } + ComputeVerificationError(geometry, config); SU2_OMP_BARRIER - } /*! @@ -1128,11 +1117,9 @@ class CFVMFlowSolverBase : public CSolver { void SetPrimitive_Limiter(CGeometry* geometry, const CConfig* config) final; /*! - * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear - * iteration for stability. \param[in] solver - Container vector with all the solutions. \param[in] config - - * Definition of the particular problem. + * \brief Implementation of implicit Euler iteration. */ - void ComputeUnderRelaxationFactor(CSolver** solver, const CConfig* config) final; + void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final; /*! * \brief Set the total residual adding the term that comes from the Dual Time Strategy. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 2c7b12ba95ce..e1100073dc06 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -658,7 +658,7 @@ void CFVMFlowSolverBase::ComputeVerificationError(CGeometry* geometry, CCo } template -void CFVMFlowSolverBase::ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig* config) { +void CFVMFlowSolverBase::ComputeUnderRelaxationFactor(const CConfig* config) { /* Loop over the solution update given by relaxing the linear system for this nonlinear iteration. */ @@ -693,6 +693,30 @@ void CFVMFlowSolverBase::ComputeUnderRelaxationFactor(CSolver** solver_con } } +template +void CFVMFlowSolverBase::ImplicitEuler_Iteration(CGeometry *geometry, CSolver**, CConfig *config) { + + PrepareImplicitIteration(geometry, nullptr, config); + + /*--- Solve or smooth the linear system. ---*/ + + SU2_OMP(for schedule(static,OMP_MIN_SIZE) nowait) + for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) { + LinSysRes.SetBlock_Zero(iPoint); + LinSysSol.SetBlock_Zero(iPoint); + } + + auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + + SU2_OMP_MASTER { + SetIterLinSolver(iter); + SetResLinSolver(System.GetResidual()); + } + SU2_OMP_BARRIER + + CompleteImplicitIteration(geometry, nullptr, config); +} + template void CFVMFlowSolverBase::SetInletAtVertex(const su2double* val_inlet, unsigned short iMarker, unsigned long iVertex) { diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 73e63183dac1..f8f7e1ad35d6 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -325,14 +325,18 @@ class CIncEulerSolver : public CFVMFlowSolverBase allocatedSolvers; @@ -99,10 +100,10 @@ class CSolverFactory { * \return - A pointer to the allocated turbulent solver */ static CSolver* CreateTurbSolver(ENUM_TURB_MODEL kindTurbModel, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, int adjoint); - + /*! - * \brief Create a heat solver - * \param[in] solver - The solver container + * \brief Create a heat solver + * \param[in] solver - The solver container * \param[in] geometry - The geometry definition * \param[in] config - The configuration * \param[in] iMGLevel - The multigrid level @@ -110,10 +111,10 @@ class CSolverFactory { * \return - A pointer to the allocated heat solver */ static CSolver* CreateHeatSolver(CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, bool adjoint); - + /*! - * \brief Create a mesh solver - * \param[in] solver - The solver container + * \brief Create a mesh solver + * \param[in] solver - The solver container * \param[in] geometry - The geometry definition * \param[in] config - The configuration * \param[in] iMGLevel - The multigrid level @@ -121,9 +122,9 @@ class CSolverFactory { * \return - A pointer to the allocated mesh solver */ static CSolver* CreateMeshSolver(CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, bool adjoint); - + /*! - * \brief Create a DG solver + * \brief Create a DG solver * \param[in] kindTurbModel - Kind of DG solver * \param[in] geometry - The geometry definition * \param[in] config - The configuration @@ -131,9 +132,9 @@ class CSolverFactory { * \return - A pointer to the allocated DG solver */ static CSolver* CreateDGSolver(SUB_SOLVER_TYPE kindDGSolver, CGeometry *geometry, CConfig *config, int iMGLevel); - + /*! - * \brief Create a flow solver + * \brief Create a flow solver * \param[in] kindFlowSolver - Kind of flow solver * \param[in] solver - The solver container * \param[in] geometry - The geometry definition @@ -144,7 +145,7 @@ class CSolverFactory { static CSolver* CreateFlowSolver(SUB_SOLVER_TYPE kindFlowSolver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel); /*! - * \brief Create a NEMO flow solver + * \brief Create a NEMO flow solver * \param[in] kindNEMOSolver - Kind of flow solver * \param[in] solver - The solver container * \param[in] geometry - The geometry definition @@ -153,18 +154,18 @@ class CSolverFactory { * \return - A pointer to the allocated flow solver */ static CSolver* CreateNEMOSolver(SUB_SOLVER_TYPE kindNEMOSolver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel); - + /*! - * \brief Generic routine to create a solver + * \brief Generic routine to create a solver * \param[in] kindSolver - Kind of solver - * \param[in] solver - The solver container + * \param[in] solver - The solver container * \param[in] geometry - The geometry definition * \param[in] config - The configuration * \param[in] iMGLevel - The multigrid level * \return - A pointer to the allocated solver */ static CSolver* CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel); - + public: /*! @@ -173,7 +174,7 @@ class CSolverFactory { CSolverFactory() = delete; /*! - * \brief Create the solver container by allocating the primary solver + * \brief Create the solver container by allocating the primary solver * and secondary solvers like heat solver, turbulent solver etc * \param[in] kindSolver - The kind of primary solver * \param[in] config - The configuration diff --git a/SU2_CFD/include/solvers/CTurbSolver.hpp b/SU2_CFD/include/solvers/CTurbSolver.hpp index cc75f2527f87..add2fa7f43a7 100644 --- a/SU2_CFD/include/solvers/CTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSolver.hpp @@ -107,6 +107,13 @@ class CTurbSolver : public CSolver { */ void SumEdgeFluxes(CGeometry* geometry); + /*! + * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over + * a nonlinear iteration for stability. + * \param[in] config - Definition of the particular problem. + */ + void ComputeUnderRelaxationFactor(const CConfig *config); + public: /*! @@ -242,6 +249,22 @@ class CTurbSolver : public CSolver { CNumerics *visc_numerics, CConfig *config) final; + /*! + * \brief Prepare an implicit iteration. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + */ + void PrepareImplicitIteration(CGeometry *geometry, CSolver** solver_container, CConfig *config) final; + + /*! + * \brief Complete an implicit iteration. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + */ + void CompleteImplicitIteration(CGeometry *geometry, CSolver** solver_container, CConfig *config) final; + /*! * \brief Update the solution using an implicit solver. * \param[in] geometry - Geometrical definition of the problem. @@ -251,6 +274,7 @@ class CTurbSolver : public CSolver { void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) override; + /*! * \brief Set the total residual adding the term that comes from the Dual Time-Stepping Strategy. * \param[in] geometry - Geometric definition of the problem. @@ -267,13 +291,6 @@ class CTurbSolver : public CSolver { unsigned short iMesh, unsigned short RunTime_EqSystem) final; - /*! - * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over a nonlinear iteration for stability. - * \param[in] solver - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - */ - void ComputeUnderRelaxationFactor(CSolver **solver, const CConfig *config) final; - /*! * \brief Load a solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/integration/CIntegrationFactory.cpp b/SU2_CFD/src/integration/CIntegrationFactory.cpp index f350f60eb7ea..3233417454fc 100644 --- a/SU2_CFD/src/integration/CIntegrationFactory.cpp +++ b/SU2_CFD/src/integration/CIntegrationFactory.cpp @@ -28,6 +28,7 @@ #include "../../include/integration/CIntegrationFactory.hpp" #include "../../include/integration/CSingleGridIntegration.hpp" #include "../../include/integration/CMultiGridIntegration.hpp" +#include "../../include/integration/CNewtonIntegration.hpp" #include "../../include/integration/CStructuralIntegration.hpp" #include "../../include/integration/CFEM_DG_Integration.hpp" @@ -60,6 +61,9 @@ CIntegration* CIntegrationFactory::CreateIntegration(INTEGRATION_TYPE integratio case INTEGRATION_TYPE::MULTIGRID: integration = new CMultiGridIntegration(); break; + case INTEGRATION_TYPE::COUPLED: + integration = new CNewtonIntegration(); + break; case INTEGRATION_TYPE::STRUCTURAL: integration = new CStructuralIntegration(); break; diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp new file mode 100644 index 000000000000..58249d98bc1a --- /dev/null +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -0,0 +1,402 @@ +/*! + * \file CNewtonIntegration.cpp + * \brief Coupled Newton integration. + * \author P. Gomes + * \version 7.1.0 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/integration/CNewtonIntegration.hpp" +#include "../../../Common/include/parallelization/omp_structure.hpp" +#include "../../../Common/include/linear_algebra/CPreconditioner.hpp" +#include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp" +#include "../../../Common/include/linear_algebra/CSysSolve.hpp" + +#define PARALLEL_FOR SU2_OMP(for schedule(static,omp_chunk_size) nowait) + +using Scalar = CNewtonIntegration::Scalar; + +namespace { + +class CMatrixFreeProductWrapper final : public CMatrixVectorProduct { + CNewtonIntegration* integration; +public: + CMatrixFreeProductWrapper(CNewtonIntegration* i) : integration(i) {} + + /*! + * \brief Operator for the product operation. + */ + inline void operator()(const CSysVector& u, CSysVector& v) const override { + integration->MatrixFreeProduct(u, v); + } +}; + +class CBlockJacobiPrecondWrapper final : public CPreconditioner { + const CNewtonIntegration* integration; +public: + CBlockJacobiPrecondWrapper(const CNewtonIntegration* i) : integration(i) {} + + /*! + * \brief Operator for the preconditioning operation. + */ + inline void operator()(const CSysVector& u, CSysVector& v) const override { + integration->BlockJacobiPrecond(u, v); + } +}; +} + +CNewtonIntegration::CNewtonIntegration() { + KindSol2EqSys[FLOW_SOL] = RUNTIME_FLOW_SYS; + KindSol2EqSys[TURB_SOL] = RUNTIME_TURB_SYS; +// KindSol2EqSys[HEAT_SOL] = RUNTIME_HEAT_SYS; +// KindSol2EqSys[RAD_SOL] = RUNTIME_RADIATION_SYS; +} + +CNewtonIntegration::~CNewtonIntegration() { + for (auto p : preconditioners) delete p; +} + +void CNewtonIntegration::Setup() { + + if (!kindSol.empty()) return; + + KindFlowSol = EULER; + if (config->GetViscous()) KindFlowSol = NAVIER_STOKES; + if (solvers[TURB_SOL]) KindFlowSol = RANS; + + const auto nPoint = geometry->GetnPoint(); + const auto nPointDomain = geometry->GetnPointDomain(); + unsigned long nVarTot = 0; + + thread_safe = true; + omp_chunk_size = computeStaticChunkSize(nPoint, omp_get_max_threads(), 512); + + for (auto iSol = 0u; iSol < MAX_SOLS; ++iSol) { + if (solvers[iSol] && iSol != MESH_SOL && iSol != ADJMESH_SOL) { + + if (KindSol2EqSys[iSol] == 0) + SU2_MPI::Error("Some of the solvers do not support the coupled Newton method.", CURRENT_FUNCTION); + + auto nVar = solvers[iSol]->GetnVar(); + kindSol.push_back(iSol); + nVars.push_back(nVar); + nVarTot += nVar; + + thread_safe &= solvers[iSol]->GetHasHybridParallel(); + + preconditioners.push_back(nullptr); + precondIn.push_back(CSysVector()); + precondOut.push_back(CSysVector()); + + /*--- Check if the solver is able to provide a linear preconditioner. ---*/ + if (config->GetKind_TimeIntScheme() != EULER_IMPLICIT) continue; + + auto& p = preconditioners.back(); + + switch (config->GetKind_Linear_Solver_Prec()) { + case JACOBI: + p = new CJacobiPreconditioner(solvers[iSol]->Jacobian, geometry, config, false); + break; + case LINELET: + p = new CLineletPreconditioner(solvers[iSol]->Jacobian, geometry, config); + break; + case LU_SGS: + p = new CLU_SGSPreconditioner(solvers[iSol]->Jacobian, geometry, config); + break; + case ILU: + p = new CILUPreconditioner(solvers[iSol]->Jacobian, geometry, config, false); + break; + case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: + p = new CPastixPreconditioner(solvers[iSol]->Jacobian, geometry, config, + config->GetKind_Linear_Solver_Prec(), false); + break; + } + + if (!std::is_same::value) { + precondIn.back().Initialize(nPoint, nPointDomain, nVar, nullptr); + precondOut.back().Initialize(nPoint, nPointDomain, nVar, nullptr); + } + } + } + + LinSysRes.Initialize(nPoint, nPointDomain, nVarTot, nullptr); + LinSysSol.Initialize(nPoint, nPointDomain, nVarTot, nullptr); + +} + +void CNewtonIntegration::ComputeResiduals(ResEvalType type) { + + /*--- Run all the pre and post processings first, this captures e.g. the + * dependency of the flow residuals on the eddy viscosity. If not done + * this way we get a triangular Jacobian instead of the true one. ---*/ + + for (int step=0; step<1; ++step) { + for (auto pos : kindSol) { + /*--- Set global config parameters for the solver. ---*/ + const auto eqSys = KindSol2EqSys[pos]; + SU2_OMP_MASTER + config->SetGlobalParam(KindFlowSol, eqSys); + SU2_OMP_BARRIER + + /*--- Save the default integration scheme, and force to explicit if required. ---*/ + auto TimeIntScheme = config->GetKind_TimeIntScheme(); + if (type == EXPLICIT) { + SU2_OMP_MASTER + config->SetKind_TimeIntScheme(EULER_EXPLICIT); + SU2_OMP_BARRIER + } + + if (step==0) { + solvers[pos]->Preprocessing(geometry, solvers, config, MESH_0, NO_RK_ITER, eqSys, false); +// solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); +// } else { + Space_Integration(geometry, solvers, numerics[pos], config, MESH_0, NO_RK_ITER, eqSys); + } + + /*--- Restore default. ---*/ + if (type == EXPLICIT) { + SU2_OMP_MASTER + config->SetKind_TimeIntScheme(TimeIntScheme); + SU2_OMP_BARRIER + } + } + } +} + +void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver *****solvers_, CNumerics ******numerics_, + CConfig **config_, unsigned short EqSystem, unsigned short iZone, + unsigned short iInst) { + config = config_[iZone]; + solvers = solvers_[iZone][iInst][MESH_0]; + geometry = geometry_[iZone][iInst][MESH_0]; + numerics = numerics_[iZone][iInst][MESH_0]; + + Setup(); + + /*--- The step for finite-difference-based matrix-free product depends on the RMS of the solution. ---*/ + su2double rmsSol = 0.0; + + SU2_OMP_PARALLEL_(if(thread_safe)) { + + /*--- Compute the current residual and the approximate Jacobians for preconditioning. ---*/ + + ComputeResiduals(DEFAULT); + + for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { + const auto pos = kindSol[iSol]; + const auto nVar = nVars[iSol]; + + const auto eqSys = KindSol2EqSys[pos]; + SU2_OMP_MASTER + config->SetGlobalParam(KindFlowSol, eqSys); + SU2_OMP_BARRIER + + solvers[pos]->SetTime_Step(geometry, solvers, config, MESH_0, config->GetTimeIter()); + + solvers[pos]->PrepareImplicitIteration(geometry, solvers, config); + + /*--- Save current solution to be able to perturb it. ---*/ + solvers[pos]->GetNodes()->Set_OldSolution(); + + /*--- Aggregate residuals. ---*/ + su2double rmsSol_loc = 0.0; + + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) { + for (auto iVar = 0ul; iVar < nVar; ++iVar) { + rmsSol_loc += pow(solvers[pos]->GetNodes()->GetSolution(iPoint,iVar), 2); + LinSysRes(iPoint, offset+iVar) = SU2_TYPE::GetValue(solvers[pos]->LinSysRes(iPoint, iVar)); + } + } + atomicAdd(rmsSol_loc, rmsSol); + + offset += nVar; + + /*--- Build preconditioner. ---*/ + if (preconditioners[iSol]) preconditioners[iSol]->Build(); + + } + SU2_OMP_BARRIER + + SU2_OMP_MASTER { + SU2_MPI::Allreduce(&rmsSol, &finDiffStep, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + /// TODO: Customize the step. + finDiffStep = 1e-4 * max(1.0, sqrt(finDiffStep / geometry->GetGlobal_nPointDomain())); + } + SU2_OMP_BARRIER + + /*--- Solve for the search direction. ---*/ + + CMatrixFreeProductWrapper product(this); + CBlockJacobiPrecondWrapper precond(this); + + LinSysSol = Scalar(0.0); + + auto iter = config->GetLinear_Solver_Iter(); + Scalar tol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + Scalar eps = 0.0; + auto nIter = LinSolver.FGMRES_LinSolver(LinSysRes, LinSysSol, product, precond, + tol, iter, eps, false, config, true); + SU2_OMP_MASTER + for (auto pos : kindSol) { + solvers[pos]->SetIterLinSolver(nIter); + solvers[pos]->SetResLinSolver(eps); + } + SU2_OMP_BARRIER + + /*--- Update solution. ---*/ + /* For now we let each solver handle the search direction, using its own form of under-relaxation + * to then adapt the CFL. However we should also check global descent, and use a back-tracking + * strategy that informs the CFL adaptation to increase/decrease/freeze. */ + + for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { + const auto pos = kindSol[iSol]; + const auto nVar = nVars[iSol]; + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) + for (auto iVar = 0ul; iVar < nVar; ++iVar) + solvers[pos]->LinSysSol(iPoint,iVar) = LinSysSol(iPoint,offset+iVar); + + solvers[pos]->CompleteImplicitIteration(geometry, solvers, config); + + /*--- Call the various post processings to replicate what happens in Single and MG iterations, + * it should not be necessary to run the flow solver preprocessing in output-mode, + * since flow, turbulence, and all scalars are coupled here. ---*/ + + if (pos == FLOW_SOL) { + solvers[pos]->Preprocessing(geometry, solvers, config, MESH_0, + NO_RK_ITER, KindSol2EqSys[pos], true); + } + + solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); + + SU2_OMP_MASTER + switch (KindSol2EqSys[pos]) { + case RUNTIME_FLOW_SYS: + solvers[pos]->Pressure_Forces(geometry, config); + solvers[pos]->Momentum_Forces(geometry, config); + solvers[pos]->Friction_Forces(geometry, config); + break; + case RUNTIME_HEAT_SYS: + solvers[pos]->Heat_Fluxes(geometry, solvers, config); + break; + } + SU2_OMP_BARRIER + + offset += nVar; + } + + } // end SU2_OMP_PARALLEL +} + +void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVector& v) { + + /*--- Perturb the solution. ---*/ + Scalar factor = finDiffStep / u.norm(); + + for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { + const auto pos = kindSol[iSol]; + const auto nVar = nVars[iSol]; + + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) + for (auto iVar = 0ul; iVar < nVar; ++iVar) + solvers[pos]->GetNodes()->Add_DeltaSolution(iPoint,iVar, u(iPoint,offset+iVar)*factor); + + offset += nVar; + } + SU2_OMP_BARRIER + + + /*--- Compute residuals after perturbation. ---*/ + + ComputeResiduals(EXPLICIT); + + + /*--- Finalize product and restore the solution. ---*/ + factor = 1.0 / factor; + + for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { + const auto pos = kindSol[iSol]; + const auto nVar = nVars[iSol]; + + solvers[pos]->GetNodes()->Set_Solution(); + + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) { + su2double delta = (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)) / + max(EPS, solvers[pos]->GetNodes()->GetDelta_Time(iPoint)); + + for (auto iVar = 0ul; iVar < nVar; ++iVar) { + Scalar perturbRes = SU2_TYPE::GetValue(solvers[pos]->LinSysRes(iPoint,iVar)); + + /*--- The global residual had its sign flipped, so we add to get the difference. ---*/ + v(iPoint,offset+iVar) = (perturbRes + LinSysRes(iPoint,offset+iVar)) * factor; + + /*--- Pseudotime term of the true Jacobian. ---*/ + v(iPoint,offset+iVar) += SU2_TYPE::GetValue(delta) * u(iPoint,offset+iVar); + } + } + offset += nVar; + } + SU2_OMP_BARRIER +} + +void CNewtonIntegration::BlockJacobiPrecond(const CSysVector& u, CSysVector& v) const { + + for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { + + const auto nVar = nVars[iSol]; + const auto nPoint = geometry->GetnPoint(); + + if (preconditioners[iSol]) { + /*--- Get work vectors with nVar compatible with the preconditioner. ---*/ + auto& uLoc = GetPrecVecIn(iSol); + auto& vLoc = GetPrecVecOut(iSol); + + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < nVar; ++iVar) + uLoc(iPoint, iVar) = u(iPoint, offset+iVar); + + /*--- Apply the preconditioner of this solver. ---*/ + (*preconditioners[iSol])(uLoc, vLoc); + + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < nVar; ++iVar) + v(iPoint, offset+iVar) = vLoc(iPoint, iVar); + } + else { + /*--- Identity. ---*/ + /// TODO: Probably even some type of volume/timestep scaling would be better? + PARALLEL_FOR + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < nVar; ++iVar) + v(iPoint, offset+iVar) = u(iPoint, offset+iVar); + } + + offset += nVar; + } + SU2_OMP_BARRIER +} diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 47a6f2625bb9..6f8ed68ac062 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -102,35 +102,41 @@ void CFluidIteration::Iterate(COutput* output, CIntegration**** integration, CGe integration[val_iZone][val_iInst][FLOW_SOL]->MultiGrid_Iteration(geometry, solver, numerics, config, RUNTIME_FLOW_SYS, val_iZone, val_iInst); - if ((config[val_iZone]->GetKind_Solver() == RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_RANS || - config[val_iZone]->GetKind_Solver() == INC_RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_INC_RANS) && - !frozen_visc) { - /*--- Solve the turbulence model ---*/ + if (!integration[val_iZone][val_iInst][FLOW_SOL]->IsFullyCoupled()) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS); - integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_TURB_SYS, val_iZone, val_iInst); + /*--- If the flow integration is not fully coupled, run the various single grid integrations. ---*/ - /*--- Solve transition model ---*/ + if ((config[val_iZone]->GetKind_Solver() == RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_RANS || + config[val_iZone]->GetKind_Solver() == INC_RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_INC_RANS) && + !frozen_visc) { + /*--- Solve the turbulence model ---*/ - if (config[val_iZone]->GetKind_Trans_Model() == LM) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); - integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_TRANS_SYS, val_iZone, val_iInst); + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS); + integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_TURB_SYS, val_iZone, val_iInst); + + /*--- Solve transition model ---*/ + + if (config[val_iZone]->GetKind_Trans_Model() == LM) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); + integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_TRANS_SYS, val_iZone, val_iInst); + } } - } - if (config[val_iZone]->GetWeakly_Coupled_Heat()) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS); - integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_HEAT_SYS, val_iZone, val_iInst); - } + if (config[val_iZone]->GetWeakly_Coupled_Heat()) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS); + integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_HEAT_SYS, val_iZone, val_iInst); + } + + /*--- Incorporate a weakly-coupled radiation model to the analysis ---*/ + if (config[val_iZone]->AddRadiation()) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_RADIATION_SYS); + integration[val_iZone][val_iInst][RAD_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_RADIATION_SYS, val_iZone, val_iInst); + } - /*--- Incorporate a weakly-coupled radiation model to the analysis ---*/ - if (config[val_iZone]->AddRadiation()) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_RADIATION_SYS); - integration[val_iZone][val_iInst][RAD_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_RADIATION_SYS, val_iZone, val_iInst); } /*--- Adapt the CFL number using an exponential progression with under-relaxation approach. ---*/ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 4f38410b9232..cb3f74b69829 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -3037,7 +3037,7 @@ void CEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver Explicit_Iteration(geometry, solver_container, config, 0); } -void CEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { +void CEulerSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { struct LowMachPrec { const CEulerSolver* solver; @@ -3055,8 +3055,12 @@ void CEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver } precond(this, config->Low_Mach_Preconditioning() || (config->GetKind_Upwind_Flow() == TURKEL), nVar); - ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, true); + PrepareImplicitIteration_impl(precond, geometry, config); +} + +void CEulerSolver::CompleteImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { + CompleteImplicitIteration_impl(geometry, config); } void CEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPoint, diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index da1586ad0f05..345f2e7ce42c 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1618,7 +1618,7 @@ void CIncEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **sol Explicit_Iteration(geometry, solver_container, config, 0); } -void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { +void CIncEulerSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { struct IncPrec { const CIncEulerSolver* solver; @@ -1634,8 +1634,12 @@ void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **sol } precond(this, nVar); - ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, false); + PrepareImplicitIteration_impl(precond, geometry, config); +} + +void CIncEulerSolver::CompleteImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { + CompleteImplicitIteration_impl(geometry, config); } void CIncEulerSolver::SetBeta_Parameter(CGeometry *geometry, CSolver **solver_container, diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 91bfd62f20dc..911c9272e6d5 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1022,14 +1022,19 @@ void CNEMOEulerSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **so Explicit_Iteration(geometry, solver_container, config, 0); } -void CNEMOEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { +void CNEMOEulerSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { struct DummyPrec { const bool active = false; FORCEINLINE su2double** operator() (const CConfig*, unsigned long, su2double) const { return nullptr; } } precond; - ImplicitEuler_Iteration_impl(precond, geometry, solver_container, config, false); + PrepareImplicitIteration_impl(precond, geometry, config); +} + +void CNEMOEulerSolver::CompleteImplicitIteration(CGeometry *geometry, CSolver**, CConfig *config) { + + CompleteImplicitIteration_impl(geometry, config); } void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMesh) { diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index 02a187090671..831f6522da1c 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -73,7 +73,7 @@ CSolver** CSolverFactory::CreateSolverContainer(ENUM_MAIN_SOLVER kindMainSolver, break; case NEMO_EULER: solver[FLOW_SOL] = CreateSubSolver(SUB_SOLVER_TYPE::NEMO_EULER, solver, geometry, config, iMGLevel); - break; + break; case INC_NAVIER_STOKES: solver[FLOW_SOL] = CreateSubSolver(SUB_SOLVER_TYPE::INC_NAVIER_STOKES, solver, geometry, config, iMGLevel); solver[HEAT_SOL] = CreateSubSolver(SUB_SOLVER_TYPE::HEAT, solver, geometry, config, iMGLevel); @@ -197,7 +197,7 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s CSolver *genericSolver = nullptr; ENUM_TURB_MODEL kindTurbModel = static_cast(config->GetKind_Turb_Model()); - + SolverMetaData metaData; metaData.solverType = kindSolver; @@ -240,28 +240,16 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s metaData.integrationType = INTEGRATION_TYPE::DEFAULT; break; case SUB_SOLVER_TYPE::EULER: - genericSolver = CreateFlowSolver(SUB_SOLVER_TYPE::EULER, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; - break; + case SUB_SOLVER_TYPE::INC_EULER: case SUB_SOLVER_TYPE::NEMO_EULER: - genericSolver = CreateNEMOSolver(SUB_SOLVER_TYPE::NEMO_EULER, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; - break; case SUB_SOLVER_TYPE::NAVIER_STOKES: - genericSolver = CreateFlowSolver(SUB_SOLVER_TYPE::NAVIER_STOKES, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; - break; - case SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES: - genericSolver = CreateNEMOSolver(SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; - break; - case SUB_SOLVER_TYPE::INC_EULER: - genericSolver = CreateFlowSolver(SUB_SOLVER_TYPE::INC_EULER, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; - break; case SUB_SOLVER_TYPE::INC_NAVIER_STOKES: - genericSolver = CreateFlowSolver(SUB_SOLVER_TYPE::INC_NAVIER_STOKES, solver, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; + case SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES: + genericSolver = CreateFlowSolver(kindSolver, solver, geometry, config, iMGLevel); + if (!config->GetCoupledNewton() || config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()) + metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; + else + metaData.integrationType = INTEGRATION_TYPE::COUPLED; break; case SUB_SOLVER_TYPE::FEA: genericSolver = new CFEASolver(geometry, config); @@ -272,11 +260,8 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s metaData.integrationType = INTEGRATION_TYPE::NONE; break; case SUB_SOLVER_TYPE::DG_EULER: - genericSolver = CreateDGSolver(SUB_SOLVER_TYPE::DG_EULER, geometry, config, iMGLevel); - metaData.integrationType = INTEGRATION_TYPE::FEM_DG; - break; case SUB_SOLVER_TYPE::DG_NAVIER_STOKES: - genericSolver = CreateDGSolver(SUB_SOLVER_TYPE::DG_NAVIER_STOKES, geometry, config, iMGLevel); + genericSolver = CreateDGSolver(kindSolver, geometry, config, iMGLevel); metaData.integrationType = INTEGRATION_TYPE::FEM_DG; break; case SUB_SOLVER_TYPE::HEAT: @@ -291,7 +276,9 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s genericSolver = new CTransLMSolver(geometry, config, iMGLevel); metaData.integrationType = INTEGRATION_TYPE::SINGLEGRID; break; - case SUB_SOLVER_TYPE::TURB: case SUB_SOLVER_TYPE::TURB_SA: case SUB_SOLVER_TYPE::TURB_SST: + case SUB_SOLVER_TYPE::TURB: + case SUB_SOLVER_TYPE::TURB_SA: + case SUB_SOLVER_TYPE::TURB_SST: genericSolver = CreateTurbSolver(kindTurbModel, solver, geometry, config, iMGLevel, false); metaData.integrationType = INTEGRATION_TYPE::SINGLEGRID; break; @@ -315,7 +302,7 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s SU2_MPI::Error("No proper allocation found for requested sub solver", CURRENT_FUNCTION); break; } - + if (genericSolver != nullptr) allocatedSolvers[genericSolver] = metaData; @@ -460,7 +447,7 @@ CSolver* CSolverFactory::CreateNEMOSolver(SUB_SOLVER_TYPE kindNEMO_Solver, CSolv NEMOSolver->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); break; case SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES: - NEMOSolver = new CNEMONSSolver(geometry, config, iMGLevel); + NEMOSolver = new CNEMONSSolver(geometry, config, iMGLevel); break; default: SU2_MPI::Error("NEMO flow solver not found", CURRENT_FUNCTION); diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index e11eb22fa2d9..27f7ae686a58 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -510,12 +510,9 @@ void CTurbSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_conta } -void CTurbSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - - const bool adjoint = config->GetContinuous_Adjoint() || (config->GetDiscrete_Adjoint() && config->GetFrozen_Visc_Disc()); - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); +void CTurbSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver** solver_container, CConfig *config) { - CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); + const auto flowNodes = solver_container[FLOW_SOL]->GetNodes(); /*--- Set shared residual variables to 0 and declare * local ones for current thread to work on. ---*/ @@ -536,14 +533,20 @@ void CTurbSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ SU2_OMP(for schedule(static,omp_chunk_size) nowait) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - /*--- Read the volume ---*/ + /*--- Modify matrix diagonal to improve diagonal dominance. ---*/ - su2double Vol = (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)); + su2double dt = nodes->GetLocalCFL(iPoint) / flowNodes->GetLocalCFL(iPoint) * flowNodes->GetDelta_Time(iPoint); - /*--- Modify matrix diagonal to assure diagonal dominance ---*/ + nodes->SetDelta_Time(iPoint, dt); - su2double Delta = Vol / ((nodes->GetLocalCFL(iPoint)/flowNodes->GetLocalCFL(iPoint))*flowNodes->GetDelta_Time(iPoint)); - Jacobian.AddVal2Diag(iPoint, Delta); + if (dt != 0.0) { + su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); + Jacobian.AddVal2Diag(iPoint, Vol / dt); + } + else { + Jacobian.SetVal2Diag(iPoint, 1.0); + LinSysRes.SetBlock_Zero(iPoint); + } /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ @@ -566,32 +569,21 @@ void CTurbSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ AddRes_RMS(iVar, resRMS[iVar]); AddRes_Max(iVar, resMax[iVar], geometry->nodes->GetGlobalIndex(idxMax[iVar]), coordMax[iVar]); } + SU2_OMP_BARRIER - /*--- Initialize residual and solution at the ghost points ---*/ - - SU2_OMP(sections) - { - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysRes.SetBlock_Zero(iPoint); - - SU2_OMP(section) - for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) - LinSysSol.SetBlock_Zero(iPoint); - } - - /*--- Solve or smooth the linear system ---*/ - - auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + /*--- Compute the root mean square residual ---*/ SU2_OMP_MASTER - { - SetIterLinSolver(iter); - SetResLinSolver(System.GetResidual()); - } + SetResidual_RMS(geometry, config); SU2_OMP_BARRIER +} + +void CTurbSolver::CompleteImplicitIteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { + + const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); + const auto flowNodes = solver_container[FLOW_SOL]->GetNodes(); - ComputeUnderRelaxationFactor(solver_container, config); + ComputeUnderRelaxationFactor(config); /*--- Update solution (system written in terms of increments) ---*/ @@ -636,19 +628,36 @@ void CTurbSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ CompletePeriodicComms(geometry, config, iPeriodic, PERIODIC_IMPLICIT); } - /*--- MPI solution ---*/ - InitiateComms(geometry, config, SOLUTION_EDDY); CompleteComms(geometry, config, SOLUTION_EDDY); - /*--- Compute the root mean square residual ---*/ - SU2_OMP_MASTER - SetResidual_RMS(geometry, config); +} + +void CTurbSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { + + PrepareImplicitIteration(geometry, solver_container, config); + + /*--- Solve or smooth the linear system. ---*/ + + SU2_OMP(for schedule(static,OMP_MIN_SIZE) nowait) + for (unsigned long iPoint = nPointDomain; iPoint < nPoint; iPoint++) { + LinSysRes.SetBlock_Zero(iPoint); + LinSysSol.SetBlock_Zero(iPoint); + } + + auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config); + + SU2_OMP_MASTER { + SetIterLinSolver(iter); + SetResLinSolver(System.GetResidual()); + } SU2_OMP_BARRIER + CompleteImplicitIteration(geometry, solver_container, config); + } -void CTurbSolver::ComputeUnderRelaxationFactor(CSolver **solver_container, const CConfig *config) { +void CTurbSolver::ComputeUnderRelaxationFactor(const CConfig *config) { /* Only apply the turbulent under-relaxation to the SA variants. The SA_NEG model is more robust due to allowing for negative nu_tilde, From 8732e5d27fe7a2ca07b88dab2b7a769eca0c55bf Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 2 Feb 2021 14:44:04 +0000 Subject: [PATCH 190/326] make turb solvers more efficient for explicit eval, update build systems --- SU2_CFD/obj/Makefile.am | 1 + .../src/integration/CNewtonIntegration.cpp | 30 +++++------ SU2_CFD/src/meson.build | 1 + SU2_CFD/src/solvers/CTurbSASolver.cpp | 50 +++++++++++++------ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 43 +++++++++++----- SU2_CFD/src/solvers/CTurbSolver.cpp | 18 ++++--- 6 files changed, 92 insertions(+), 51 deletions(-) diff --git a/SU2_CFD/obj/Makefile.am b/SU2_CFD/obj/Makefile.am index 063e1fa70cad..b151070ca740 100644 --- a/SU2_CFD/obj/Makefile.am +++ b/SU2_CFD/obj/Makefile.am @@ -59,6 +59,7 @@ libSU2Core_sources = ../src/definition_structure.cpp \ ../src/integration/CIntegration.cpp \ ../src/integration/CSingleGridIntegration.cpp \ ../src/integration/CMultiGridIntegration.cpp \ + ../src/integration/CNewtonIntegration.cpp \ ../src/integration/CStructuralIntegration.cpp \ ../src/integration/CFEM_DG_Integration.cpp \ ../src/integration/CIntegrationFactory.cpp \ diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 58249d98bc1a..e14069de7b94 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -67,6 +67,7 @@ class CBlockJacobiPrecondWrapper final : public CPreconditioner { CNewtonIntegration::CNewtonIntegration() { KindSol2EqSys[FLOW_SOL] = RUNTIME_FLOW_SYS; KindSol2EqSys[TURB_SOL] = RUNTIME_TURB_SYS; +/// TODO: These solvers need Prepare/CompleteImplicitIteration methods. // KindSol2EqSys[HEAT_SOL] = RUNTIME_HEAT_SYS; // KindSol2EqSys[RAD_SOL] = RUNTIME_RADIATION_SYS; } @@ -145,11 +146,14 @@ void CNewtonIntegration::Setup() { void CNewtonIntegration::ComputeResiduals(ResEvalType type) { - /*--- Run all the pre and post processings first, this captures e.g. the - * dependency of the flow residuals on the eddy viscosity. If not done - * this way we get a triangular Jacobian instead of the true one. ---*/ + /*--- Running all the pre and post processings first captures e.g. the + * dependency of the flow residuals on the eddy viscosity. Sounds good + * but the linear solver does not like it. If not done that way we get + * a more triangular Jacobian, i.e. better conditioned. ---*/ - for (int step=0; step<1; ++step) { + constexpr bool reallyCoupled = false; + + for (int step=0; step<1+reallyCoupled; ++step) { for (auto pos : kindSol) { /*--- Set global config parameters for the solver. ---*/ const auto eqSys = KindSol2EqSys[pos]; @@ -167,8 +171,9 @@ void CNewtonIntegration::ComputeResiduals(ResEvalType type) { if (step==0) { solvers[pos]->Preprocessing(geometry, solvers, config, MESH_0, NO_RK_ITER, eqSys, false); -// solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); -// } else { + if (reallyCoupled) solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); + } + if (step>0 || !reallyCoupled) { Space_Integration(geometry, solvers, numerics[pos], config, MESH_0, NO_RK_ITER, eqSys); } @@ -239,7 +244,8 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** SU2_OMP_MASTER { SU2_MPI::Allreduce(&rmsSol, &finDiffStep, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - /// TODO: Customize the step. + /// TODO: Customize the step size (1e-4). + /// TODO: Can we have one step size per variable? Probably not... finDiffStep = 1e-4 * max(1.0, sqrt(finDiffStep / geometry->GetGlobal_nPointDomain())); } SU2_OMP_BARRIER @@ -280,13 +286,7 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** solvers[pos]->CompleteImplicitIteration(geometry, solvers, config); /*--- Call the various post processings to replicate what happens in Single and MG iterations, - * it should not be necessary to run the flow solver preprocessing in output-mode, - * since flow, turbulence, and all scalars are coupled here. ---*/ - - if (pos == FLOW_SOL) { - solvers[pos]->Preprocessing(geometry, solvers, config, MESH_0, - NO_RK_ITER, KindSol2EqSys[pos], true); - } + * it does not seem be important to run the flow solver preprocessing in output-mode. ---*/ solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); @@ -333,7 +333,7 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVect ComputeResiduals(EXPLICIT); - /*--- Finalize product and restore the solution. ---*/ + /*--- Finalize product and restore the old solution. ---*/ factor = 1.0 / factor; for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { diff --git a/SU2_CFD/src/meson.build b/SU2_CFD/src/meson.build index 49c547a4ec34..53de4efdb1df 100644 --- a/SU2_CFD/src/meson.build +++ b/SU2_CFD/src/meson.build @@ -161,6 +161,7 @@ su2_cfd_src += files(['integration/CIntegration.cpp', 'integration/CIntegrationFactory.cpp', 'integration/CSingleGridIntegration.cpp', 'integration/CMultiGridIntegration.cpp', + 'integration/CNewtonIntegration.cpp', 'integration/CStructuralIntegration.cpp', 'integration/CFEM_DG_Integration.cpp']) diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 79966c4ee24c..791a6ea80eb8 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -243,6 +243,7 @@ CTurbSASolver::~CTurbSASolver(void) { void CTurbSASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool muscl = config->GetMUSCL_Turb(); const bool limiter = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetInnerIter() <= config->GetLimiterIter()); @@ -252,7 +253,8 @@ void CTurbSASolver::Preprocessing(CGeometry *geometry, CSolver **solver_containe * reducer strategy as we write over the entire matrix. ---*/ if (!ReducerStrategy) { LinSysRes.SetValZero(); - Jacobian.SetValZero(); + if (implicit) Jacobian.SetValZero(); + else {SU2_OMP_BARRIER} } /*--- Upwind second order reconstruction and gradients ---*/ @@ -338,6 +340,7 @@ void CTurbSASolver::Postprocessing(CGeometry *geometry, CSolver **solver_contain void CTurbSASolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); const bool transition = (config->GetKind_Trans_Model() == LM); const bool transition_BC = (config->GetKind_Trans_Model() == BC); @@ -425,7 +428,7 @@ void CTurbSASolver::Source_Residual(CGeometry *geometry, CSolver **solver_contai LinSysRes.SubtractBlock(iPoint, residual); - Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); } @@ -463,6 +466,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta return; } + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool rough_wall = false; string Marker_Tag = config->GetMarker_All_TagBound(val_marker); unsigned short WallType; su2double Roughness_Height; @@ -489,7 +493,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta /*--- Includes 1 in the diagonal ---*/ - Jacobian.DeleteValsRowi(iPoint); + if (implicit) Jacobian.DeleteValsRowi(iPoint); } else { /*--- For rough walls, the boundary condition is given by * (\frac{\partial \nu}{\partial n})_wall = \frac{\nu}{0.03*k_s} @@ -519,8 +523,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta su2double Jacobian_i = (laminar_viscosity*Area)/(0.03*Roughness_Height*sigma); Jacobian_i += 2.0*RoughWallBC*Area/sigma; - Jacobian_i = -Jacobian_i; - Jacobian.AddVal2Diag(iPoint, Jacobian_i); + if (implicit) Jacobian.AddVal2Diag(iPoint, -Jacobian_i); } } } @@ -536,6 +539,8 @@ void CTurbSASolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_con void CTurbSASolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -578,7 +583,7 @@ void CTurbSASolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container /*--- Add residuals and Jacobians ---*/ LinSysRes.AddBlock(iPoint, residual); - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); } } @@ -588,6 +593,8 @@ void CTurbSASolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -637,7 +644,7 @@ void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CN /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -670,6 +677,8 @@ void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CN void CTurbSASolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -717,7 +726,7 @@ void CTurbSASolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, C /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -750,6 +759,8 @@ void CTurbSASolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, C void CTurbSASolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -799,7 +810,7 @@ void CTurbSASolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_conta /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -833,6 +844,8 @@ void CTurbSASolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_conta void CTurbSASolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -883,7 +896,7 @@ void CTurbSASolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_cont /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -929,6 +942,8 @@ void CTurbSASolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker, bool val_inlet_surface) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -1026,7 +1041,7 @@ void CTurbSASolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -1060,6 +1075,7 @@ void CTurbSASolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, void CTurbSASolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto nSpanWiseSections = config->GetnSpanWiseSections(); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -1116,7 +1132,7 @@ void CTurbSASolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_c /*--- Jacobian contribution for implicit integration ---*/ LinSysRes.AddBlock(iPoint, conv_residual); - Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ @@ -1142,7 +1158,7 @@ void CTurbSASolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_c /*--- Subtract residual, and update Jacobians ---*/ LinSysRes.SubtractBlock(iPoint, visc_residual); - Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); } } @@ -1152,6 +1168,7 @@ void CTurbSASolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_c void CTurbSASolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto nSpanWiseSections = config->GetnSpanWiseSections(); CFluidModel *FluidModel = solver_container[FLOW_SOL]->GetFluidModel(); @@ -1216,7 +1233,7 @@ void CTurbSASolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contain /*--- Jacobian contribution for implicit integration ---*/ LinSysRes.AddBlock(iPoint, conv_residual); - Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ @@ -1243,7 +1260,7 @@ void CTurbSASolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contain /*--- Subtract residual, and update Jacobians ---*/ LinSysRes.SubtractBlock(iPoint, visc_residual); - Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); } } @@ -1579,6 +1596,7 @@ void CTurbSASolver::BC_NearField_Boundary(CGeometry *geometry, CSolver **solver_ void CTurbSASolver::SetNuTilde_WF(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, const CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const su2double Gas_Constant = config->GetGas_ConstantND(); const su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; @@ -1717,7 +1735,7 @@ void CTurbSASolver::SetNuTilde_WF(CGeometry *geometry, CSolver **solver_containe /*--- includes 1 in the diagonal ---*/ - Jacobian.DeleteValsRowi(Point_Normal); + if (implicit) Jacobian.DeleteValsRowi(Point_Normal); } diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index bbf3cb70f9df..bab00d7e641e 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -242,6 +242,7 @@ CTurbSSTSolver::~CTurbSSTSolver(void) { void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool muscl = config->GetMUSCL_Turb(); const bool limiter = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetInnerIter() <= config->GetLimiterIter()); @@ -250,7 +251,8 @@ void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contain * reducer strategy as we write over the entire matrix. ---*/ if (!ReducerStrategy) { LinSysRes.SetValZero(); - Jacobian.SetValZero(); + if (implicit) Jacobian.SetValZero(); + else {SU2_OMP_BARRIER} } /*--- Upwind second order reconstruction and gradients ---*/ @@ -323,6 +325,8 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); /*--- Pick one numerics object per thread. ---*/ @@ -379,7 +383,7 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta /*--- Subtract residual and the Jacobian ---*/ LinSysRes.SubtractBlock(iPoint, residual); - Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); } @@ -391,6 +395,9 @@ void CTurbSSTSolver::Source_Template(CGeometry *geometry, CSolver **solver_conta void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + bool rough_wall = false; string Marker_Tag = config->GetMarker_All_TagBound(val_marker); unsigned short WallType; su2double Roughness_Height; @@ -466,9 +473,11 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont LinSysRes.SetBlock_Zero(iPoint); } - /*--- Change rows of the Jacobian (includes 1 in the diagonal) ---*/ - Jacobian.DeleteValsRowi(iPoint*nVar); - Jacobian.DeleteValsRowi(iPoint*nVar+1); + if (implicit) { + /*--- Change rows of the Jacobian (includes 1 in the diagonal) ---*/ + Jacobian.DeleteValsRowi(iPoint*nVar); + Jacobian.DeleteValsRowi(iPoint*nVar+1); + } } } } @@ -483,6 +492,8 @@ void CTurbSSTSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_co void CTurbSSTSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -528,7 +539,7 @@ void CTurbSSTSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_containe /*--- Add residuals and Jacobians ---*/ LinSysRes.AddBlock(iPoint, residual); - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); } } @@ -537,6 +548,8 @@ void CTurbSSTSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_containe void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -587,7 +600,7 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -625,6 +638,8 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C void CTurbSSTSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_STAT(OMP_MIN_SIZE) @@ -673,7 +688,7 @@ void CTurbSSTSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Jacobian contribution for implicit integration ---*/ - Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // @@ -711,6 +726,8 @@ void CTurbSSTSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, void CTurbSSTSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const auto nSpanWiseSections = config->GetnSpanWiseSections(); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -766,7 +783,7 @@ void CTurbSSTSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_ /*--- Jacobian contribution for implicit integration ---*/ LinSysRes.AddBlock(iPoint, conv_residual); - Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); @@ -787,7 +804,7 @@ void CTurbSSTSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_ /*--- Subtract residual, and update Jacobians ---*/ LinSysRes.SubtractBlock(iPoint, visc_residual); - Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); } } @@ -797,6 +814,8 @@ void CTurbSSTSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_ void CTurbSSTSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const auto nSpanWiseSections = config->GetnSpanWiseSections(); /*--- Quantities for computing the kine and omega to impose at the inlet boundary. ---*/ @@ -870,7 +889,7 @@ void CTurbSSTSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contai /*--- Jacobian contribution for implicit integration ---*/ LinSysRes.AddBlock(iPoint, conv_residual); - Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); + if (implicit) Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), @@ -893,7 +912,7 @@ void CTurbSSTSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contai /*--- Subtract residual, and update Jacobians ---*/ LinSysRes.SubtractBlock(iPoint, visc_residual); - Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); + if (implicit) Jacobian.SubtractBlock2Diag(iPoint, visc_residual.jacobian_i); } } diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index 27f7ae686a58..c2f0151492e5 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -92,6 +92,7 @@ CTurbSolver::~CTurbSolver(void) { void CTurbSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool muscl = config->GetMUSCL_Turb(); const bool limiter = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER); @@ -221,12 +222,12 @@ void CTurbSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_containe if (ReducerStrategy) { EdgeFluxes.SetBlock(iEdge, residual); - Jacobian.SetBlocks(iEdge, residual.jacobian_i, residual.jacobian_j); + if (implicit) Jacobian.SetBlocks(iEdge, residual.jacobian_i, residual.jacobian_j); } else { LinSysRes.AddBlock(iPoint, residual); LinSysRes.SubtractBlock(jPoint, residual); - Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); + if (implicit) Jacobian.UpdateBlocks(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); } /*--- Viscous contribution. ---*/ @@ -238,13 +239,14 @@ void CTurbSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_containe if (ReducerStrategy) { SumEdgeFluxes(geometry); - Jacobian.SetDiagonalAsColumnSum(); + if (implicit) Jacobian.SetDiagonalAsColumnSum(); } } void CTurbSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); /*--- Points in edge ---*/ @@ -286,12 +288,12 @@ void CTurbSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSo if (ReducerStrategy) { EdgeFluxes.SubtractBlock(iEdge, residual); - Jacobian.UpdateBlocksSub(iEdge, residual.jacobian_i, residual.jacobian_j); + if (implicit) Jacobian.UpdateBlocksSub(iEdge, residual.jacobian_i, residual.jacobian_j); } else { LinSysRes.SubtractBlock(iPoint, residual); LinSysRes.AddBlock(jPoint, residual); - Jacobian.UpdateBlocksSub(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); + if (implicit) Jacobian.UpdateBlocksSub(iEdge, iPoint, jPoint, residual.jacobian_i, residual.jacobian_j); } } @@ -533,12 +535,12 @@ void CTurbSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver** solver SU2_OMP(for schedule(static,omp_chunk_size) nowait) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { - /*--- Modify matrix diagonal to improve diagonal dominance. ---*/ - + /// TODO: This could be the SetTime_Step of this solver. su2double dt = nodes->GetLocalCFL(iPoint) / flowNodes->GetLocalCFL(iPoint) * flowNodes->GetDelta_Time(iPoint); - nodes->SetDelta_Time(iPoint, dt); + /*--- Modify matrix diagonal to improve diagonal dominance. ---*/ + if (dt != 0.0) { su2double Vol = geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint); Jacobian.AddVal2Diag(iPoint, Vol / dt); From e4bee8a9fcf72c140d68e408f1adca14256085e5 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 2 Feb 2021 15:11:05 +0000 Subject: [PATCH 191/326] fix solver factory for nemo --- SU2_CFD/include/solvers/CSolverFactory.hpp | 11 ---------- SU2_CFD/src/solvers/CSolverFactory.cpp | 25 +++++----------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/SU2_CFD/include/solvers/CSolverFactory.hpp b/SU2_CFD/include/solvers/CSolverFactory.hpp index 5983a924bc86..25d06b6918dd 100644 --- a/SU2_CFD/include/solvers/CSolverFactory.hpp +++ b/SU2_CFD/include/solvers/CSolverFactory.hpp @@ -144,17 +144,6 @@ class CSolverFactory { */ static CSolver* CreateFlowSolver(SUB_SOLVER_TYPE kindFlowSolver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel); - /*! - * \brief Create a NEMO flow solver - * \param[in] kindNEMOSolver - Kind of flow solver - * \param[in] solver - The solver container - * \param[in] geometry - The geometry definition - * \param[in] config - The configuration - * \param[in] iMGLevel - The multigrid level - * \return - A pointer to the allocated flow solver - */ - static CSolver* CreateNEMOSolver(SUB_SOLVER_TYPE kindNEMOSolver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel); - /*! * \brief Generic routine to create a solver * \param[in] kindSolver - Kind of solver diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index 831f6522da1c..5eb45e3cf136 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -428,32 +428,17 @@ CSolver* CSolverFactory::CreateFlowSolver(SUB_SOLVER_TYPE kindFlowSolver, CSolve case SUB_SOLVER_TYPE::INC_NAVIER_STOKES: flowSolver = new CIncNSSolver(geometry, config, iMGLevel); break; - default: - SU2_MPI::Error("Flow solver not found", CURRENT_FUNCTION); - break; - } - - return flowSolver; - -} - -CSolver* CSolverFactory::CreateNEMOSolver(SUB_SOLVER_TYPE kindNEMO_Solver, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel){ - - CSolver *NEMOSolver = nullptr; - - switch (kindNEMO_Solver) { case SUB_SOLVER_TYPE::NEMO_EULER: - NEMOSolver = new CNEMOEulerSolver(geometry, config, iMGLevel); - NEMOSolver->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); + flowSolver = new CNEMOEulerSolver(geometry, config, iMGLevel); + flowSolver->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); break; case SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES: - NEMOSolver = new CNEMONSSolver(geometry, config, iMGLevel); + flowSolver = new CNEMONSSolver(geometry, config, iMGLevel); break; default: - SU2_MPI::Error("NEMO flow solver not found", CURRENT_FUNCTION); + SU2_MPI::Error("Flow solver not found", CURRENT_FUNCTION); break; } - return NEMOSolver; - + return flowSolver; } From 14b7897da3a02f79f00da6df696eedf98c713ab3 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 2 Feb 2021 16:10:21 +0000 Subject: [PATCH 192/326] fix mesh deformation using LinSysReact --- SU2_CFD/src/solvers/CFEASolver.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index d387456a902c..2da1f032a668 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -1612,7 +1612,7 @@ void CFEASolver::BC_Clamped(CGeometry *geometry, CNumerics *numerics, const CCon nodes->SetBound_Disp(iPoint, zeros); LinSysSol.SetBlock(iPoint, zeros); - LinSysReact.SetBlock(iPoint, zeros); + if (LinSysReact.GetLocSize() > 0) LinSysReact.SetBlock(iPoint, zeros); Jacobian.EnforceSolutionAtNode(iPoint, zeros, LinSysRes); } @@ -1692,9 +1692,7 @@ void CFEASolver::BC_Sym_Plane(CGeometry *geometry, CNumerics *numerics, const CC /*--- Set and enforce 0 solution for mesh deformation ---*/ nodes->SetBound_Disp(iPoint, axis, 0.0); LinSysSol(iPoint, axis) = 0.0; - if (LinSysReact.GetLocSize() > 0){ - LinSysReact(iPoint, axis) = 0.0; - } + if (LinSysReact.GetLocSize() > 0) LinSysReact(iPoint, axis) = 0.0; Jacobian.EnforceSolutionAtDOF(iPoint, axis, su2double(0.0), LinSysRes); } From fca654441819f2d73852f2a5106f63b0a9879c42 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 3 Feb 2021 11:26:12 +0000 Subject: [PATCH 193/326] update comments --- SU2_CFD/src/solvers/CFEASolver.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index d387456a902c..70f6badef80f 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2580,7 +2580,7 @@ void CFEASolver::PredictStruct_Displacement(CGeometry *geometry, CConfig *config if(predOrder > 2 && rank == MASTER_NODE) cout << "Higher order predictor not implemented. Solving with order 0." << endl; - /*--- To nPointDomain: we need to communicate the predicted solution after setting it. ---*/ + /*--- To nPoint to avoid communication. ---*/ SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) for (unsigned long iPoint=0; iPoint < nPoint; iPoint++) { @@ -2662,7 +2662,6 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, CConfig *config, } else { - // To nPointDomain; we need to communicate the values for (iPoint = 0; iPoint < nPointDomain; iPoint++) { dispPred = nodes->GetSolution_Pred(iPoint); @@ -2714,7 +2713,7 @@ void CFEASolver::SetAitken_Relaxation(CGeometry *geometry, CConfig *config) { const su2double WAitken = GetWAitken_Dyn(); - // To nPointDomain; we need to communicate the solutions (predicted, old and old predicted) after this routine + /*--- To nPoint to avoid communication. ---*/ SU2_OMP_PARALLEL_(for schedule(static,omp_chunk_size)) for (unsigned long iPoint=0; iPoint < nPoint; iPoint++) { @@ -2814,10 +2813,12 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ unsigned long TimeIter = config->GetTimeIter(); su2double objective_function = 0.0; + unsigned long nSurfPoints = 0; SU2_OMP_PARALLEL { su2double obj_fun_local = 0.0; + unsigned long nSurf_local = 0; if (!config->GetRefGeomSurf()) { SU2_OMP_FOR_STAT(omp_chunk_size) @@ -2834,6 +2835,8 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ for (unsigned long iVertex = 0; iVertex < geometry->GetnVertex(iMarker); ++iVertex) { auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + nSurf_local += geometry->nodes->GetDomain(iPoint); + if (geometry->nodes->GetDomain(iPoint)) obj_fun_local += SquaredDistance(nVar, nodes->GetReference_Geometry(iPoint), nodes->GetSolution(iPoint)); } @@ -2841,12 +2844,16 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ } } atomicAdd(obj_fun_local, objective_function); + atomicAdd(nSurf_local, nSurfPoints); } - SU2_MPI::Allreduce(&objective_function, &Total_OFRefGeom, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - Total_OFRefGeom *= config->GetRefGeom_Penalty() / geometry->GetGlobal_nPointDomain(); - Total_OFRefGeom += PenaltyValue; + unsigned long nPointsOF = geometry->GetGlobal_nPointDomain() + if (config->GetRefGeomSurf()) { + SU2_MPI::Allreduce(&nSurfPoints, &nPointsOF, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + } + Total_OFRefGeom *= config->GetRefGeom_Penalty() / nPointsOF; + Total_OFRefGeom += PenaltyValue; Global_OFRefGeom += Total_OFRefGeom; /// TODO: Temporary output files for the direct mode. From 578d84293bb65c85d8eacba8f1b2216ab9ad4189 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 3 Feb 2021 14:48:35 +0000 Subject: [PATCH 194/326] some MG cleanup cus why not --- .../src/integration/CMultiGridIntegration.cpp | 24 +++++-------------- SU2_CFD/src/solvers/CFEASolver.cpp | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 7a4588e3c8c7..88d0c9b68672 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -303,7 +303,7 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, void CMultiGridIntegration::GetProlongated_Correction(unsigned short RunTime_EqSystem, CSolver *sol_fine, CSolver *sol_coarse, CGeometry *geo_fine, CGeometry *geo_coarse, CConfig *config) { unsigned long Point_Fine, Point_Coarse, iVertex; - unsigned short Boundary, iMarker, iChildren, iVar; + unsigned short iMarker, iChildren, iVar; su2double Area_Parent, Area_Children; const su2double *Solution_Fine = nullptr, *Solution_Coarse = nullptr; @@ -340,10 +340,7 @@ void CMultiGridIntegration::GetProlongated_Correction(unsigned short RunTime_EqS /*--- Remove any contributions from no-slip walls. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - Boundary = config->GetMarker_All_KindBC(iMarker); - if ((Boundary == HEAT_FLUX) || - (Boundary == ISOTHERMAL) || - (Boundary == CHT_WALL_INTERFACE)) { + if (config->GetViscous_Wall(iMarker)) { SU2_OMP_FOR_STAT(32) for (iVertex = 0; iVertex < geo_coarse->nVertex[iMarker]; iVertex++) { @@ -364,8 +361,6 @@ void CMultiGridIntegration::GetProlongated_Correction(unsigned short RunTime_EqS sol_coarse->InitiateComms(geo_coarse, config, SOLUTION_OLD); sol_coarse->CompleteComms(geo_coarse, config, SOLUTION_OLD); - /// TODO: Need to check for possible race condition here (multiple coarse points setting the same fine). - SU2_OMP_FOR_STAT(roundUpDiv(geo_coarse->GetnPointDomain(), omp_get_num_threads())) for (Point_Coarse = 0; Point_Coarse < geo_coarse->GetnPointDomain(); Point_Coarse++) { for (iChildren = 0; iChildren < geo_coarse->nodes->GetnChildren_CV(Point_Coarse); iChildren++) { @@ -453,7 +448,7 @@ void CMultiGridIntegration::SetProlongated_Correction(CSolver *sol_fine, CGeomet su2double *Solution_Fine, *Residual_Fine; const unsigned short nVar = sol_fine->GetnVar(); - const su2double factor = config->GetDamp_Correc_Prolong(); //pow(config->GetDamp_Correc_Prolong(), iMesh+1); + const su2double factor = config->GetDamp_Correc_Prolong(); SU2_OMP_FOR_STAT(roundUpDiv(geo_fine->GetnPointDomain(), omp_get_num_threads())) for (Point_Fine = 0; Point_Fine < geo_fine->GetnPointDomain(); Point_Fine++) { @@ -479,8 +474,6 @@ void CMultiGridIntegration::SetProlongated_Solution(unsigned short RunTime_EqSys unsigned long Point_Fine, Point_Coarse; unsigned short iChildren; - /// TODO: Need to check for possible race condition here (multiple coarse points setting the same fine). - SU2_OMP_FOR_STAT(roundUpDiv(geo_coarse->GetnPointDomain(), omp_get_num_threads())) for (Point_Coarse = 0; Point_Coarse < geo_coarse->GetnPointDomain(); Point_Coarse++) { for (iChildren = 0; iChildren < geo_coarse->nodes->GetnChildren_CV(Point_Coarse); iChildren++) { @@ -498,7 +491,7 @@ void CMultiGridIntegration::SetForcing_Term(CSolver *sol_fine, CSolver *sol_coar const su2double *Residual_Fine; const unsigned short nVar = sol_coarse->GetnVar(); - su2double factor = config->GetDamp_Res_Restric(); //pow(config->GetDamp_Res_Restric(), iMesh); + su2double factor = config->GetDamp_Res_Restric(); su2double *Residual = new su2double[nVar]; @@ -521,10 +514,7 @@ void CMultiGridIntegration::SetForcing_Term(CSolver *sol_fine, CSolver *sol_coar delete [] Residual; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) || - (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) || - (config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE)) { - + if (config->GetViscous_Wall(iMarker)) { SU2_OMP_FOR_STAT(32) for (iVertex = 0; iVertex < geo_coarse->nVertex[iMarker]; iVertex++) { Point_Coarse = geo_coarse->vertex[iMarker][iVertex]->GetNode(); @@ -591,9 +581,7 @@ void CMultiGridIntegration::SetRestricted_Solution(unsigned short RunTime_EqSyst /*--- Update the solution at the no-slip walls ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) || - (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) || - (config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE)) { + if (config->GetViscous_Wall(iMarker)) { SU2_OMP_FOR_STAT(32) for (iVertex = 0; iVertex < geo_coarse->nVertex[iMarker]; iVertex++) { diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 70f6badef80f..43260511073c 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2848,7 +2848,7 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, const CConfig *config){ } SU2_MPI::Allreduce(&objective_function, &Total_OFRefGeom, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - unsigned long nPointsOF = geometry->GetGlobal_nPointDomain() + unsigned long nPointsOF = geometry->GetGlobal_nPointDomain(); if (config->GetRefGeomSurf()) { SU2_MPI::Allreduce(&nSurfPoints, &nPointsOF, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); } From e4d88633f6e419cf1c9613c03caaedb39ddcc3b8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 3 Feb 2021 21:46:11 +0100 Subject: [PATCH 195/326] Get rid of MPI_COMM_WORLD leftovers. Changed in #1080 --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index ab7afdd201e9..d757d26050e0 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7548,7 +7548,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, - Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, MPI_COMM_WORLD); + Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, SU2_MPI::GetComm()); /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 1dba65006ac5..cc7db6a92157 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2927,10 +2927,10 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow su2double Area_Global(0), Average_Density_Global(0), MassFlow_Global(0), Temperature_Global(0); - SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); // Set quantity by stringtag @@ -3030,7 +3030,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry } // loop AllMarker // Mpi Communication sum up integrated Heatflux from all processes - SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Set the Integrated Heatflux ---*/ if (iMesh == MESH_0) From bd6f64488c484e5f6fc1953db6dc88b6795b0eab Mon Sep 17 00:00:00 2001 From: emanresu Date: Thu, 4 Feb 2021 19:01:07 +0100 Subject: [PATCH 196/326] new function inside existing sst source term class (no new class since never needed alone) --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 6 ++++++ SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index ed2e03a2e5af..02acd628a6c6 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -320,12 +320,18 @@ class CSourcePieceWise_TurbSST final : public CNumerics { bool incompressible; bool sustaining_terms; + bool axisymmetric; /*! * \brief A virtual member. Get strain magnitude based on perturbed reynolds stress matrix * \param[in] turb_ke: turbulent kinetic energy of the node */ void SetPerturbedStrainMag(su2double turb_ke); + + /*! + * \brief Add contribution due to axisymmetric formulation to 2D residual + */ + void ResidualAxisymmetric(); public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 9164ffb9edbc..683f806859c6 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -761,6 +761,7 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); + axisymmetric = (config->GetAxisymmetric() == YES); /*--- Closure constants ---*/ beta_star = constants[6]; @@ -898,6 +899,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = -2.0*beta_blended*TurbVar_i[1]*Volume; } + + /*--- Contribution due to 2D axisymmetric formulation ---*/ + + if (axisymmetric) ResidualAxisymmetric(); AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -922,3 +927,9 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ PerturbedStrainMag = sqrt(2.0*PerturbedStrainMag); } + +void CSourcePieceWise_TurbSST::ResidualAxisymmetric(){ + + //TODO Axisym source terms + +} \ No newline at end of file From 5a838b9210de9039defc3ad01918dd7b2e2a3761 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 4 Feb 2021 23:40:17 +0000 Subject: [PATCH 197/326] no more coupling, too hard on linear solver --- Common/include/CConfig.hpp | 6 +- Common/include/linear_algebra/CSysMatrix.hpp | 15 +- Common/src/CConfig.cpp | 6 +- Common/src/linear_algebra/CSysMatrix.cpp | 46 +-- SU2_CFD/include/integration/CIntegration.hpp | 5 - .../integration/CNewtonIntegration.hpp | 84 ++-- SU2_CFD/include/solvers/CSolverFactory.hpp | 2 +- .../src/integration/CIntegrationFactory.cpp | 2 +- .../src/integration/CNewtonIntegration.cpp | 391 ++++++------------ SU2_CFD/src/iteration/CFluidIteration.cpp | 52 ++- SU2_CFD/src/solvers/CSolver.cpp | 4 +- SU2_CFD/src/solvers/CSolverFactory.cpp | 4 +- 12 files changed, 250 insertions(+), 367 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index be22ae418141..66c09600f075 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -416,7 +416,7 @@ class CConfig { unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */ bool UseVectorization; /*!< \brief Whether to use vectorized numerics schemes. */ - bool CoupledNewton; /*!< \brief Use a coupled Newton method to solve the equations. */ + bool NewtonKrylov; /*!< \brief Use a coupled Newton method to solve the equations. */ unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */ unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */ @@ -3972,9 +3972,9 @@ class CConfig { bool GetUseVectorization(void) const { return UseVectorization; } /*! - * \brief Get whether to use a coupled Newton method. + * \brief Get whether to use a Newton-Krylov method. */ - bool GetCoupledNewton(void) const { return CoupledNewton; } + bool GetNewtonKrylov(void) const { return NewtonKrylov; } /*! * \brief Get the relaxation coefficient of the linear solver for the implicit formulation. diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index abf394ae8997..1abe24da0c34 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -163,9 +163,11 @@ class CSysMatrix { /*! * \brief Handle type conversion for when we Set, Add, etc. blocks, preserving derivative information (if supported by types). - * \note See specialization for discrete adjoint right outside this class's declaration. */ - template + template::value> = 0> + FORCEINLINE static DstType ActiveAssign(const SrcType& val) { return SU2_TYPE::GetValue(val); } + + template::value> = 0> FORCEINLINE static DstType ActiveAssign(const SrcType& val) { return val; } /*! @@ -918,12 +920,3 @@ class CSysMatrix { CGeometry *geometry, const CConfig *config) const; }; - -#ifdef CODI_REVERSE_TYPE -template<> template<> -FORCEINLINE su2mixedfloat CSysMatrix::ActiveAssign(const su2double& val) { return SU2_TYPE::GetValue(val); } -#ifdef USE_MIXED_PRECISION -template<> template<> -FORCEINLINE passivedouble CSysMatrix::ActiveAssign(const su2double& val) { return SU2_TYPE::GetValue(val); } -#endif -#endif diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 714af89d5efe..b262655b8a8d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1572,8 +1572,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Offset parameter for the buffet sensor */ addDoubleOption("BUFFET_LAMBDA", Buffet_lambda, 0.0); - /* DESCRIPTION: Use a coupled Newton method. */ - addBoolOption("COUPLED_NEWTON_METHOD", CoupledNewton, false); + /* DESCRIPTION: Use a Newton-Krylov method. */ + addBoolOption("NEWTON_KRYLOV", NewtonKrylov, false); /* DESCRIPTION: Number of samples for quasi-Newton methods. */ addUnsignedShortOption("QUASI_NEWTON_NUM_SAMPLES", nQuasiNewtonSamples, 0); /* DESCRIPTION: Whether to use vectorized numerical schemes, less robust against transients. */ @@ -4358,7 +4358,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Fixed_CM_Mode) Update_HTPIncidence = false; if (DirectDiff != NO_DERIVATIVE) { -#if !defined COMPLEX_TYPE && !defined ADOLC_FORWARD_TYPE && !defined CODI_FORWARD_TYPE +#ifndef CODI_FORWARD_TYPE if (Kind_SU2 == SU2_CFD) { SU2_MPI::Error(string("SU2_CFD: Config option DIRECT_DIFF= YES requires AD or complex support!\n") + string("Please use SU2_CFD_DIRECTDIFF (configuration/compilation is done using the preconfigure.py script)."), diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index a4e1130c86e0..2457aa2623b5 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -443,7 +443,7 @@ void CSysMatrix::CompleteComms(CSysVector & x, /*--- Store the data correctly depending on the quantity. ---*/ for (iVar = 0; iVar < nVar; iVar++) - x(iPoint,iVar) = ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint,iVar) = ActiveAssign(bufDRecv[buf_offset+iVar]); } break; @@ -482,7 +482,7 @@ void CSysMatrix::CompleteComms(CSysVector & x, /*--- Update receiving point. ---*/ for (iVar = 0; iVar < nEqn; iVar++) - x(iPoint,iVar) += ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint,iVar) += ActiveAssign(bufDRecv[buf_offset+iVar]); } break; @@ -1398,33 +1398,33 @@ void CSysMatrix::ComputePastixPreconditioner(const CSysVector::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const;\ +template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; + +#define INSTANTIATE_MATRIX(TYPE)\ +template class CSysMatrix;\ +INSTANTIATE_COMMS(TYPE, TYPE)\ +template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&);\ +template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); + /*--- Explicit instantiations ---*/ #ifdef CODI_FORWARD_TYPE /*--- In forward AD only the active type is used. ---*/ -template class CSysMatrix; -template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); -template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); +INSTANTIATE_MATRIX(su2double) #else -/*--- Base and reverse AD, matrix is passive (either float or double). ---*/ -template class CSysMatrix; -template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); -template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); +/*--- Base and reverse AD, matrix is passive. ---*/ +INSTANTIATE_MATRIX(su2mixedfloat) +/*--- If using mixed precision (float) instantiate also a version for doubles, and allow cross communication. ---*/ #ifdef USE_MIXED_PRECISION -template class CSysMatrix; -template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); -template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); -/*--- In reverse AD (or mixed precision) the passive matrix is also used to communicate active (or double) vectors resp.. ---*/ -template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +INSTANTIATE_MATRIX(passivedouble) +INSTANTIATE_COMMS(su2mixedfloat,passivedouble) #endif +/*--- Allow more cross-comms for reverse AD. ---*/ #ifdef CODI_REVERSE_TYPE -template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const; -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +INSTANTIATE_COMMS(su2mixedfloat,su2double) +#ifdef USE_MIXED_PRECISION +INSTANTIATE_COMMS(passivedouble,su2double) +#endif #endif #endif // CODI_FORWARD_TYPE diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 96acf5f6ed00..1dd61720162d 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -87,11 +87,6 @@ class CIntegration { */ virtual ~CIntegration(void) = default; - /*! - * \brief Return true if the integration already considers all solvers. - */ - inline virtual bool IsFullyCoupled(void) const { return false; } - /*! * \brief Get the indicator of the convergence for the direct, adjoint and linearized problem. * \return TRUE means that the convergence criteria is satisfied; diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index 14fcc8f1cbd5..35b66dff077a 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -1,6 +1,6 @@ /*! * \file CNewtonIntegration.hpp - * \brief Coupled Newton integration. + * \brief Newton-Krylov integration. * \author P. Gomes * \version 7.1.0 "Blackbird" * @@ -26,11 +26,13 @@ */ #include "CIntegration.hpp" +#include "../../../Common/include/parallelization/omp_structure.hpp" +#include "../../../Common/include/linear_algebra/CPreconditioner.hpp" #include "../../../Common/include/linear_algebra/CSysSolve.hpp" /*! * \class CNewtonIntegration - * \brief Class for time integration using a coupled Newton method, based + * \brief Class for time integration using a Newton-Krylov method, based * on matrix-free products with the true Jacobian via finite differences. */ class CNewtonIntegration final : public CIntegration { @@ -49,54 +51,73 @@ class CNewtonIntegration final : public CIntegration { /*--- Residual evaluation modes, explicit for products, default to allow preconditioners to be built. ---*/ enum ResEvalType {EXPLICIT, DEFAULT}; - bool thread_safe; /*!< \brief If all target solvers support OpenMP. */ + bool setup = false; + Scalar finDiffStep = 0.0; /*!< \brief Based on RMS(solution), used in matrix-free products. */ unsigned long omp_chunk_size; /*!< \brief Chunk size used in light point loops. */ - unsigned short KindFlowSol = 0; - unsigned short KindSol2EqSys[MAX_SOLS] = {0}; /*!< \brief Deduce runtime equations from solver position. */ - - Scalar finDiffStep = 0.0; /*!< \brief Based on RMS(solution), used in matrix-free products. */ - CConfig* config = nullptr; CSolver** solvers = nullptr; CGeometry* geometry = nullptr; CNumerics*** numerics = nullptr; - std::vector kindSol; /*!< \brief Positions of the target solvers. */ - std::vector nVars; /*!< \brief Number of variables for each target solver. */ - - /*--- Residual, solution, and linear solver for the coupled problem. ---*/ + /*--- Residual and linear solver. ---*/ CSysVector LinSysRes; - CSysVector LinSysSol; CSysSolve LinSolver; + /*--- If possible the solution vector of the solver is re-used, otherwise this temporary is used. ---*/ + CSysVector LinSysSol; + + template::value> = 0> + inline CSysVector& GetSolutionVec(CSysVector& x) { return x; } + + template::value> = 0> + inline void SetSolutionResult(CSysVector&) const { } + + template::value> = 0> + inline CSysVector& GetSolutionVec(CSysVector& x) { + LinSysSol = Scalar(0.0); + return LinSysSol; + } + + template::value> = 0> + inline void SetSolutionResult(CSysVector& x) const { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i = 0ul; i < x.GetLocSize(); ++i) x[i] = LinSysSol[i]; + } + /*--- Preconditioner objects for each active solver. ---*/ - std::vector*> preconditioners; + CPreconditioner* preconditioner = nullptr; - /*--- If mixed precision is used these temporaries are - * used to interface with the preconditioners. ---*/ - mutable std::vector > precondIn, precondOut; + /*--- If mixed precision is used, these temporaries are used to interface with the preconditioner. ---*/ + mutable CSysVector precondIn, precondOut; template::value> = 0> - inline CSysVector& GetPrecVecIn(size_t i) const { return precondIn[i]; } + inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i = 0ul; i < u.GetLocSize(); ++i) precondIn[i] = u[i]; - template::value> = 0> - inline CSysVector& GetPrecVecOut(size_t i) const { return precondOut[i]; } + (*preconditioner)(precondIn, precondOut); - /*--- Otherwise we borrow the memory of the solvers. ---*/ - template::value> = 0> - inline CSysVector& GetPrecVecIn(size_t i) const { return solvers[kindSol[i]]->LinSysRes; } + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i = 0ul; i < u.GetLocSize(); ++i) v[i] = precondOut[i]; + } + /*--- Otherwise they are not needed. ---*/ template::value> = 0> - inline CSysVector& GetPrecVecOut(size_t i) const { return solvers[kindSol[i]]->LinSysSol; } + inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { (*preconditioner)(u, v); } /*! - * \brief List target solvers, gather their info, etc.. + * \brief Gather solver info, etc.. */ void Setup(); /*! - * \brief Evaluate the nonlinear residual of target solvers, which should be capable of alternating + * \brief Increment the solution, x := x+mag*dir. + */ + void PerturbSolution(const CSysVector& direction, Scalar magnitude); + + /*! + * \brief Evaluate the nonlinear residual of the solver, which should be capable of alternating * between implicit and explicit iterations to save time during matrix-free products. */ void ComputeResiduals(ResEvalType type); @@ -105,18 +126,13 @@ class CNewtonIntegration final : public CIntegration { /*! * \brief Constructor. */ - CNewtonIntegration(); + CNewtonIntegration() = default; /*! * \brief Destructor. */ ~CNewtonIntegration(); - /*! - * \brief Return true if the integration already considers all solvers. - */ - inline bool IsFullyCoupled(void) const override { return true; } - /*! * \brief This class overrides this method to make it a drop-in replacement for CMultigridIntegration. * \param[in] geometry - Geometrical definition of the problem. @@ -137,8 +153,8 @@ class CNewtonIntegration final : public CIntegration { void MatrixFreeProduct(const CSysVector& u, CSysVector& v); /*! - * \brief Implementation of the block-Jacobi preconditioner. + * \brief Wrapper for the preconditioner. */ - void BlockJacobiPrecond(const CSysVector& u, CSysVector& v) const; + void Preconditioner(const CSysVector& u, CSysVector& v) const; }; diff --git a/SU2_CFD/include/solvers/CSolverFactory.hpp b/SU2_CFD/include/solvers/CSolverFactory.hpp index 25d06b6918dd..6fa7ec0cfa84 100644 --- a/SU2_CFD/include/solvers/CSolverFactory.hpp +++ b/SU2_CFD/include/solvers/CSolverFactory.hpp @@ -66,7 +66,7 @@ enum class SUB_SOLVER_TYPE { enum class INTEGRATION_TYPE{ MULTIGRID, - COUPLED, + NEWTON, SINGLEGRID, DEFAULT, FEM_DG, diff --git a/SU2_CFD/src/integration/CIntegrationFactory.cpp b/SU2_CFD/src/integration/CIntegrationFactory.cpp index 3233417454fc..cb4a57554cb3 100644 --- a/SU2_CFD/src/integration/CIntegrationFactory.cpp +++ b/SU2_CFD/src/integration/CIntegrationFactory.cpp @@ -61,7 +61,7 @@ CIntegration* CIntegrationFactory::CreateIntegration(INTEGRATION_TYPE integratio case INTEGRATION_TYPE::MULTIGRID: integration = new CMultiGridIntegration(); break; - case INTEGRATION_TYPE::COUPLED: + case INTEGRATION_TYPE::NEWTON: integration = new CNewtonIntegration(); break; case INTEGRATION_TYPE::STRUCTURAL: diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index e14069de7b94..c86c28f75f54 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -1,6 +1,6 @@ /*! * \file CNewtonIntegration.cpp - * \brief Coupled Newton integration. + * \brief Newton-Krylov integration. * \author P. Gomes * \version 7.1.0 "Blackbird" * @@ -26,12 +26,7 @@ */ #include "../../include/integration/CNewtonIntegration.hpp" -#include "../../../Common/include/parallelization/omp_structure.hpp" -#include "../../../Common/include/linear_algebra/CPreconditioner.hpp" #include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp" -#include "../../../Common/include/linear_algebra/CSysSolve.hpp" - -#define PARALLEL_FOR SU2_OMP(for schedule(static,omp_chunk_size) nowait) using Scalar = CNewtonIntegration::Scalar; @@ -50,141 +45,98 @@ class CMatrixFreeProductWrapper final : public CMatrixVectorProduct { } }; -class CBlockJacobiPrecondWrapper final : public CPreconditioner { +class CPreconditionerWrapper final : public CPreconditioner { const CNewtonIntegration* integration; public: - CBlockJacobiPrecondWrapper(const CNewtonIntegration* i) : integration(i) {} + CPreconditionerWrapper(const CNewtonIntegration* i) : integration(i) {} /*! * \brief Operator for the preconditioning operation. */ inline void operator()(const CSysVector& u, CSysVector& v) const override { - integration->BlockJacobiPrecond(u, v); + integration->Preconditioner(u, v); } }; } -CNewtonIntegration::CNewtonIntegration() { - KindSol2EqSys[FLOW_SOL] = RUNTIME_FLOW_SYS; - KindSol2EqSys[TURB_SOL] = RUNTIME_TURB_SYS; -/// TODO: These solvers need Prepare/CompleteImplicitIteration methods. -// KindSol2EqSys[HEAT_SOL] = RUNTIME_HEAT_SYS; -// KindSol2EqSys[RAD_SOL] = RUNTIME_RADIATION_SYS; -} - -CNewtonIntegration::~CNewtonIntegration() { - for (auto p : preconditioners) delete p; -} +CNewtonIntegration::~CNewtonIntegration() { delete preconditioner; } void CNewtonIntegration::Setup() { - if (!kindSol.empty()) return; - - KindFlowSol = EULER; - if (config->GetViscous()) KindFlowSol = NAVIER_STOKES; - if (solvers[TURB_SOL]) KindFlowSol = RANS; - + const auto nVar = solvers[FLOW_SOL]->GetnVar(); const auto nPoint = geometry->GetnPoint(); const auto nPointDomain = geometry->GetnPointDomain(); - unsigned long nVarTot = 0; - thread_safe = true; omp_chunk_size = computeStaticChunkSize(nPoint, omp_get_max_threads(), 512); - for (auto iSol = 0u; iSol < MAX_SOLS; ++iSol) { - if (solvers[iSol] && iSol != MESH_SOL && iSol != ADJMESH_SOL) { - - if (KindSol2EqSys[iSol] == 0) - SU2_MPI::Error("Some of the solvers do not support the coupled Newton method.", CURRENT_FUNCTION); - - auto nVar = solvers[iSol]->GetnVar(); - kindSol.push_back(iSol); - nVars.push_back(nVar); - nVarTot += nVar; - - thread_safe &= solvers[iSol]->GetHasHybridParallel(); - - preconditioners.push_back(nullptr); - precondIn.push_back(CSysVector()); - precondOut.push_back(CSysVector()); - - /*--- Check if the solver is able to provide a linear preconditioner. ---*/ - if (config->GetKind_TimeIntScheme() != EULER_IMPLICIT) continue; - - auto& p = preconditioners.back(); - - switch (config->GetKind_Linear_Solver_Prec()) { - case JACOBI: - p = new CJacobiPreconditioner(solvers[iSol]->Jacobian, geometry, config, false); - break; - case LINELET: - p = new CLineletPreconditioner(solvers[iSol]->Jacobian, geometry, config); - break; - case LU_SGS: - p = new CLU_SGSPreconditioner(solvers[iSol]->Jacobian, geometry, config); - break; - case ILU: - p = new CILUPreconditioner(solvers[iSol]->Jacobian, geometry, config, false); - break; - case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: - p = new CPastixPreconditioner(solvers[iSol]->Jacobian, geometry, config, - config->GetKind_Linear_Solver_Prec(), false); - break; - } - - if (!std::is_same::value) { - precondIn.back().Initialize(nPoint, nPointDomain, nVar, nullptr); - precondOut.back().Initialize(nPoint, nPointDomain, nVar, nullptr); - } + /*--- Check if the solver is able to provide a linear preconditioner. ---*/ + if (config->GetKind_TimeIntScheme() == EULER_IMPLICIT) { + + auto& p = preconditioner; + + switch (config->GetKind_Linear_Solver_Prec()) { + case JACOBI: + p = new CJacobiPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); + break; + case LINELET: + p = new CLineletPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); + break; + case LU_SGS: + p = new CLU_SGSPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); + break; + case ILU: + p = new CILUPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); + break; + case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: + p = new CPastixPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, + config->GetKind_Linear_Solver_Prec(), false); + break; + } + + if (!std::is_same::value) { + precondIn.Initialize(nPoint, nPointDomain, nVar, nullptr); + precondOut.Initialize(nPoint, nPointDomain, nVar, nullptr); } } - LinSysRes.Initialize(nPoint, nPointDomain, nVarTot, nullptr); - LinSysSol.Initialize(nPoint, nPointDomain, nVarTot, nullptr); + LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); + + if (!std::is_same::value) { + LinSysSol.Initialize(nPoint, nPointDomain, nVar, nullptr); + } +} + +void CNewtonIntegration::PerturbSolution(const CSysVector& dir, Scalar mag) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) { + SU2_OMP_SIMD + for (auto iVar = 0ul; iVar < solvers[FLOW_SOL]->GetnVar(); ++iVar) + solvers[FLOW_SOL]->GetNodes()->AddSolution(iPoint,iVar, mag*dir(iPoint,iVar)); + } } void CNewtonIntegration::ComputeResiduals(ResEvalType type) { - /*--- Running all the pre and post processings first captures e.g. the - * dependency of the flow residuals on the eddy viscosity. Sounds good - * but the linear solver does not like it. If not done that way we get - * a more triangular Jacobian, i.e. better conditioned. ---*/ - - constexpr bool reallyCoupled = false; - - for (int step=0; step<1+reallyCoupled; ++step) { - for (auto pos : kindSol) { - /*--- Set global config parameters for the solver. ---*/ - const auto eqSys = KindSol2EqSys[pos]; - SU2_OMP_MASTER - config->SetGlobalParam(KindFlowSol, eqSys); - SU2_OMP_BARRIER - - /*--- Save the default integration scheme, and force to explicit if required. ---*/ - auto TimeIntScheme = config->GetKind_TimeIntScheme(); - if (type == EXPLICIT) { - SU2_OMP_MASTER - config->SetKind_TimeIntScheme(EULER_EXPLICIT); - SU2_OMP_BARRIER - } - - if (step==0) { - solvers[pos]->Preprocessing(geometry, solvers, config, MESH_0, NO_RK_ITER, eqSys, false); - if (reallyCoupled) solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); - } - if (step>0 || !reallyCoupled) { - Space_Integration(geometry, solvers, numerics[pos], config, MESH_0, NO_RK_ITER, eqSys); - } - - /*--- Restore default. ---*/ - if (type == EXPLICIT) { - SU2_OMP_MASTER - config->SetKind_TimeIntScheme(TimeIntScheme); - SU2_OMP_BARRIER - } - } + /*--- Save the default integration scheme, and force to explicit if required. ---*/ + auto TimeIntScheme = config->GetKind_TimeIntScheme(); + if (type == EXPLICIT) { + SU2_OMP_MASTER + config->SetKind_TimeIntScheme(EULER_EXPLICIT); + SU2_OMP_BARRIER + } + + solvers[FLOW_SOL]->Preprocessing(geometry, solvers, config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, false); + + Space_Integration(geometry, solvers, numerics[FLOW_SOL], config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS); + + /*--- Restore default. ---*/ + if (type == EXPLICIT) { + SU2_OMP_MASTER + config->SetKind_TimeIntScheme(TimeIntScheme); + SU2_OMP_BARRIER } + } void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver *****solvers_, CNumerics ******numerics_, @@ -195,115 +147,85 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** geometry = geometry_[iZone][iInst][MESH_0]; numerics = numerics_[iZone][iInst][MESH_0]; - Setup(); + if (!setup) { Setup(); setup = true; } /*--- The step for finite-difference-based matrix-free product depends on the RMS of the solution. ---*/ su2double rmsSol = 0.0; - SU2_OMP_PARALLEL_(if(thread_safe)) { + SU2_OMP_PARALLEL_(if(solvers[FLOW_SOL]->GetHasHybridParallel())) { - /*--- Compute the current residual and the approximate Jacobians for preconditioning. ---*/ + /*--- Compute the current residual and the approximate Jacobian for preconditioning. ---*/ ComputeResiduals(DEFAULT); - for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { - const auto pos = kindSol[iSol]; - const auto nVar = nVars[iSol]; + solvers[FLOW_SOL]->SetTime_Step(geometry, solvers, config, MESH_0, config->GetTimeIter()); - const auto eqSys = KindSol2EqSys[pos]; - SU2_OMP_MASTER - config->SetGlobalParam(KindFlowSol, eqSys); - SU2_OMP_BARRIER + solvers[FLOW_SOL]->PrepareImplicitIteration(geometry, solvers, config); - solvers[pos]->SetTime_Step(geometry, solvers, config, MESH_0, config->GetTimeIter()); + if (preconditioner) preconditioner->Build(); - solvers[pos]->PrepareImplicitIteration(geometry, solvers, config); + /*--- Save current residuals and the solution to be able to perturb it. ---*/ - /*--- Save current solution to be able to perturb it. ---*/ - solvers[pos]->GetNodes()->Set_OldSolution(); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i = 0ul; i < LinSysRes.GetNElmDomain(); ++i) + LinSysRes[i] = SU2_TYPE::GetValue(solvers[FLOW_SOL]->LinSysRes[i]); - /*--- Aggregate residuals. ---*/ - su2double rmsSol_loc = 0.0; + solvers[FLOW_SOL]->Set_OldSolution(); - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) { - for (auto iVar = 0ul; iVar < nVar; ++iVar) { - rmsSol_loc += pow(solvers[pos]->GetNodes()->GetSolution(iPoint,iVar), 2); - LinSysRes(iPoint, offset+iVar) = SU2_TYPE::GetValue(solvers[pos]->LinSysRes(iPoint, iVar)); - } - } - atomicAdd(rmsSol_loc, rmsSol); + /*--- Compute RMS(solution). ---*/ - offset += nVar; + su2double rmsSol_loc = 0.0; - /*--- Build preconditioner. ---*/ - if (preconditioners[iSol]) preconditioners[iSol]->Build(); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) + for (auto iVar = 0ul; iVar < solvers[FLOW_SOL]->GetnVar(); ++iVar) + rmsSol_loc += pow(solvers[FLOW_SOL]->GetNodes()->GetSolution(iPoint,iVar), 2); - } - SU2_OMP_BARRIER + atomicAdd(rmsSol_loc, rmsSol); + SU2_OMP_BARRIER SU2_OMP_MASTER { - SU2_MPI::Allreduce(&rmsSol, &finDiffStep, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + su2double t = rmsSol; + SU2_MPI::Allreduce(&t, &rmsSol, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); /// TODO: Customize the step size (1e-4). - /// TODO: Can we have one step size per variable? Probably not... - finDiffStep = 1e-4 * max(1.0, sqrt(finDiffStep / geometry->GetGlobal_nPointDomain())); + finDiffStep = 1e-4 * max(1.0, sqrt(SU2_TYPE::GetValue(rmsSol) / geometry->GetGlobal_nPointDomain())); } SU2_OMP_BARRIER - /*--- Solve for the search direction. ---*/ + /*--- Solve for the solution update. ---*/ CMatrixFreeProductWrapper product(this); - CBlockJacobiPrecondWrapper precond(this); + CPreconditionerWrapper precond(this); + auto& linSysSol = GetSolutionVec(solvers[FLOW_SOL]->LinSysSol); - LinSysSol = Scalar(0.0); - - auto iter = config->GetLinear_Solver_Iter(); - Scalar tol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); Scalar eps = 0.0; - auto nIter = LinSolver.FGMRES_LinSolver(LinSysRes, LinSysSol, product, precond, + Scalar tol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + auto iter = config->GetLinear_Solver_Iter(); + + auto nIter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, product, precond, tol, iter, eps, false, config, true); - SU2_OMP_MASTER - for (auto pos : kindSol) { - solvers[pos]->SetIterLinSolver(nIter); - solvers[pos]->SetResLinSolver(eps); + SU2_OMP_MASTER { + solvers[FLOW_SOL]->SetIterLinSolver(nIter); + solvers[FLOW_SOL]->SetResLinSolver(eps); } - SU2_OMP_BARRIER - - /*--- Update solution. ---*/ - /* For now we let each solver handle the search direction, using its own form of under-relaxation - * to then adapt the CFL. However we should also check global descent, and use a back-tracking - * strategy that informs the CFL adaptation to increase/decrease/freeze. */ + SetSolutionResult(solvers[FLOW_SOL]->LinSysSol); - for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { - const auto pos = kindSol[iSol]; - const auto nVar = nVars[iSol]; + /// TODO: Clever back-tracking and CFL adaptation based on residual reduction. - SU2_OMP_FOR_STAT(omp_chunk_size) - for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) - for (auto iVar = 0ul; iVar < nVar; ++iVar) - solvers[pos]->LinSysSol(iPoint,iVar) = LinSysSol(iPoint,offset+iVar); + /*--- Update solution. ---*/ - solvers[pos]->CompleteImplicitIteration(geometry, solvers, config); + solvers[FLOW_SOL]->CompleteImplicitIteration(geometry, solvers, config); - /*--- Call the various post processings to replicate what happens in Single and MG iterations, - * it does not seem be important to run the flow solver preprocessing in output-mode. ---*/ + /*--- Call the various post processings. ---*/ - solvers[pos]->Postprocessing(geometry, solvers, config, MESH_0); + solvers[FLOW_SOL]->Preprocessing(geometry, solvers, config, MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, true); - SU2_OMP_MASTER - switch (KindSol2EqSys[pos]) { - case RUNTIME_FLOW_SYS: - solvers[pos]->Pressure_Forces(geometry, config); - solvers[pos]->Momentum_Forces(geometry, config); - solvers[pos]->Friction_Forces(geometry, config); - break; - case RUNTIME_HEAT_SYS: - solvers[pos]->Heat_Fluxes(geometry, solvers, config); - break; - } - SU2_OMP_BARRIER + solvers[FLOW_SOL]->Postprocessing(geometry, solvers, config, MESH_0); - offset += nVar; + SU2_OMP_MASTER { + solvers[FLOW_SOL]->Pressure_Forces(geometry, config); + solvers[FLOW_SOL]->Momentum_Forces(geometry, config); + solvers[FLOW_SOL]->Friction_Forces(geometry, config); } } // end SU2_OMP_PARALLEL @@ -311,92 +233,53 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVector& v) { - /*--- Perturb the solution. ---*/ Scalar factor = finDiffStep / u.norm(); - for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { - const auto pos = kindSol[iSol]; - const auto nVar = nVars[iSol]; - - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) - for (auto iVar = 0ul; iVar < nVar; ++iVar) - solvers[pos]->GetNodes()->Add_DeltaSolution(iPoint,iVar, u(iPoint,offset+iVar)*factor); - - offset += nVar; - } - SU2_OMP_BARRIER - - - /*--- Compute residuals after perturbation. ---*/ + PerturbSolution(u, factor); ComputeResiduals(EXPLICIT); - - /*--- Finalize product and restore the old solution. ---*/ + /*--- Finalize product. ---*/ factor = 1.0 / factor; - for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { - const auto pos = kindSol[iSol]; - const auto nVar = nVars[iSol]; - - solvers[pos]->GetNodes()->Set_Solution(); - - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) { - su2double delta = (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)) / - max(EPS, solvers[pos]->GetNodes()->GetDelta_Time(iPoint)); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) { + su2double delta = (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)) / + max(EPS, solvers[FLOW_SOL]->GetNodes()->GetDelta_Time(iPoint)); - for (auto iVar = 0ul; iVar < nVar; ++iVar) { - Scalar perturbRes = SU2_TYPE::GetValue(solvers[pos]->LinSysRes(iPoint,iVar)); + for (auto iVar = 0ul; iVar < LinSysRes.GetNVar(); ++iVar) { + Scalar perturbRes = SU2_TYPE::GetValue(solvers[FLOW_SOL]->LinSysRes(iPoint,iVar)); - /*--- The global residual had its sign flipped, so we add to get the difference. ---*/ - v(iPoint,offset+iVar) = (perturbRes + LinSysRes(iPoint,offset+iVar)) * factor; + /*--- The global residual had its sign flipped, so we add to get the difference. ---*/ + v(iPoint,iVar) = (perturbRes + LinSysRes(iPoint,iVar)) * factor; - /*--- Pseudotime term of the true Jacobian. ---*/ - v(iPoint,offset+iVar) += SU2_TYPE::GetValue(delta) * u(iPoint,offset+iVar); - } + /*--- Pseudotime term of the true Jacobian. ---*/ + v(iPoint,iVar) += SU2_TYPE::GetValue(delta) * u(iPoint,iVar); } - offset += nVar; } - SU2_OMP_BARRIER -} - -void CNewtonIntegration::BlockJacobiPrecond(const CSysVector& u, CSysVector& v) const { - for (unsigned long iSol = 0, offset = 0; iSol < kindSol.size(); ++iSol) { - - const auto nVar = nVars[iSol]; - const auto nPoint = geometry->GetnPoint(); + solvers[FLOW_SOL]->Jacobian.InitiateComms(v, geometry, config, SOLUTION_MATRIX); + solvers[FLOW_SOL]->Jacobian.CompleteComms(v, geometry, config, SOLUTION_MATRIX); +} - if (preconditioners[iSol]) { - /*--- Get work vectors with nVar compatible with the preconditioner. ---*/ - auto& uLoc = GetPrecVecIn(iSol); - auto& vLoc = GetPrecVecOut(iSol); +void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector& v) const { - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) - for (auto iVar = 0ul; iVar < nVar; ++iVar) - uLoc(iPoint, iVar) = u(iPoint, offset+iVar); + if (preconditioner) { + Preconditioner_impl(u, v); + } + else { + /*--- Approximate diagonal preconditioner. ---*/ - /*--- Apply the preconditioner of this solver. ---*/ - (*preconditioners[iSol])(uLoc, vLoc); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) { + su2double delta = solvers[FLOW_SOL]->GetNodes()->GetDelta_Time(iPoint) / + (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)); - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) - for (auto iVar = 0ul; iVar < nVar; ++iVar) - v(iPoint, offset+iVar) = vLoc(iPoint, iVar); - } - else { - /*--- Identity. ---*/ - /// TODO: Probably even some type of volume/timestep scaling would be better? - PARALLEL_FOR - for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) - for (auto iVar = 0ul; iVar < nVar; ++iVar) - v(iPoint, offset+iVar) = u(iPoint, offset+iVar); + for (auto iVar = 0ul; iVar < u.GetNVar(); ++iVar) + v(iPoint,iVar) = u(iPoint,iVar) * delta; } - offset += nVar; + solvers[FLOW_SOL]->Jacobian.InitiateComms(v, geometry, config, SOLUTION_MATRIX); + solvers[FLOW_SOL]->Jacobian.CompleteComms(v, geometry, config, SOLUTION_MATRIX); } - SU2_OMP_BARRIER } diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 6f8ed68ac062..6cb89422a112 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -102,41 +102,37 @@ void CFluidIteration::Iterate(COutput* output, CIntegration**** integration, CGe integration[val_iZone][val_iInst][FLOW_SOL]->MultiGrid_Iteration(geometry, solver, numerics, config, RUNTIME_FLOW_SYS, val_iZone, val_iInst); - if (!integration[val_iZone][val_iInst][FLOW_SOL]->IsFullyCoupled()) { + /*--- If the flow integration is not fully coupled, run the various single grid integrations. ---*/ - /*--- If the flow integration is not fully coupled, run the various single grid integrations. ---*/ + if ((config[val_iZone]->GetKind_Solver() == RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_RANS || + config[val_iZone]->GetKind_Solver() == INC_RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_INC_RANS) && + !frozen_visc) { + /*--- Solve the turbulence model ---*/ - if ((config[val_iZone]->GetKind_Solver() == RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_RANS || - config[val_iZone]->GetKind_Solver() == INC_RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_INC_RANS) && - !frozen_visc) { - /*--- Solve the turbulence model ---*/ + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS); + integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_TURB_SYS, val_iZone, val_iInst); - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS); - integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_TURB_SYS, val_iZone, val_iInst); + /*--- Solve transition model ---*/ - /*--- Solve transition model ---*/ - - if (config[val_iZone]->GetKind_Trans_Model() == LM) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); - integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_TRANS_SYS, val_iZone, val_iInst); - } - } - - if (config[val_iZone]->GetWeakly_Coupled_Heat()) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS); - integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_HEAT_SYS, val_iZone, val_iInst); + if (config[val_iZone]->GetKind_Trans_Model() == LM) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); + integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_TRANS_SYS, val_iZone, val_iInst); } + } - /*--- Incorporate a weakly-coupled radiation model to the analysis ---*/ - if (config[val_iZone]->AddRadiation()) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_RADIATION_SYS); - integration[val_iZone][val_iInst][RAD_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, - RUNTIME_RADIATION_SYS, val_iZone, val_iInst); - } + if (config[val_iZone]->GetWeakly_Coupled_Heat()) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS); + integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_HEAT_SYS, val_iZone, val_iInst); + } + /*--- Incorporate a weakly-coupled radiation model to the analysis ---*/ + if (config[val_iZone]->AddRadiation()) { + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_RADIATION_SYS); + integration[val_iZone][val_iInst][RAD_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, + RUNTIME_RADIATION_SYS, val_iZone, val_iInst); } /*--- Adapt the CFL number using an exponential progression with under-relaxation approach. ---*/ diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 6cf7acd5a498..c68981277d7b 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2034,7 +2034,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, { /* Only the master thread updates the shared variables. */ /* Check if we should decrease or if we can increase, the 20% is to avoid flip-flopping. */ - resetCFL = linRes > 1.0; + resetCFL = linRes > 0.99; reduceCFL = linRes > 1.2*linTol; canIncrease = linRes < linTol; @@ -2080,7 +2080,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, signChanges += (prev > 0) ^ (val > 0); prev = val; } - reduceCFL |= (signChanges > Res_Count/4) && (totalChange > -0.5); + reduceCFL |= (signChanges > Res_Count/4) && (totalChange > -0.5) && !config->GetNewtonKrylov(); if (totalChange > 2.0) { // orders of magnitude resetCFL = true; diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index 5eb45e3cf136..affbca70ed5b 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -246,10 +246,10 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s case SUB_SOLVER_TYPE::INC_NAVIER_STOKES: case SUB_SOLVER_TYPE::NEMO_NAVIER_STOKES: genericSolver = CreateFlowSolver(kindSolver, solver, geometry, config, iMGLevel); - if (!config->GetCoupledNewton() || config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()) + if (!config->GetNewtonKrylov() || config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()) metaData.integrationType = INTEGRATION_TYPE::MULTIGRID; else - metaData.integrationType = INTEGRATION_TYPE::COUPLED; + metaData.integrationType = INTEGRATION_TYPE::NEWTON; break; case SUB_SOLVER_TYPE::FEA: genericSolver = new CFEASolver(geometry, config); From 681b3b481681cc4fac0ad10d233df8307a66f481 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 4 Feb 2021 23:44:09 +0000 Subject: [PATCH 198/326] avoid mpi comm world --- SU2_CFD/src/integration/CNewtonIntegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index c86c28f75f54..2f758e1c5a5d 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -186,7 +186,7 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** SU2_OMP_BARRIER SU2_OMP_MASTER { su2double t = rmsSol; - SU2_MPI::Allreduce(&t, &rmsSol, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&t, &rmsSol, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /// TODO: Customize the step size (1e-4). finDiffStep = 1e-4 * max(1.0, sqrt(SU2_TYPE::GetValue(rmsSol) / geometry->GetGlobal_nPointDomain())); } From 3720dfa615f13ccc0b38b41d779d26555fda7221 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 5 Feb 2021 12:44:40 +0000 Subject: [PATCH 199/326] add simd to some loops --- .../integration/CNewtonIntegration.hpp | 21 ++++-- .../src/integration/CNewtonIntegration.cpp | 67 +++++++++---------- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index 35b66dff077a..b760225ed0fc 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -30,6 +30,16 @@ #include "../../../Common/include/linear_algebra/CPreconditioner.hpp" #include "../../../Common/include/linear_algebra/CSysSolve.hpp" +#ifdef HAVE_OMP +#ifdef HAVE_OMP_SIMD +#define CNEWTON_PARFOR SU2_OMP(for simd schedule(static,omp_chunk_size) nowait) +#else +#define CNEWTON_PARFOR SU2_OMP(for schedule(static,omp_chunk_size) nowait) +#endif +#else +#define CNEWTON_PARFOR SU2_OMP_SIMD +#endif + /*! * \class CNewtonIntegration * \brief Class for time integration using a Newton-Krylov method, based @@ -74,14 +84,14 @@ class CNewtonIntegration final : public CIntegration { inline void SetSolutionResult(CSysVector&) const { } template::value> = 0> - inline CSysVector& GetSolutionVec(CSysVector& x) { + inline CSysVector& GetSolutionVec(CSysVector&) { LinSysSol = Scalar(0.0); return LinSysSol; } template::value> = 0> inline void SetSolutionResult(CSysVector& x) const { - SU2_OMP_FOR_STAT(omp_chunk_size) + CNEWTON_PARFOR for (auto i = 0ul; i < x.GetLocSize(); ++i) x[i] = LinSysSol[i]; } @@ -93,13 +103,14 @@ class CNewtonIntegration final : public CIntegration { template::value> = 0> inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { - SU2_OMP_FOR_STAT(omp_chunk_size) + CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) precondIn[i] = u[i]; (*preconditioner)(precondIn, precondOut); - SU2_OMP_FOR_STAT(omp_chunk_size) + CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) v[i] = precondOut[i]; + SU2_OMP_BARRIER } /*--- Otherwise they are not needed. ---*/ @@ -158,3 +169,5 @@ class CNewtonIntegration final : public CIntegration { void Preconditioner(const CSysVector& u, CSysVector& v) const; }; + +#undef CNEWTON_PARFOR diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 2f758e1c5a5d..6035d785a82a 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -67,43 +67,40 @@ void CNewtonIntegration::Setup() { const auto nPoint = geometry->GetnPoint(); const auto nPointDomain = geometry->GetnPointDomain(); - omp_chunk_size = computeStaticChunkSize(nPoint, omp_get_max_threads(), 512); - - /*--- Check if the solver is able to provide a linear preconditioner. ---*/ - if (config->GetKind_TimeIntScheme() == EULER_IMPLICIT) { - - auto& p = preconditioner; - - switch (config->GetKind_Linear_Solver_Prec()) { - case JACOBI: - p = new CJacobiPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); - break; - case LINELET: - p = new CLineletPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); - break; - case LU_SGS: - p = new CLU_SGSPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); - break; - case ILU: - p = new CILUPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); - break; - case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: - p = new CPastixPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, - config->GetKind_Linear_Solver_Prec(), false); - break; - } - - if (!std::is_same::value) { - precondIn.Initialize(nPoint, nPointDomain, nVar, nullptr); - precondOut.Initialize(nPoint, nPointDomain, nVar, nullptr); - } - } + omp_chunk_size = computeStaticChunkSize(nPoint, omp_get_max_threads(), 1024); LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); if (!std::is_same::value) { LinSysSol.Initialize(nPoint, nPointDomain, nVar, nullptr); } + + /*--- Check if the solver is able to provide a linear preconditioner. ---*/ + if (config->GetKind_TimeIntScheme() != EULER_IMPLICIT) return; + + switch (config->GetKind_Linear_Solver_Prec()) { + case JACOBI: + preconditioner = new CJacobiPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); + break; + case LINELET: + preconditioner = new CLineletPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); + break; + case LU_SGS: + preconditioner = new CLU_SGSPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config); + break; + case ILU: + preconditioner = new CILUPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, false); + break; + case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: + preconditioner = new CPastixPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, + config->GetKind_Linear_Solver_Prec(), false); + break; + } + + if (!std::is_same::value) { + precondIn.Initialize(nPoint, nPointDomain, nVar, nullptr); + precondOut.Initialize(nPoint, nPointDomain, nVar, nullptr); + } } void CNewtonIntegration::PerturbSolution(const CSysVector& dir, Scalar mag) { @@ -204,11 +201,13 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** auto nIter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, product, precond, tol, iter, eps, false, config, true); + SetSolutionResult(solvers[FLOW_SOL]->LinSysSol); + SU2_OMP_MASTER { solvers[FLOW_SOL]->SetIterLinSolver(nIter); solvers[FLOW_SOL]->SetResLinSolver(eps); } - SetSolutionResult(solvers[FLOW_SOL]->LinSysSol); + SU2_OMP_BARRIER /// TODO: Clever back-tracking and CFL adaptation based on residual reduction. @@ -246,7 +245,7 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVect for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) { su2double delta = (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)) / max(EPS, solvers[FLOW_SOL]->GetNodes()->GetDelta_Time(iPoint)); - + SU2_OMP_SIMD for (auto iVar = 0ul; iVar < LinSysRes.GetNVar(); ++iVar) { Scalar perturbRes = SU2_TYPE::GetValue(solvers[FLOW_SOL]->LinSysRes(iPoint,iVar)); @@ -274,7 +273,7 @@ void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector< for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) { su2double delta = solvers[FLOW_SOL]->GetNodes()->GetDelta_Time(iPoint) / (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)); - + SU2_OMP_SIMD for (auto iVar = 0ul; iVar < u.GetNVar(); ++iVar) v(iPoint,iVar) = u(iPoint,iVar) * delta; } From be5ed7a204dcfae2ee2ca990b4d8318d60e0c94a Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Fri, 5 Feb 2021 14:21:30 +0100 Subject: [PATCH 200/326] implement function to compute residual --- .../numerics/turbulent/turb_sources.hpp | 5 +- .../src/numerics/turbulent/turb_sources.cpp | 194 ++++++++++-------- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 7 + 3 files changed, 123 insertions(+), 83 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 02acd628a6c6..0518c2af796f 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -305,6 +305,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { alfa_2, beta_1, beta_2, + sigma_k_1, + sigma_k_2, sigma_omega_1, sigma_omega_2, beta_star, @@ -320,6 +322,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { bool incompressible; bool sustaining_terms; + bool implicit; bool axisymmetric; /*! @@ -331,7 +334,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*! * \brief Add contribution due to axisymmetric formulation to 2D residual */ - void ResidualAxisymmetric(); + void ResidualAxisymmetric(su2double beta_blended); public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 683f806859c6..cc388deb79f4 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -761,10 +761,13 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); - axisymmetric = (config->GetAxisymmetric() == YES); + implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + axisymmetric = config->GetAxisymmetric(); /*--- Closure constants ---*/ beta_star = constants[6]; + sigma_k_1 = constants[0]; + sigma_k_1 = constants[1]; sigma_omega_1 = constants[2]; sigma_omega_2 = constants[3]; beta_1 = constants[4]; @@ -777,9 +780,11 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, kAmb = val_kine_Inf; omegaAmb = val_omega_Inf; - /*--- "Allocate" the Jacobian using the static buffer. ---*/ - Jacobian_i[0] = Jacobian_Buffer; - Jacobian_i[1] = Jacobian_Buffer+2; + if (implicit) { + /*--- "Allocate" the Jacobian using the static buffer. ---*/ + Jacobian_i[0] = Jacobian_Buffer; + Jacobian_i[1] = Jacobian_Buffer+2; + } } @@ -817,92 +822,96 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi } Residual[0] = 0.0; Residual[1] = 0.0; - Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; - Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = 0.0; - + + if (implicit) { + Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; + Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = 0.0; + } + /*--- Computation of blended constants for the source terms---*/ alfa_blended = F1_i*alfa_1 + (1.0 - F1_i)*alfa_2; beta_blended = F1_i*beta_1 + (1.0 - F1_i)*beta_2; if (dist_i > 1e-10) { - - /*--- Production ---*/ - - diverg = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - diverg += PrimVar_Grad_i[iDim+1][iDim]; - - /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ - - if (using_uq){ - ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, - PrimVar_Grad_i+1, Density_i, Eddy_Viscosity_i, - TurbVar_i[0], MeanPerturbedRSM); - SetPerturbedStrainMag(TurbVar_i[0]); - pk = Eddy_Viscosity_i*PerturbedStrainMag*PerturbedStrainMag - - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; - } - else { - pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; - } - - - pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); - pk = max(pk,0.0); - - zeta = max(TurbVar_i[1], VorticityMag*F2_i/a1); - - /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ - - if (using_uq){ - pw = PerturbedStrainMag * PerturbedStrainMag - 2.0/3.0*zeta*diverg; - } - else { - pw = StrainMag_i*StrainMag_i - 2.0/3.0*zeta*diverg; - } - pw = alfa_blended*Density_i*max(pw,0.0); - - /*--- Sustaining terms, if desired. Note that if the production terms are - larger equal than the sustaining terms, the original formulation is - obtained again. This is in contrast to the version in literature - where the sustaining terms are simply added. This latter approach could - lead to problems for very big values of the free-stream turbulence - intensity. ---*/ - - if ( sustaining_terms ) { - const su2double sust_k = beta_star*Density_i*kAmb*omegaAmb; - const su2double sust_w = beta_blended*Density_i*omegaAmb*omegaAmb; - - pk = max(pk, sust_k); - pw = max(pw, sust_w); - } - - /*--- Add the production terms to the residuals. ---*/ - - Residual[0] += pk*Volume; - Residual[1] += pw*Volume; - - /*--- Dissipation ---*/ - - Residual[0] -= beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]*Volume; - Residual[1] -= beta_blended*Density_i*TurbVar_i[1]*TurbVar_i[1]*Volume; - - /*--- Cross diffusion ---*/ - - Residual[1] += (1.0 - F1_i)*CDkw_i*Volume; - - /*--- Implicit part ---*/ - - Jacobian_i[0][0] = -beta_star*TurbVar_i[1]*Volume; - Jacobian_i[0][1] = -beta_star*TurbVar_i[0]*Volume; - Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0*beta_blended*TurbVar_i[1]*Volume; + + /*--- Production ---*/ + + diverg = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + diverg += PrimVar_Grad_i[iDim+1][iDim]; + + /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ + + if (using_uq){ + ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, + PrimVar_Grad_i+1, Density_i, Eddy_Viscosity_i, + TurbVar_i[0], MeanPerturbedRSM); + SetPerturbedStrainMag(TurbVar_i[0]); + pk = Eddy_Viscosity_i*PerturbedStrainMag*PerturbedStrainMag + - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + } + else { + pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + } + + pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); + pk = max(pk,0.0); + + zeta = max(TurbVar_i[1], VorticityMag*F2_i/a1); + + /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ + + if (using_uq){ + pw = PerturbedStrainMag * PerturbedStrainMag - 2.0/3.0*zeta*diverg; + } + else { + pw = StrainMag_i*StrainMag_i - 2.0/3.0*zeta*diverg; + } + pw = alfa_blended*Density_i*max(pw,0.0); + + /*--- Sustaining terms, if desired. Note that if the production terms are + larger equal than the sustaining terms, the original formulation is + obtained again. This is in contrast to the version in literature + where the sustaining terms are simply added. This latter approach could + lead to problems for very big values of the free-stream turbulence + intensity. ---*/ + + if ( sustaining_terms ) { + const su2double sust_k = beta_star*Density_i*kAmb*omegaAmb; + const su2double sust_w = beta_blended*Density_i*omegaAmb*omegaAmb; + + pk = max(pk, sust_k); + pw = max(pw, sust_w); + } + + /*--- Add the production terms to the residuals. ---*/ + + Residual[0] += pk*Volume; + Residual[1] += pw*Volume; + + /*--- Dissipation ---*/ + + Residual[0] -= beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]*Volume; + Residual[1] -= beta_blended*Density_i*TurbVar_i[1]*TurbVar_i[1]*Volume; + + /*--- Cross diffusion ---*/ + + Residual[1] += (1.0 - F1_i)*CDkw_i*Volume; + + /*--- Implicit part ---*/ + + if (implicit) { + Jacobian_i[0][0] = -beta_star*TurbVar_i[1]*Volume; + Jacobian_i[0][1] = -beta_star*TurbVar_i[0]*Volume; + Jacobian_i[1][0] = 0.0; + Jacobian_i[1][1] = -2.0*beta_blended*TurbVar_i[1]*Volume; + } } /*--- Contribution due to 2D axisymmetric formulation ---*/ - if (axisymmetric) ResidualAxisymmetric(); + if (axisymmetric) ResidualAxisymmetric(beta_blended); AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -928,8 +937,29 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } -void CSourcePieceWise_TurbSST::ResidualAxisymmetric(){ +void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double beta_blended){ + + if (Coord_i[1] > EPS) { + + su2double yinv = 1.0/Coord_i[1]; + + /*--- Residual Convection ---*/ + Residual[0] -= yinv*Volume*beta_star*V_i[1]*Density_i*TurbVar_i[0]; + Residual[1] -= yinv*Volume*beta_blended*V_i[1]*Density_i*TurbVar_i[1]; - //TODO Axisym source terms + if (implicit) { + Jacobian_i[0][0] -= yinv*Volume*V_i[1]; + Jacobian_i[1][1] -= yinv*Volume*V_i[1]; + } + + /*--- Compute the blended constant for the viscous terms ---*/ + su2double sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; + su2double sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; + + /*--- Residual Diffusion ---*/ + Residual[0] += yinv*Volume*(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + Residual[1] += yinv*Volume*(Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + + } } \ No newline at end of file diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index bbf3cb70f9df..c3c6c7376d90 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -322,6 +322,8 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { + + bool axisymmetric = config->GetAxisymmetric(); CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); @@ -372,6 +374,11 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta numerics->SetCrossDiff(nodes->GetCrossDiff(iPoint),0.0); + if (axisymmetric){ + /*--- Set y coordinate ---*/ + numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(iPoint)); + } + /*--- Compute the source term ---*/ auto residual = numerics->ComputeResidual(config); From 0c9ca5c1c568589ab655930ef685e44ccfe91357 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 5 Feb 2021 16:05:34 +0000 Subject: [PATCH 201/326] fix AD build --- SU2_CFD/src/integration/CNewtonIntegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 6035d785a82a..53ded032c155 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -275,7 +275,7 @@ void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector< (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint)); SU2_OMP_SIMD for (auto iVar = 0ul; iVar < u.GetNVar(); ++iVar) - v(iPoint,iVar) = u(iPoint,iVar) * delta; + v(iPoint,iVar) = SU2_TYPE::GetValue(delta) * u(iPoint,iVar); } solvers[FLOW_SOL]->Jacobian.InitiateComms(v, geometry, config, SOLUTION_MATRIX); From 85526e8174401def11741fdd15073046faa6596f Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 09:22:35 +0000 Subject: [PATCH 202/326] strong linear preconditioner --- SU2_CFD/include/integration/CNewtonIntegration.hpp | 10 +++++++++- SU2_CFD/src/integration/CNewtonIntegration.cpp | 9 ++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index b760225ed0fc..503f2fceeed7 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -28,6 +28,7 @@ #include "CIntegration.hpp" #include "../../../Common/include/parallelization/omp_structure.hpp" #include "../../../Common/include/linear_algebra/CPreconditioner.hpp" +#include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp" #include "../../../Common/include/linear_algebra/CSysSolve.hpp" #ifdef HAVE_OMP @@ -106,8 +107,15 @@ class CNewtonIntegration final : public CIntegration { CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) precondIn[i] = u[i]; - (*preconditioner)(precondIn, precondOut); +// (*preconditioner)(precondIn, precondOut); + MixedScalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + auto iter = config->GetLinear_Solver_Iter(); + auto product = CSysMatrixVectorProduct(solvers[FLOW_SOL]->Jacobian, geometry, config); + + precondOut = MixedScalar(0.0); + solvers[FLOW_SOL]->System.FGMRES_LinSolver(precondIn, precondOut, product, *preconditioner, + eps, iter, eps, false, config, true); CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) v[i] = precondOut[i]; SU2_OMP_BARRIER diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 53ded032c155..e48ec9f4ab01 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -195,16 +195,15 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** CPreconditionerWrapper precond(this); auto& linSysSol = GetSolutionVec(solvers[FLOW_SOL]->LinSysSol); - Scalar eps = 0.0; - Scalar tol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + Scalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); auto iter = config->GetLinear_Solver_Iter(); - auto nIter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, product, precond, - tol, iter, eps, false, config, true); + iter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, product, precond, eps, iter, eps, false, config, true); + SetSolutionResult(solvers[FLOW_SOL]->LinSysSol); SU2_OMP_MASTER { - solvers[FLOW_SOL]->SetIterLinSolver(nIter); + solvers[FLOW_SOL]->SetIterLinSolver(iter); solvers[FLOW_SOL]->SetResLinSolver(eps); } SU2_OMP_BARRIER From d59f009e0732ab57fb3daef415cef8ec76fc26da Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 09:43:45 +0000 Subject: [PATCH 203/326] small issue in stress computation --- SU2_CFD/src/solvers/CFEASolver.cpp | 6 ++++-- meson_scripts/init.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index ae3ed706b1ce..c54b3bb9706d 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -1192,7 +1192,8 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, const bool prestretch_fem = config->GetPrestretch(); const bool topology_mode = config->GetTopology_Optimization(); - const auto simp_exponent = config->GetSIMP_Exponent(); + const su2double simp_exponent = config->GetSIMP_Exponent(); + const su2double simp_minstiff = config->GetSIMP_MinStiffness(); const auto stressParam = config->GetStressPenaltyParam(); const su2double stress_scale = 1.0 / stressParam[0]; @@ -1269,7 +1270,8 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, /*--- In topology mode determine the penalty to apply to the stiffness ---*/ su2double simp_penalty = 1.0; if (topology_mode) { - simp_penalty = pow(element_properties[iElem]->GetPhysicalDensity(), simp_exponent); + su2double density = element_properties[iElem]->GetPhysicalDensity(); + simp_penalty = simp_minstiff+(1.0-simp_minstiff)*pow(density,simp_exponent); } /*--- Set the properties of the element. ---*/ diff --git a/meson_scripts/init.py b/meson_scripts/init.py index d3395baec917..e284ecc59b40 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -53,7 +53,7 @@ def init_submodules(method = 'auto'): sha_version_ninja = '52649de2c56b63f42bc59513d51286531c595b44' github_repo_ninja = 'https://github.com/ninja-build/ninja' sha_version_mpp = '5ff579f43781cae07411e5ab46291c9971536be6' - github_repo_mpp = 'https://github.com/mutationpp/Mutationpp.git' + github_repo_mpp = 'https://github.com/mutationpp/Mutationpp' medi_name = 'MeDiPack' codi_name = 'CoDiPack' From 117c99a37f0ab9393cbfd7d2f83ef160e38b61b2 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 10:26:54 +0000 Subject: [PATCH 204/326] update authors --- AUTHORS.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index b223314f1cf4..a8b22e426358 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -43,6 +43,7 @@ Copyright holders might be the individual person or their respective employer. I ``` Akshay.K.R Alejandro +Alessandro Gastaldi Aman uz zaman Baig Amit Sachdeva Ana Lourenco @@ -53,8 +54,10 @@ Antonio Rubino Arne Bachmann Beckett Y. Zhou Benjamin S. Kirk -Brandon Tracey +Brendan Tracey Carsten Othmer +Brian Munguía +Catarina Garbacz Clark Pederson Daumantas Kavolis Dave Taflin @@ -65,6 +68,7 @@ Francisco D. Palacios Gaurav Bansal Giulio Gori Guillaume Bâty +HL Kline Harichand M V IndianaStokes J. Sinsay @@ -74,14 +78,20 @@ Jason Howison Jayant Mukhopadhaya Jeffrey van Oostrom Jessie Lauzon +Johannes Blühdorn +JonathanSmith1936 João Loureiro Kedar Naik LaSerpe +Lennaert Tol Matteo Pini +Max Aehle Max Le Max Sagebaum Michele Gaffuri Mickael Philit +Mladen Banovic +Nicola Fonzi Ole Burghardt Patrick Mischke Paul Urbanczyk @@ -91,6 +101,7 @@ Pete Bachant RaulFeijo55 Ruben Sanchez Ryan Barrett +SaettaE Salvatore Vitale Samet Cakmakcioglu Scott Imlay @@ -104,7 +115,10 @@ Trent Lukaczyk VivaanKhatri Wally Maier aaronyicongfu +aeroamit anilvar +band-a-prend +bigfootedrockmidget bmunguia chamsolli costat @@ -115,14 +129,15 @@ demanosalvas dmudiger erangit flo -hlkline +fmpmorgado +garcgutierrez +jtneedels juliendm jvanoostrom koodlyakshay mcolonno minkwankim padronas -sametcaka sravya91 srcopela tobadavid From 5b4cd12f56ccb9881c6945075f85de4789b9ddbe Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 10:36:23 +0000 Subject: [PATCH 205/326] one more duplicate --- AUTHORS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index a8b22e426358..ed5c60e4312d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -134,7 +134,6 @@ garcgutierrez jtneedels juliendm jvanoostrom -koodlyakshay mcolonno minkwankim padronas From f1f6ce0450485b6cce7ddf4e5a7ebbd58354f1f4 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Sat, 6 Feb 2021 13:06:30 +0100 Subject: [PATCH 206/326] fix typo k2 not k1 --- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index cc388deb79f4..358e554ca3a0 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -767,7 +767,7 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, /*--- Closure constants ---*/ beta_star = constants[6]; sigma_k_1 = constants[0]; - sigma_k_1 = constants[1]; + sigma_k_2 = constants[1]; sigma_omega_1 = constants[2]; sigma_omega_2 = constants[3]; beta_1 = constants[4]; From 6304ffae773ac9e5e5fca7ddde8ebe2cd072506e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 15:09:35 +0000 Subject: [PATCH 207/326] deduce nVar-per-point for comms from vector instead of matrix, makes comms static --- Common/include/linear_algebra/CSysMatrix.hpp | 16 +-- Common/include/linear_algebra/CSysSolve.hpp | 1 - Common/src/linear_algebra/CSysMatrix.cpp | 133 ++++++++---------- Common/src/linear_algebra/CSysSolve.cpp | 8 +- .../integration/CNewtonIntegration.hpp | 20 +-- 5 files changed, 76 insertions(+), 102 deletions(-) diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index 1abe24da0c34..ae9c9022e158 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -389,10 +389,10 @@ class CSysMatrix { * \param[in] commType - Enumerated type for the quantity to be communicated. */ template - void InitiateComms(const CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType) const; + static void InitiateComms(const CSysVector & x, + CGeometry *geometry, + const CConfig *config, + unsigned short commType); /*! * \brief Routine to complete the set of non-blocking communications launched by @@ -403,10 +403,10 @@ class CSysMatrix { * \param[in] commType - Enumerated type for the quantity to be unpacked. */ template - void CompleteComms(CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType) const; + static void CompleteComms(CSysVector & x, + CGeometry *geometry, + const CConfig *config, + unsigned short commType); /*! * \brief Get a pointer to the start of block "ij" diff --git a/Common/include/linear_algebra/CSysSolve.hpp b/Common/include/linear_algebra/CSysSolve.hpp index 61a3cb5b78f5..31040e67d5f2 100644 --- a/Common/include/linear_algebra/CSysSolve.hpp +++ b/Common/include/linear_algebra/CSysSolve.hpp @@ -81,7 +81,6 @@ class CSysSolve { mutable bool cg_ready; /*!< \brief Indicate if memory used by CG is allocated. */ mutable bool bcg_ready; /*!< \brief Indicate if memory used by BCGSTAB is allocated. */ - mutable bool gmres_ready; /*!< \brief Indicate if memory used by FGMRES is allocated. */ mutable bool smooth_ready; /*!< \brief Indicate if memory used by SMOOTHER is allocated. */ mutable VectorType r; /*!< \brief Residual in CG and BCGSTAB. */ diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index 4aa845da1278..e340de92faa3 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -231,39 +231,26 @@ template void CSysMatrix::InitiateComms(const CSysVector & x, CGeometry *geometry, const CConfig *config, - unsigned short commType) const { + unsigned short commType) { if (geometry->nP2PSend == 0) return; /*--- Local variables ---*/ - unsigned short iVar; - unsigned short COUNT_PER_POINT = 0; - unsigned short MPI_TYPE = 0; - - unsigned long iPoint, msg_offset, buf_offset; - - int iMessage, iSend, nSend; + const unsigned short COUNT_PER_POINT = x.GetNVar(); + const unsigned short MPI_TYPE = COMM_TYPE_DOUBLE; /*--- Create a boolean for reversing the order of comms. ---*/ - bool reverse = false; + const bool reverse = (commType == SOLUTION_MATRIXTRANS); /*--- Set the size of the data packet and type depending on quantity. ---*/ switch (commType) { case SOLUTION_MATRIX: - COUNT_PER_POINT = nVar; - MPI_TYPE = COMM_TYPE_DOUBLE; - reverse = false; - break; case SOLUTION_MATRIXTRANS: - COUNT_PER_POINT = nEqn; - MPI_TYPE = COMM_TYPE_DOUBLE; - reverse = true; break; default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; } @@ -274,10 +261,6 @@ void CSysMatrix::InitiateComms(const CSysVector & x, geometry->AllocateP2PComms(COUNT_PER_POINT); - /*--- Set some local pointers to make access simpler. ---*/ - - su2double *bufDSend = geometry->bufD_P2PSend; - /*--- Load the specified quantity from the solver into the generic communication buffer in the geometry class. ---*/ @@ -285,79 +268,77 @@ void CSysMatrix::InitiateComms(const CSysVector & x, geometry->PostP2PRecvs(geometry, config, MPI_TYPE, COUNT_PER_POINT, reverse); - for (iMessage = 0; iMessage < geometry->nP2PSend; iMessage++) { + for (auto iMessage = 0; iMessage < geometry->nP2PSend; iMessage++) { switch (commType) { - case SOLUTION_MATRIX: + case SOLUTION_MATRIX: { + + su2double* bufDSend = geometry->bufD_P2PSend; /*--- Get the offset for the start of this message. ---*/ - msg_offset = geometry->nPoint_P2PSend[iMessage]; + const auto msg_offset = geometry->nPoint_P2PSend[iMessage]; /*--- Total count can include multiple pieces of data per point. ---*/ - nSend = (geometry->nPoint_P2PSend[iMessage+1] - - geometry->nPoint_P2PSend[iMessage]); + const auto nSend = (geometry->nPoint_P2PSend[iMessage+1] - geometry->nPoint_P2PSend[iMessage]); SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iSend = 0; iSend < nSend; iSend++) { + for (auto iSend = 0; iSend < nSend; iSend++) { /*--- Get the local index for this communicated data. ---*/ - iPoint = geometry->Local_Point_P2PSend[msg_offset + iSend]; + const auto iPoint = geometry->Local_Point_P2PSend[msg_offset + iSend]; /*--- Compute the offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; /*--- Load the buffer with the data to be sent. ---*/ - for (iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) bufDSend[buf_offset+iVar] = x(iPoint,iVar); - } - break; + } - case SOLUTION_MATRIXTRANS: + case SOLUTION_MATRIXTRANS: { /*--- We are going to communicate in reverse, so we use the recv buffer for the send instead. Also, all of the offsets and counts are derived from the recv data structures. ---*/ - bufDSend = geometry->bufD_P2PRecv; + su2double* bufDSend = geometry->bufD_P2PRecv; /*--- Get the offset for the start of this message. ---*/ - msg_offset = geometry->nPoint_P2PRecv[iMessage]; + const auto msg_offset = geometry->nPoint_P2PRecv[iMessage]; /*--- Total count can include multiple pieces of data per point. ---*/ - nSend = (geometry->nPoint_P2PRecv[iMessage+1] - - geometry->nPoint_P2PRecv[iMessage]); + const auto nSend = (geometry->nPoint_P2PRecv[iMessage+1] - geometry->nPoint_P2PRecv[iMessage]); SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iSend = 0; iSend < nSend; iSend++) { + for (auto iSend = 0; iSend < nSend; iSend++) { /*--- Get the local index for this communicated data. Here we again use the recv structure to find the send point, since the usual recv points are now the senders in reverse mode. ---*/ - iPoint = geometry->Local_Point_P2PRecv[msg_offset + iSend]; + const auto iPoint = geometry->Local_Point_P2PRecv[msg_offset + iSend]; /*--- Compute the offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; /*--- Load the buffer with the data to be sent. ---*/ - for (iVar = 0; iVar < nEqn; iVar++) + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) bufDSend[buf_offset+iVar] = x(iPoint,iVar); - } - break; + } default: SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", @@ -379,28 +360,21 @@ template void CSysMatrix::CompleteComms(CSysVector & x, CGeometry *geometry, const CConfig *config, - unsigned short commType) const { + unsigned short commType) { if (geometry->nP2PRecv == 0) return; /*--- Local variables ---*/ - unsigned short iVar; - unsigned long iPoint, iRecv, nRecv, msg_offset, buf_offset; - const auto COUNT_PER_POINT = (commType == SOLUTION_MATRIX)? nVar : nEqn; - - int ind, source, iMessage, jRecv; + const unsigned short COUNT_PER_POINT = x.GetNVar(); /*--- Global status so all threads can see the result of Waitany. ---*/ static SU2_MPI::Status status; - - /*--- Set some local pointers to make access simpler. ---*/ - - const su2double *bufDRecv = geometry->bufD_P2PRecv; + int ind; /*--- Store the data that was communicated into the appropriate location within the local class data structures. ---*/ - for (iMessage = 0; iMessage < geometry->nP2PRecv; iMessage++) { + for (auto iMessage = 0; iMessage < geometry->nP2PRecv; iMessage++) { /*--- For efficiency, recv the messages dynamically based on the order they arrive. ---*/ @@ -411,80 +385,82 @@ void CSysMatrix::CompleteComms(CSysVector & x, /*--- Once we have recv'd a message, get the source rank. ---*/ - source = status.MPI_SOURCE; + const auto source = status.MPI_SOURCE; switch (commType) { - case SOLUTION_MATRIX: + case SOLUTION_MATRIX: { + + const su2double *bufDRecv = geometry->bufD_P2PRecv; /*--- We know the offsets based on the source rank. ---*/ - jRecv = geometry->P2PRecv2Neighbor[source]; + const auto jRecv = geometry->P2PRecv2Neighbor[source]; /*--- Get the offset for the start of this message. ---*/ - msg_offset = geometry->nPoint_P2PRecv[jRecv]; + const auto msg_offset = geometry->nPoint_P2PRecv[jRecv]; /*--- Get the number of packets to be received in this message. ---*/ - nRecv = (geometry->nPoint_P2PRecv[jRecv+1] - - geometry->nPoint_P2PRecv[jRecv]); + const auto nRecv = (geometry->nPoint_P2PRecv[jRecv+1] - geometry->nPoint_P2PRecv[jRecv]); SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iRecv = 0; iRecv < nRecv; iRecv++) { + for (auto iRecv = 0; iRecv < nRecv; iRecv++) { /*--- Get the local index for this communicated data. ---*/ - iPoint = geometry->Local_Point_P2PRecv[msg_offset + iRecv]; + const auto iPoint = geometry->Local_Point_P2PRecv[msg_offset + iRecv]; /*--- Compute the offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; /*--- Store the data correctly depending on the quantity. ---*/ - for (iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) x(iPoint,iVar) = ActiveAssign(bufDRecv[buf_offset+iVar]); } break; + } - case SOLUTION_MATRIXTRANS: + case SOLUTION_MATRIXTRANS: { /*--- We are going to communicate in reverse, so we use the send buffer for the recv instead. Also, all of the offsets and counts are derived from the send data structures. ---*/ - bufDRecv = geometry->bufD_P2PSend; + const su2double* bufDRecv = geometry->bufD_P2PSend; /*--- We know the offsets based on the source rank. ---*/ - jRecv = geometry->P2PSend2Neighbor[source]; + const auto jRecv = geometry->P2PSend2Neighbor[source]; /*--- Get the offset for the start of this message. ---*/ - msg_offset = geometry->nPoint_P2PSend[jRecv]; + const auto msg_offset = geometry->nPoint_P2PSend[jRecv]; /*--- Get the number of packets to be received in this message. ---*/ - nRecv = (geometry->nPoint_P2PSend[jRecv+1] - - geometry->nPoint_P2PSend[jRecv]); + const auto nRecv = (geometry->nPoint_P2PSend[jRecv+1] - geometry->nPoint_P2PSend[jRecv]); SU2_OMP_FOR_STAT(OMP_MIN_SIZE) - for (iRecv = 0; iRecv < nRecv; iRecv++) { + for (auto iRecv = 0; iRecv < nRecv; iRecv++) { /*--- Get the local index for this communicated data. ---*/ - iPoint = geometry->Local_Point_P2PSend[msg_offset + iRecv]; + const auto iPoint = geometry->Local_Point_P2PSend[msg_offset + iRecv]; /*--- Compute the offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; /*--- Update receiving point. ---*/ - for (iVar = 0; iVar < nEqn; iVar++) + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) x(iPoint,iVar) += ActiveAssign(bufDRecv[buf_offset+iVar]); } break; + } default: SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", @@ -1398,9 +1374,11 @@ void CSysMatrix::ComputePastixPreconditioner(const CSysVector::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short) const;\ -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short) const; +template void CSysMatrix::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short);\ +template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short); #define INSTANTIATE_MATRIX(TYPE)\ template class CSysMatrix;\ @@ -1408,7 +1386,6 @@ INSTANTIATE_COMMS(TYPE, TYPE)\ template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&);\ template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); -/*--- Explicit instantiations ---*/ #ifdef CODI_FORWARD_TYPE /*--- In forward AD only the active type is used. ---*/ INSTANTIATE_MATRIX(su2double) diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index c151a958fbc6..5673ca14622e 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -54,7 +54,6 @@ CSysSolve::CSysSolve(const bool mesh_deform_mode) : mesh_deform(mesh_deform_mode), cg_ready(false), bcg_ready(false), - gmres_ready(false), smooth_ready(false), LinSysSol_ptr(nullptr), LinSysRes_ptr(nullptr) { @@ -355,18 +354,15 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVectorGetLinear_Solver_Error()); - auto iter = config->GetLinear_Solver_Iter(); - auto product = CSysMatrixVectorProduct(solvers[FLOW_SOL]->Jacobian, geometry, config); - - precondOut = MixedScalar(0.0); - solvers[FLOW_SOL]->System.FGMRES_LinSolver(precondIn, precondOut, product, *preconditioner, - eps, iter, eps, false, config, true); CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) v[i] = precondOut[i]; SU2_OMP_BARRIER @@ -123,7 +116,16 @@ class CNewtonIntegration final : public CIntegration { /*--- Otherwise they are not needed. ---*/ template::value> = 0> - inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { (*preconditioner)(u, v); } + inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { + +// (*preconditioner)(u, v); + + MixedScalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + auto iter = config->GetLinear_Solver_Iter(); + auto product = CSysMatrixVectorProduct(solvers[FLOW_SOL]->Jacobian, geometry, config); + v = MixedScalar(0.0); + solvers[FLOW_SOL]->System.FGMRES_LinSolver(u, v, product, *preconditioner, eps, iter, eps, false, config, true); + } /*! * \brief Gather solver info, etc.. From 4ac64d64f782a1e22b1c4c427fbc0e190d0f9fae Mon Sep 17 00:00:00 2001 From: vdweide Date: Sat, 6 Feb 2021 19:34:10 +0100 Subject: [PATCH 208/326] Added CFL_AdaptParam to the destructor of CConfig --- Common/src/CConfig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 231882c90af5..9a0a815a4fb7 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -7638,6 +7638,7 @@ CConfig::~CConfig(void) { delete[] MG_CorrecSmooth; delete[] PlaneTag; delete[] CFL; + delete[] CFL_AdaptParam; /*--- String markers ---*/ From fa24a800393e26ad04e9fad727409d82d7f05e0e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 6 Feb 2021 23:49:03 +0000 Subject: [PATCH 209/326] move comms out of CSysMatrix --- Common/include/linear_algebra/CSysMatrix.hpp | 54 ++++++------ .../src/grid_movement/CVolumetricMovement.cpp | 8 +- Common/src/linear_algebra/CSysMatrix.cpp | 86 ++++++++----------- .../src/integration/CNewtonIntegration.cpp | 8 +- SU2_CFD/src/solvers/CFEASolver.cpp | 4 +- SU2_DEF/src/SU2_DEF.cpp | 2 +- SU2_DOT/src/SU2_DOT.cpp | 2 +- UnitTests/test_driver.cpp | 2 +- 8 files changed, 77 insertions(+), 89 deletions(-) diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index ae9c9022e158..f4312d5321f3 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -78,6 +78,30 @@ struct mkl_jit_wrapper { class CConfig; class CGeometry; +struct CSysMatrixComms { + /*! + * \brief Routine to load a vector quantity into the data structures for MPI point-to-point + * communication and to launch non-blocking sends and recvs. + * \param[in] x - CSysVector holding the array of data. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] commType - Enumerated type for the quantity to be communicated. + */ + template + static void Initiate(const CSysVector& x, CGeometry *geometry, const CConfig *config, unsigned short commType); + + /*! + * \brief Routine to complete the set of non-blocking communications launched by + * Initiate() and unpacking of the data in the vector. + * \param[in] x - CSysVector holding the array of data. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] commType - Enumerated type for the quantity to be unpacked. + */ + template + static void Complete(CSysVector& x, CGeometry *geometry, const CConfig *config, unsigned short commType); +}; + /*! * \class CSysMatrix * \brief Main class for defining block-compressed-row-storage sparse matrices. @@ -85,6 +109,8 @@ class CGeometry; template class CSysMatrix { private: + friend class CSysMatrixComms; + const int rank; /*!< \brief MPI Rank. */ const int size; /*!< \brief MPI Size. */ @@ -380,34 +406,6 @@ class CSysMatrix { */ void SetValDiagonalZero(void); - /*! - * \brief Routine to load a vector quantity into the data structures for MPI point-to-point - * communication and to launch non-blocking sends and recvs. - * \param[in] x - CSysVector holding the array of data. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] commType - Enumerated type for the quantity to be communicated. - */ - template - static void InitiateComms(const CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType); - - /*! - * \brief Routine to complete the set of non-blocking communications launched by - * InitiateComms() and unpacking of the data in the vector. - * \param[in] x - CSysVector holding the array of data. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] commType - Enumerated type for the quantity to be unpacked. - */ - template - static void CompleteComms(CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType); - /*! * \brief Get a pointer to the start of block "ij" * \param[in] block_i - Row index. diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index 7a11e79960ba..d18da5b4c9d4 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -168,11 +168,11 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co so that all nodes have the same solution and r.h.s. entries across all partitions. ---*/ - StiffMatrix.InitiateComms(LinSysSol, geometry, config, SOLUTION_MATRIX); - StiffMatrix.CompleteComms(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(LinSysSol, geometry, config, SOLUTION_MATRIX); - StiffMatrix.InitiateComms(LinSysRes, geometry, config, SOLUTION_MATRIX); - StiffMatrix.CompleteComms(LinSysRes, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysRes, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(LinSysRes, geometry, config, SOLUTION_MATRIX); /*--- Definition of the preconditioner matrix vector multiplication, and linear solver ---*/ diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index e340de92faa3..f967b71106d2 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -226,12 +226,10 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi } -template -template -void CSysMatrix::InitiateComms(const CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType) { +template +void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, + const CConfig *config, unsigned short commType) { + if (geometry->nP2PSend == 0) return; /*--- Local variables ---*/ @@ -284,7 +282,7 @@ void CSysMatrix::InitiateComms(const CSysVector & x, const auto nSend = (geometry->nPoint_P2PSend[iMessage+1] - geometry->nPoint_P2PSend[iMessage]); - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iSend = 0; iSend < nSend; iSend++) { /*--- Get the local index for this communicated data. ---*/ @@ -319,7 +317,7 @@ void CSysMatrix::InitiateComms(const CSysVector & x, const auto nSend = (geometry->nPoint_P2PRecv[iMessage+1] - geometry->nPoint_P2PRecv[iMessage]); - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iSend = 0; iSend < nSend; iSend++) { /*--- Get the local index for this communicated data. Here we @@ -355,12 +353,10 @@ void CSysMatrix::InitiateComms(const CSysVector & x, } -template -template -void CSysMatrix::CompleteComms(CSysVector & x, - CGeometry *geometry, - const CConfig *config, - unsigned short commType) { +template +void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, + const CConfig *config, unsigned short commType) { + if (geometry->nP2PRecv == 0) return; /*--- Local variables ---*/ @@ -404,7 +400,7 @@ void CSysMatrix::CompleteComms(CSysVector & x, const auto nRecv = (geometry->nPoint_P2PRecv[jRecv+1] - geometry->nPoint_P2PRecv[jRecv]); - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iRecv = 0; iRecv < nRecv; iRecv++) { /*--- Get the local index for this communicated data. ---*/ @@ -418,7 +414,7 @@ void CSysMatrix::CompleteComms(CSysVector & x, /*--- Store the data correctly depending on the quantity. ---*/ for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - x(iPoint,iVar) = ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint,iVar) = CSysMatrix::template ActiveAssign(bufDRecv[buf_offset+iVar]); } break; } @@ -443,7 +439,7 @@ void CSysMatrix::CompleteComms(CSysVector & x, const auto nRecv = (geometry->nPoint_P2PSend[jRecv+1] - geometry->nPoint_P2PSend[jRecv]); - SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iRecv = 0; iRecv < nRecv; iRecv++) { /*--- Get the local index for this communicated data. ---*/ @@ -457,14 +453,13 @@ void CSysMatrix::CompleteComms(CSysVector & x, /*--- Update receiving point. ---*/ for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - x(iPoint,iVar) += ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint,iVar) += CSysMatrix::template ActiveAssign(bufDRecv[buf_offset+iVar]); } break; } default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } @@ -630,8 +625,8 @@ void CSysMatrix::MatrixVectorProduct(const CSysVector & /*--- MPI Parallelization. ---*/ - InitiateComms(prod, geometry, config, SOLUTION_MATRIX); - CompleteComms(prod, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(prod, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(prod, geometry, config, SOLUTION_MATRIX); } @@ -670,8 +665,8 @@ void CSysMatrix::MatrixVectorProductTransposed(const CSysVector::ComputeJacobiPreconditioner(const CSysVector::ComputeILUPreconditioner(const CSysVector::ComputeLU_SGSPreconditioner(const CSysVector::ComputeLU_SGSPreconditioner(const CSysVector::ComputeLineletPreconditioner(const CSysVector::ComputePastixPreconditioner(const CSysVector::ComputePastixPreconditioner(const CSysVector::InitiateComms(const CSysVector&, CGeometry*, const CConfig*, unsigned short);\ -template void CSysMatrix::CompleteComms(CSysVector&, CGeometry*, const CConfig*, unsigned short); +#define INSTANTIATE_COMMS(TYPE)\ +template void CSysMatrixComms::Initiate(const CSysVector&, CGeometry*, const CConfig*, unsigned short);\ +template void CSysMatrixComms::Complete(CSysVector&, CGeometry*, const CConfig*, unsigned short); #define INSTANTIATE_MATRIX(TYPE)\ template class CSysMatrix;\ -INSTANTIATE_COMMS(TYPE, TYPE)\ template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&);\ -template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&); +template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&);\ +INSTANTIATE_COMMS(TYPE) #ifdef CODI_FORWARD_TYPE /*--- In forward AD only the active type is used. ---*/ @@ -1392,16 +1387,11 @@ INSTANTIATE_MATRIX(su2double) #else /*--- Base and reverse AD, matrix is passive. ---*/ INSTANTIATE_MATRIX(su2mixedfloat) -/*--- If using mixed precision (float) instantiate also a version for doubles, and allow cross communication. ---*/ +/*--- If using mixed precision (float) instantiate also a version for doubles, and allow cross communications. ---*/ #ifdef USE_MIXED_PRECISION INSTANTIATE_MATRIX(passivedouble) -INSTANTIATE_COMMS(su2mixedfloat,passivedouble) #endif -/*--- Allow more cross-comms for reverse AD. ---*/ #ifdef CODI_REVERSE_TYPE -INSTANTIATE_COMMS(su2mixedfloat,su2double) -#ifdef USE_MIXED_PRECISION -INSTANTIATE_COMMS(passivedouble,su2double) -#endif +INSTANTIATE_COMMS(su2double) #endif #endif // CODI_FORWARD_TYPE diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index e48ec9f4ab01..1398bb284928 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -256,8 +256,8 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVect } } - solvers[FLOW_SOL]->Jacobian.InitiateComms(v, geometry, config, SOLUTION_MATRIX); - solvers[FLOW_SOL]->Jacobian.CompleteComms(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(v, geometry, config, SOLUTION_MATRIX); } void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector& v) const { @@ -277,7 +277,7 @@ void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector< v(iPoint,iVar) = SU2_TYPE::GetValue(delta) * u(iPoint,iVar); } - solvers[FLOW_SOL]->Jacobian.InitiateComms(v, geometry, config, SOLUTION_MATRIX); - solvers[FLOW_SOL]->Jacobian.CompleteComms(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(v, geometry, config, SOLUTION_MATRIX); } } diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 3d1a95f15ebd..8e0d79a8e650 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2544,8 +2544,8 @@ void CFEASolver::GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) { /*--- Enforce solution at some halo points possibly not covered by essential BC markers. ---*/ - Jacobian.InitiateComms(LinSysSol, geometry, config, SOLUTION_MATRIX); - Jacobian.CompleteComms(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Complete(LinSysSol, geometry, config, SOLUTION_MATRIX); for (auto iPoint : ExtraVerticesToEliminate) { Jacobian.EnforceSolutionAtNode(iPoint, LinSysSol.GetBlock(iPoint), LinSysRes); diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 41852e1ef958..3e1310da1da4 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization ---*/ -#ifdef HAVE_OMP +#if defined(HAVE_OMP) && defined(HAVE_MPI) int provided; SU2_MPI::Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); #else diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 6a1fb804e93c..3017cc90f8f1 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization, and buffer setting ---*/ -#ifdef HAVE_OMP +#if defined(HAVE_OMP) && defined(HAVE_MPI) int provided; SU2_MPI::Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); #else diff --git a/UnitTests/test_driver.cpp b/UnitTests/test_driver.cpp index 0fd92e5dc054..6101d9c77774 100644 --- a/UnitTests/test_driver.cpp +++ b/UnitTests/test_driver.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { /*--- Startup MPI, if supported ---*/ -#ifdef HAVE_OMP +#if defined(HAVE_OMP) && defined(HAVE_MPI) int provided; SU2_MPI::Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); #else From e0b30cc3c8f167bad4d31fe4e65d6ab98c6bb892 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Sun, 7 Feb 2021 11:23:13 +0100 Subject: [PATCH 210/326] fix bug implicit conversion with auto (reference) --- SU2_CFD/src/solvers/CSolver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 450522be6927..f608da291387 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2456,8 +2456,8 @@ void CSolver::SetRotatingFrame_GCL(CGeometry *geometry, const CConfig *config) { void CSolver::SetAuxVar_Gradient_GG(CGeometry *geometry, const CConfig *config) { - const auto solution = base_nodes->GetAuxVar(); - auto gradient = base_nodes->GetAuxVarGradient(); + const auto& solution = base_nodes->GetAuxVar(); + auto& gradient = base_nodes->GetAuxVarGradient(); computeGradientsGreenGauss(this, AUXVAR_GRADIENT, PERIODIC_NONE, *geometry, *config, solution, 0, base_nodes->GetnAuxVar(), gradient); @@ -2466,8 +2466,8 @@ void CSolver::SetAuxVar_Gradient_GG(CGeometry *geometry, const CConfig *config) void CSolver::SetAuxVar_Gradient_LS(CGeometry *geometry, const CConfig *config) { bool weighted = true; - const auto solution = base_nodes->GetAuxVar(); - auto gradient = base_nodes->GetAuxVarGradient(); + const auto& solution = base_nodes->GetAuxVar(); + auto& gradient = base_nodes->GetAuxVarGradient(); auto& rmatrix = base_nodes->GetRmatrix(); computeGradientsLeastSquares(this, AUXVAR_GRADIENT, PERIODIC_NONE, *geometry, *config, From 788dea479c8fd0b1668d00a28074de1797e48588 Mon Sep 17 00:00:00 2001 From: Max Aehle Date: Sun, 7 Feb 2021 12:28:37 +0100 Subject: [PATCH 211/326] Fixed Coord_j for boundary viscous numerics The visc_numerics' coordinates were often set to the coordinates of the boundary vertex and its closest normal neighbour. Setting them to the boundary vertex and the reflection of the closest normal neighbour at the vertex is more systematic however. Normally this should not change much, because the boundary numerics do not apply gradient correction, so they only depend on the distance between Coord_i, Coord_j. --- Common/include/toolboxes/geometry_toolbox.hpp | 7 +++ .../include/solvers/CFVMFlowSolverBase.inl | 5 +- SU2_CFD/src/solvers/CAdjEulerSolver.cpp | 31 +++++++--- SU2_CFD/src/solvers/CEulerSolver.cpp | 56 +++++++++++++++---- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 18 ++++-- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 21 +++++-- SU2_CFD/src/solvers/CTurbSASolver.cpp | 38 +++++++++---- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 21 +++++-- SU2_CFD/src/solvers/CTurbSolver.cpp | 6 +- 9 files changed, 156 insertions(+), 47 deletions(-) diff --git a/Common/include/toolboxes/geometry_toolbox.hpp b/Common/include/toolboxes/geometry_toolbox.hpp index 126d35e9cdfc..594e79fd9b34 100644 --- a/Common/include/toolboxes/geometry_toolbox.hpp +++ b/Common/include/toolboxes/geometry_toolbox.hpp @@ -50,6 +50,13 @@ inline void Distance(Int nDim, const T* a, const T* b, T* d) { for(Int i = 0; i < nDim; i++) d[i] = a[i] - b[i]; } +/*! \brief Reflect a at b: c = 2*b - a + */ +template +inline void PointPointReflect(Int nDim, const T* a, const T* b, T* d){ + for(Int i = 0; i < nDim; i++) d[i] = 2 * b[i] - a[i]; +} + /*! \return a.b */ template inline T DotProduct(Int nDim, const T* a, const T* b) { diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index f982632c9384..f17b2bb21777 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1516,7 +1516,10 @@ void CFVMFlowSolverBase::BC_Fluid_Interface(CGeometry* geometry, /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index 257f2bdc86c3..9d213c1948e6 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -3387,8 +3387,10 @@ void CAdjEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain if (config->GetViscous()) { /*--- Points in edge, coordinates and normal vector---*/ - - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction and adjoint variables w/o reconstruction---*/ @@ -3501,7 +3503,10 @@ void CAdjEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_ /*--- Points in edge, coordinates and normal vector---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction and adjoint variables w/o reconstruction---*/ @@ -3616,7 +3621,10 @@ void CAdjEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver /*--- Points in edge, coordinates and normal vector---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction and adjoint variables w/o reconstruction---*/ @@ -3788,7 +3796,10 @@ void CAdjEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Points in edge, coordinates and normal vector---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction and adjoint variables w/o reconstruction---*/ @@ -3878,7 +3889,10 @@ void CAdjEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); - conv_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + conv_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Allocate the value at the outlet ---*/ @@ -4068,7 +4082,10 @@ void CAdjEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Points in edge, coordinates and normal vector---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[3]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Conservative variables w/o reconstruction and adjoint variables w/o reconstruction---*/ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 49a8b6de539c..6986d30fd001 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5155,8 +5155,10 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -5623,7 +5625,10 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -6137,7 +6142,10 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -7037,7 +7045,10 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -7377,7 +7388,10 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -7551,7 +7565,10 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -7695,7 +7712,10 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -7817,7 +7837,10 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -8037,7 +8060,10 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -8288,7 +8314,10 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // @@ -8848,7 +8877,10 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C // /*--- Set the normal vector and the coordinates ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->node[iPoint_Normal]->GetCoord()); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 85a14c212dce..c074d96ee4d5 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1878,8 +1878,10 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -2117,8 +2119,10 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ @@ -2312,8 +2316,10 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables, and gradient ---*/ diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index ac5b0032c95c..3b74ea4aacac 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1630,8 +1630,10 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contai /*--- Viscous contribution ---*/ if (viscous) { - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal) ); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected ); visc_numerics->SetNormal(Normal); /*--- Primitive variables, and gradient ---*/ @@ -1929,7 +1931,10 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solution_containe // /*--- Set the normal vector and the coordinates ---*/ // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(), geometry->node[Point_Normal]->GetCoord()); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(), Coord_Reflected); // /*--- Primitive variables, and gradient ---*/ // visc_numerics->SetPrimitive(V_domain, V_inlet); @@ -2149,7 +2154,10 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solution_contain // /*--- Set the normal vector and the coordinates ---*/ // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(), geometry->node[Point_Normal]->GetCoord()); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(), Coord_Reflected); // /*--- Primitive variables, and gradient ---*/ // visc_numerics->SetPrimitive(V_domain, V_outlet); @@ -2383,7 +2391,10 @@ SU2_MPI::Error("BC_SUPERSONIC_INLET: Not operational in NEMO.", CURRENT_FUNCTION // // /*--- Set the normal vector and the coordinates ---*/ // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Primitive variables, and gradient ---*/ // visc_numerics->SetPrimitive(V_domain, V_inlet); diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 79966c4ee24c..ccb393464ea2 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -641,7 +641,10 @@ void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CN // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -721,7 +724,10 @@ void CTurbSASolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, C // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -803,7 +809,10 @@ void CTurbSASolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_conta // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(iPoint)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -887,7 +896,10 @@ void CTurbSASolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_cont // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(iPoint)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -1031,7 +1043,10 @@ void CTurbSASolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // // visc_numerics->SetNormal(Normal); -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->node[iPoint_Normal]->GetCoord()); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // // /*--- Conservative variables w/o reconstruction ---*/ // @@ -1119,9 +1134,10 @@ void CTurbSASolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_c Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ - - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction ---*/ @@ -1220,8 +1236,10 @@ void CTurbSASolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contain /*--- Viscous contribution ---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index bbf3cb70f9df..ab5d5a3309b4 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -591,7 +591,10 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // - // visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + // su2double Coord_Reflected[MAXNDIM]; + // GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + // geometry->nodes->GetCoord(iPoint), Coord_Reflected); + // visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -677,7 +680,10 @@ void CTurbSSTSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, // /*--- Viscous contribution, commented out because serious convergence problems ---*/ // -// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); +// su2double Coord_Reflected[MAXNDIM]; +// GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), +// geometry->nodes->GetCoord(iPoint), Coord_Reflected); +// visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); // visc_numerics->SetNormal(Normal); // // /*--- Conservative variables w/o reconstruction ---*/ @@ -769,7 +775,10 @@ void CTurbSSTSolver::BC_Inlet_MixingPlane(CGeometry *geometry, CSolver **solver_ Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction ---*/ @@ -873,8 +882,10 @@ void CTurbSSTSolver::BC_Inlet_Turbo(CGeometry *geometry, CSolver **solver_contai Jacobian.AddBlock2Diag(iPoint, conv_residual.jacobian_i); /*--- Viscous contribution ---*/ - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), - geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); visc_numerics->SetNormal(Normal); /*--- Conservative variables w/o reconstruction ---*/ diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index e11eb22fa2d9..c344c0a63a23 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -27,6 +27,7 @@ #include "../../include/solvers/CTurbSolver.hpp" #include "../../../Common/include/parallelization/omp_structure.hpp" +#include "../../../Common/include/toolboxes/geometry_toolbox.hpp" CTurbSolver::CTurbSolver(void) : CSolver() { } @@ -478,7 +479,10 @@ void CTurbSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_conta /*--- Set the normal vector and the coordinates ---*/ visc_numerics->SetNormal(Normal); - visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal)); + su2double Coord_Reflected[MAXNDIM]; + GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal), + geometry->nodes->GetCoord(iPoint), Coord_Reflected); + visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected); /*--- Primitive variables ---*/ From 1e6707b51d049afd8711aec61776ce1f51f97149 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Sun, 7 Feb 2021 20:00:11 +0100 Subject: [PATCH 212/326] fix error --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 2 +- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 0518c2af796f..ec52d7719d8d 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -334,7 +334,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*! * \brief Add contribution due to axisymmetric formulation to 2D residual */ - void ResidualAxisymmetric(su2double beta_blended); + void ResidualAxisymmetric(); public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 358e554ca3a0..3462986dc229 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -911,7 +911,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi /*--- Contribution due to 2D axisymmetric formulation ---*/ - if (axisymmetric) ResidualAxisymmetric(beta_blended); + if (axisymmetric) ResidualAxisymmetric(); AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -937,15 +937,15 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } -void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double beta_blended){ +void CSourcePieceWise_TurbSST::ResidualAxisymmetric(){ if (Coord_i[1] > EPS) { su2double yinv = 1.0/Coord_i[1]; /*--- Residual Convection ---*/ - Residual[0] -= yinv*Volume*beta_star*V_i[1]*Density_i*TurbVar_i[0]; - Residual[1] -= yinv*Volume*beta_blended*V_i[1]*Density_i*TurbVar_i[1]; + Residual[0] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[0]; + Residual[1] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[1]; if (implicit) { Jacobian_i[0][0] -= yinv*Volume*V_i[1]; @@ -962,4 +962,4 @@ void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double beta_blended){ } -} \ No newline at end of file +} From fe13b23ac761706953bb365c224db66c98936e9b Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Mon, 8 Feb 2021 19:15:15 +0100 Subject: [PATCH 213/326] add production --- .../numerics/turbulent/turb_sources.hpp | 2 +- .../src/numerics/turbulent/turb_sources.cpp | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index ec52d7719d8d..71e400ac368f 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -334,7 +334,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*! * \brief Add contribution due to axisymmetric formulation to 2D residual */ - void ResidualAxisymmetric(); + void ResidualAxisymmetric(su2double alfa_blended); public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 3462986dc229..f9215670e2f1 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -911,7 +911,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi /*--- Contribution due to 2D axisymmetric formulation ---*/ - if (axisymmetric) ResidualAxisymmetric(); + if (axisymmetric) ResidualAxisymmetric(alfa_blended); AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -937,29 +937,35 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } -void CSourcePieceWise_TurbSST::ResidualAxisymmetric(){ +void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended){ if (Coord_i[1] > EPS) { su2double yinv = 1.0/Coord_i[1]; - /*--- Residual Convection ---*/ + /*--- Convection ---*/ Residual[0] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[0]; Residual[1] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[1]; - if (implicit) { - Jacobian_i[0][0] -= yinv*Volume*V_i[1]; - Jacobian_i[1][1] -= yinv*Volume*V_i[1]; - } + /*--- Production ---*/ + su2double p_axi = yinv*Volume*TWO3*V_i[1]*(2*Eddy_Viscosity_i*(yinv*V_i[1]-PrimVar_Grad_i[2][1] + -PrimVar_Grad_i[1][0]) + -Density_i*TurbVar_i[0]); + Residual[0] += p_axi; + Residual[1] += p_axi*alfa_blended*Density_i/Eddy_Viscosity_i; - /*--- Compute the blended constant for the viscous terms ---*/ + /*--- Compute blended constants ---*/ su2double sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; su2double sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; - /*--- Residual Diffusion ---*/ + /*--- Diffusion ---*/ Residual[0] += yinv*Volume*(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; Residual[1] += yinv*Volume*(Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; - + + if (implicit) { + Jacobian_i[0][0] += yinv*Volume*ONE3*V_i[1]; + Jacobian_i[1][1] -= yinv*Volume*V_i[1]; + } + } - } From 614d009710076cee88b52815e2cfdaf4943b6351 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 8 Feb 2021 20:48:45 +0100 Subject: [PATCH 214/326] Tentative removing switch from python --- SU2_PY/FSI_tools/FSI_config.py | 57 ++++++----- SU2_PY/FSI_tools/__init__.py | 1 - SU2_PY/FSI_tools/switch.py | 52 ---------- SU2_PY/SU2_Nastran/pysu2_nastran.py | 145 ++++++++++++++-------------- 4 files changed, 97 insertions(+), 158 deletions(-) delete mode 100644 SU2_PY/FSI_tools/switch.py diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index f9bba78037d5..0172e8fabfea 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -39,8 +39,10 @@ # Imports # ---------------------------------------------------------------------- -import os, sys, shutil, copy -from FSI_tools.switch import switch +import os +import sys +import shutil +import copy # ---------------------------------------------------------------------- # FSI Configuration Class @@ -86,40 +88,35 @@ def readConfig(self): this_param = line[0].strip() this_value = line[1].strip() - for case in switch(this_param): #integer values - if case("NDIM") : pass - if case("RESTART_ITER") : pass - if case("TIME_TRESHOLD") : pass - if case("NB_FSI_ITER") : - self._ConfigContent[this_param] = int(this_value) - break + if (this_param == "NDIM") || \ + (this_param == "RESTART_ITER") || \ + (this_param == "TIME_TRESHOLD") || \ + (this_param == "NB_FSI_ITER") : + self._ConfigContent[this_param] = int(this_value) #float values - if case("RBF_RADIUS") : pass - if case("AITKEN_PARAM") : pass - if case("UNST_TIMESTEP") : pass - if case("UNST_TIME") : pass - if case("FSI_TOLERANCE") : - self._ConfigContent[this_param] = float(this_value) - break + elif (this_param == "RBF_RADIUS") || \ + (this_param == "AITKEN_PARAM") || \ + (this_param == "UNST_TIMESTEP") || \ + (this_param == "UNST_TIME") || \ + (this_param == "FSI_TOLERANCE") : + self._ConfigContent[this_param] = float(this_value) #string values - if case("CFD_CONFIG_FILE_NAME") : pass - if case("CSD_SOLVER") : pass - if case("CSD_CONFIG_FILE_NAME") : pass - if case("RESTART_SOL") : pass - if case("MATCHING_MESH") : pass - if case("MESH_INTERP_METHOD") : pass - if case("DISP_PRED") : pass - if case("AITKEN_RELAX") : pass - if case("TIME_MARCHING") : - self._ConfigContent[this_param] = this_value - break + elif (this_param == "CFD_CONFIG_FILE_NAME") || \ + (this_param == "CSD_SOLVER") || \ + (this_param == "CSD_CONFIG_FILE_NAME") || \ + (this_param == "RESTART_SOL") || \ + (this_param == "MATCHING_MESH") || \ + (this_param == "MESH_INTERP_METHOD") || \ + (this_param == "DISP_PRED") || \ + (this_param == "AITKEN_RELAX") || \ + (this_param == "TIME_MARCHING") : + self._ConfigContent[this_param] = this_value - if case(): - print(this_param + " is an invalid option !") - break + else : + print(this_param + " is an invalid option !") def applyDefaults(self): if self._ConfigContent["CSD_SOLVER"] == "IMPOSED": diff --git a/SU2_PY/FSI_tools/__init__.py b/SU2_PY/FSI_tools/__init__.py index e843f12bbe49..ec8ad1b64101 100644 --- a/SU2_PY/FSI_tools/__init__.py +++ b/SU2_PY/FSI_tools/__init__.py @@ -1,3 +1,2 @@ from FSI_tools.FSIInterface import Interface -from FSI_tools.switch import switch from FSI_tools.FSI_config import FSIConfig diff --git a/SU2_PY/FSI_tools/switch.py b/SU2_PY/FSI_tools/switch.py deleted file mode 100644 index b42eaf6e9ddd..000000000000 --- a/SU2_PY/FSI_tools/switch.py +++ /dev/null @@ -1,52 +0,0 @@ -# ------------------------------------------------------------------- -# Switch Class -# ------------------------------------------------------------------- -# source: Brian Beck, PSF License, ActiveState Code -# http://code.activestate.com/recipes/410692/ - -class switch(object): - """ Readable switch construction - - Example: - - c = 'z' - for case in switch(c): - if case('a'): pass # only necessary if the rest of the suite is empty - if case('b'): pass - # ... - if case('y'): pass - if case('z'): - print("c is lowercase!") - break - if case('A'): pass - # ... - if case('Z'): - print("c is uppercase!") - break - if case(): # default - print("I dunno what c was!") - - source: Brian Beck, PSF License, ActiveState Code - http://code.activestate.com/recipes/410692/ - """ - - def __init__(self, value): - self.value = value - self.fall = False - - def __iter__(self): - """Return the match method once, then stop""" - yield self.match - raise StopIteration - - def match(self, *args): - """Indicate whether or not to enter a case suite""" - if self.fall or not args: - return True - elif self.value in args: - self.fall = True - return True - else: - return False - -#: class switch() diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index d3a82503448f..53226db3bc1c 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -29,12 +29,13 @@ # Imports # ---------------------------------------------------------------------- -import os, shutil, copy +import os +import shutil +import copy import numpy as np import scipy as sp import scipy.linalg as linalg from math import * -from FSI_tools.switch import switch # ---------------------------------------------------------------------- # Config class @@ -45,60 +46,56 @@ class ImposedMotionFunction: def __init__(self,time0,tipo,parameters): self.time0 = time0 self.tipo = tipo - for case in switch(self.tipo): - if case("SINUSOIDAL"): - self.bias = parameters[0] - self.amplitude = parameters[1] - self.frequency = parameters[2] - break - if case("BLENDED_STEP"): - self.kmax = parameters[0] - self.vinf = parameters[1] - self.lref = parameters[2] - self.amplitude = parameters[3] - self.tmax = 2*pi/self.kmax*self.lref/self.vinf - self.omega0 = 1/2*self.kmax - break - if case(): - raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) - break + if self.tipo == "SINUSOIDAL": + self.bias = parameters[0] + self.amplitude = parameters[1] + self.frequency = parameters[2] + + elif self.tipo == "BLENDED_STEP": + self.kmax = parameters[0] + self.vinf = parameters[1] + self.lref = parameters[2] + self.amplitude = parameters[3] + self.tmax = 2*pi/self.kmax*self.lref/self.vinf + self.omega0 = 1/2*self.kmax + + else: + raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) + def GetDispl(self,time): time = time - self.time0 - for case in switch(self.tipo): - if case("SINUSOIDAL"): - return self.bias+self.amplitude*sin(2*pi*self.frequency*time) - break - if case("BLENDED_STEP"): - if time < self.tmax: - return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) - return self.amplitude - break + if self.tipo == "SINUSOIDAL": + return self.bias+self.amplitude*sin(2*pi*self.frequency*time) + + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) + return self.amplitude + def GetVel(self,time): time = time - self.time0 - for case in switch(self.tipo): - if case("SINUSOIDAL"): - return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency - break - if case("BLENDED_STEP"): - if time < self.tmax: - return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) - return 0.0 - break + + if self.tipo == "SINUSOIDAL": + return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency + + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) + return 0.0 def GetAcc(self,time): time = time - self.time0 - for case in switch(self.tipo): - if case("SINUSOIDAL"): - return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 - break - if case("BLENDED_STEP"): - if time < self.tmax: - return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 - return 0.0 - break + + if self.tipo == "SINUSOIDAL": + return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 + + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 + return 0.0 class RefSystem: @@ -335,39 +332,37 @@ def __readConfig(self): this_param = line[0].strip() this_value = line[1].strip() - for case in switch(this_param): - #integer values - if case("NMODES") : pass - if case("RESTART_ITER") : - self.Config[this_param] = int(this_value) - break + #integer values + if (this_param == "NMODES") || \ + (this_param == "RESTART_ITER": + self.Config[this_param] = int(this_value) - #float values - if case("DELTA_T") : pass - if case("MODAL_DAMPING") : pass - if case("RHO") : - self.Config[this_param] = float(this_value) - break - #string values - if case("TIME_MARCHING") : pass - if case("MESH_FILE") : pass - if case("PUNCH_FILE") : pass - if case("RESTART_SOL") : pass - if case("MOVING_MARKER") : - self.Config[this_param] = this_value - break + #float values + elif (this_param == "DELTA_T") || \ + (this_param == "MODAL_DAMPING") || \ + (this_param == "RHO"): + self.Config[this_param] = float(this_value) - #lists values - if case("INITIAL_MODES"): pass - if case("IMPOSED_MODES"): pass - if case("IMPOSED_PARAMETERS"): - self.Config[this_param] = eval(this_value) - break - if case(): - raise Exception('{} is an invalid option !'.format(this_param)) - break + #string values + elif (this_param == "TIME_MARCHING") || \ + (this_param == "MESH_FILE") || \ + (this_param == "PUNCH_FILE") || \ + (this_param == "RESTART_SOL") || \ + (this_param == "MOVING_MARKER"): + self.Config[this_param] = this_value + + + #lists values + elif (this_param == "INITIAL_MODES") || \ + (this_param == "IMPOSED_MODES") || \ + (this_param == "IMPOSED_PARAMETERS"): + self.Config[this_param] = eval(this_value) + + + else: + raise Exception('{} is an invalid option !'.format(this_param)) From 8a5bfa0996b9ec9405e3583d546b637089facd32 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 8 Feb 2021 21:02:11 +0100 Subject: [PATCH 215/326] First fix to removed switch --- SU2_PY/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index 1deb38390c6c..38136b25db98 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -66,8 +66,7 @@ install_data(['SU2/util/bunch.py', install_data(['FSI_tools/__init__.py', 'FSI_tools/FSIInterface.py', - 'FSI_tools/FSI_config.py', - 'FSI_tools/switch.py'], + 'FSI_tools/FSI_config.py'], install_dir: join_paths(get_option('bindir'), 'FSI_tools')) install_data(['SU2_Nastran/__init__.py', From 750d4df70a158ad47b1a421693bf2dfcf9213b00 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 8 Feb 2021 21:05:44 +0100 Subject: [PATCH 216/326] fixed or --- SU2_PY/FSI_tools/FSI_config.py | 30 ++++++++++++++--------------- SU2_PY/SU2_Nastran/pysu2_nastran.py | 18 ++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index 0172e8fabfea..ec8e3c55f34d 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -89,29 +89,29 @@ def readConfig(self): this_value = line[1].strip() #integer values - if (this_param == "NDIM") || \ - (this_param == "RESTART_ITER") || \ - (this_param == "TIME_TRESHOLD") || \ + if (this_param == "NDIM") or \ + (this_param == "RESTART_ITER") or \ + (this_param == "TIME_TRESHOLD") or \ (this_param == "NB_FSI_ITER") : self._ConfigContent[this_param] = int(this_value) #float values - elif (this_param == "RBF_RADIUS") || \ - (this_param == "AITKEN_PARAM") || \ - (this_param == "UNST_TIMESTEP") || \ - (this_param == "UNST_TIME") || \ + elif (this_param == "RBF_RADIUS") or \ + (this_param == "AITKEN_PARAM") or \ + (this_param == "UNST_TIMESTEP") or \ + (this_param == "UNST_TIME") or \ (this_param == "FSI_TOLERANCE") : self._ConfigContent[this_param] = float(this_value) #string values - elif (this_param == "CFD_CONFIG_FILE_NAME") || \ - (this_param == "CSD_SOLVER") || \ - (this_param == "CSD_CONFIG_FILE_NAME") || \ - (this_param == "RESTART_SOL") || \ - (this_param == "MATCHING_MESH") || \ - (this_param == "MESH_INTERP_METHOD") || \ - (this_param == "DISP_PRED") || \ - (this_param == "AITKEN_RELAX") || \ + elif (this_param == "CFD_CONFIG_FILE_NAME") or \ + (this_param == "CSD_SOLVER") or \ + (this_param == "CSD_CONFIG_FILE_NAME") or \ + (this_param == "RESTART_SOL") or \ + (this_param == "MATCHING_MESH") or \ + (this_param == "MESH_INTERP_METHOD") or \ + (this_param == "DISP_PRED") or \ + (this_param == "AITKEN_RELAX") or \ (this_param == "TIME_MARCHING") : self._ConfigContent[this_param] = this_value diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 53226db3bc1c..d7b431d71945 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -333,30 +333,30 @@ def __readConfig(self): this_value = line[1].strip() #integer values - if (this_param == "NMODES") || \ + if (this_param == "NMODES") or \ (this_param == "RESTART_ITER": self.Config[this_param] = int(this_value) #float values - elif (this_param == "DELTA_T") || \ - (this_param == "MODAL_DAMPING") || \ + elif (this_param == "DELTA_T") or \ + (this_param == "MODAL_DAMPING") or \ (this_param == "RHO"): self.Config[this_param] = float(this_value) #string values - elif (this_param == "TIME_MARCHING") || \ - (this_param == "MESH_FILE") || \ - (this_param == "PUNCH_FILE") || \ - (this_param == "RESTART_SOL") || \ + elif (this_param == "TIME_MARCHING") or \ + (this_param == "MESH_FILE") or \ + (this_param == "PUNCH_FILE") or \ + (this_param == "RESTART_SOL") or \ (this_param == "MOVING_MARKER"): self.Config[this_param] = this_value #lists values - elif (this_param == "INITIAL_MODES") || \ - (this_param == "IMPOSED_MODES") || \ + elif (this_param == "INITIAL_MODES") or \ + (this_param == "IMPOSED_MODES") or \ (this_param == "IMPOSED_PARAMETERS"): self.Config[this_param] = eval(this_value) From a285aed6765b7c477e591eb7184cb835e13be593 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 8 Feb 2021 21:07:00 +0100 Subject: [PATCH 217/326] Small issue with parenthesis --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index d7b431d71945..00e3ba9a5a58 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -334,7 +334,7 @@ def __readConfig(self): #integer values if (this_param == "NMODES") or \ - (this_param == "RESTART_ITER": + (this_param == "RESTART_ITER"): self.Config[this_param] = int(this_value) From fbcfdc29c901a1a04f4c9eb9805b6ec27f2e9e72 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 8 Feb 2021 21:13:35 +0100 Subject: [PATCH 218/326] Uniformed indentation --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 83 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 00e3ba9a5a58..28a88c3f32eb 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -43,59 +43,58 @@ class ImposedMotionFunction: - def __init__(self,time0,tipo,parameters): - self.time0 = time0 - self.tipo = tipo - if self.tipo == "SINUSOIDAL": - self.bias = parameters[0] - self.amplitude = parameters[1] - self.frequency = parameters[2] - - elif self.tipo == "BLENDED_STEP": - self.kmax = parameters[0] - self.vinf = parameters[1] - self.lref = parameters[2] - self.amplitude = parameters[3] - self.tmax = 2*pi/self.kmax*self.lref/self.vinf - self.omega0 = 1/2*self.kmax - - else: - raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) + def __init__(self,time0,tipo,parameters): + self.time0 = time0 + self.tipo = tipo + if self.tipo == "SINUSOIDAL": + self.bias = parameters[0] + self.amplitude = parameters[1] + self.frequency = parameters[2] + + elif self.tipo == "BLENDED_STEP": + self.kmax = parameters[0] + self.vinf = parameters[1] + self.lref = parameters[2] + self.amplitude = parameters[3] + self.tmax = 2*pi/self.kmax*self.lref/self.vinf + self.omega0 = 1/2*self.kmax + else: + raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) - def GetDispl(self,time): - time = time - self.time0 - if self.tipo == "SINUSOIDAL": - return self.bias+self.amplitude*sin(2*pi*self.frequency*time) + def GetDispl(self,time): + time = time - self.time0 + if self.tipo == "SINUSOIDAL": + return self.bias+self.amplitude*sin(2*pi*self.frequency*time) - if self.tipo == "BLENDED_STEP": - if time < self.tmax: - return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) - return self.amplitude + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) + return self.amplitude - def GetVel(self,time): - time = time - self.time0 + def GetVel(self,time): + time = time - self.time0 - if self.tipo == "SINUSOIDAL": - return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency + if self.tipo == "SINUSOIDAL": + return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency - if self.tipo == "BLENDED_STEP": - if time < self.tmax: - return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) - return 0.0 + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) + return 0.0 - def GetAcc(self,time): - time = time - self.time0 + def GetAcc(self,time): + time = time - self.time0 - if self.tipo == "SINUSOIDAL": - return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 + if self.tipo == "SINUSOIDAL": + return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 - if self.tipo == "BLENDED_STEP": - if time < self.tmax: - return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 - return 0.0 + if self.tipo == "BLENDED_STEP": + if time < self.tmax: + return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 + return 0.0 class RefSystem: From 8ddba8cf92fc30dd42bbac6177fcb7a788941653 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 8 Feb 2021 23:45:57 +0000 Subject: [PATCH 219/326] add options to tune the NK strategy --- Common/include/CConfig.hpp | 16 ++- Common/include/option_structure.inl | 11 +- Common/src/CConfig.cpp | 14 +- .../integration/CNewtonIntegration.hpp | 50 +++++-- .../src/integration/CNewtonIntegration.cpp | 127 ++++++++++++++---- SU2_CFD/src/solvers/CSolver.cpp | 2 +- 6 files changed, 175 insertions(+), 45 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 66c09600f075..d1559fd937a0 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -416,7 +416,9 @@ class CConfig { unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */ bool UseVectorization; /*!< \brief Whether to use vectorized numerics schemes. */ - bool NewtonKrylov; /*!< \brief Use a coupled Newton method to solve the equations. */ + bool NewtonKrylov; /*!< \brief Use a coupled Newton method to solve the flow equations. */ + array NK_IntParam{{20, 3, 2}}; /*!< \brief Integer parameters for NK method. */ + array NK_DblParam{{-2.0, 0.1, -3.0, 1e-4}}; /*!< \brief Floating-point parameters for NK method. */ unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */ unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */ @@ -1186,6 +1188,8 @@ class CConfig { void addDoubleArrayOption(const string name, const int size, su2double* option_field); + void addUShortArrayOption(const string name, const int size, unsigned short* option_field); + void addDoubleListOption(const string name, unsigned short & size, su2double * & option_field); void addShortListOption(const string name, unsigned short & size, short * & option_field); @@ -3976,6 +3980,16 @@ class CConfig { */ bool GetNewtonKrylov(void) const { return NewtonKrylov; } + /*! + * \brief Get Newton-Krylov integer parameters. + */ + array GetNewtonKrylovIntParam(void) const { return NK_IntParam; } + + /*! + * \brief Get Newton-Krylov floating-point parameters. + */ + array GetNewtonKrylovDblParam(void) const { return NK_DblParam; } + /*! * \brief Get the relaxation coefficient of the linear solver for the implicit formulation. * \return relaxation coefficient of the linear solver for the implicit formulation. diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index e69c7762b27b..b78035d6f45a 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -334,19 +334,20 @@ public: } }; -class COptionDoubleArray : public COptionBase { +template +class COptionArray : public COptionBase { string name; // Identifier for the option const int size; // Number of elements - su2double* field; // Reference to the fieldname + Type* field; // Reference to the field public: - COptionDoubleArray(string option_field_name, const int list_size, su2double* option_field) : + COptionArray(string option_field_name, const int list_size, Type* option_field) : name(option_field_name), size(list_size), field(option_field) { } - ~COptionDoubleArray() override {}; + ~COptionArray() override {}; string SetValue(vector option_value) override { COptionBase::SetValue(option_value); @@ -368,7 +369,7 @@ public: for (int i = 0; i < this->size; i++) { istringstream is(option_value[i]); if (!(is >> field[i])) { - return badValue(option_value, "su2double array", this->name); + return badValue(option_value, " array", this->name); } } return ""; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a3e8378fab85..ba3b269eeb5d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -368,7 +368,14 @@ void CConfig::addEnumListOption(const string name, unsigned short & input_size, void CConfig::addDoubleArrayOption(const string name, const int size, su2double* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionDoubleArray(name, size, option_field); + COptionBase* val = new COptionArray(name, size, option_field); + option_map.insert(pair(name, val)); +} + +void CConfig::addUShortArrayOption(const string name, const int size, unsigned short* option_field) { + assert(option_map.find(name) == option_map.end()); + all_options.insert(pair(name, true)); + COptionBase* val = new COptionArray(name, size, option_field); option_map.insert(pair(name, val)); } @@ -1574,6 +1581,11 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Use a Newton-Krylov method. */ addBoolOption("NEWTON_KRYLOV", NewtonKrylov, false); + /* DESCRIPTION: Integer parameters {startup iters, precond iters, initial tolerance relaxation}. */ + addUShortArrayOption("NEWTON_KRYLOV_IPARAM", NK_IntParam.size(), NK_IntParam.data()); + /* DESCRIPTION: Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff step}. */ + addDoubleArrayOption("NEWTON_KRYLOV_DPARAM", NK_DblParam.size(), NK_DblParam.data()); + /* DESCRIPTION: Number of samples for quasi-Newton methods. */ addUnsignedShortOption("QUASI_NEWTON_NUM_SAMPLES", nQuasiNewtonSamples, 0); /* DESCRIPTION: Whether to use vectorized numerical schemes, less robust against transients. */ diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index 8d7e45841462..61ad020f6d41 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -63,9 +63,29 @@ class CNewtonIntegration final : public CIntegration { enum ResEvalType {EXPLICIT, DEFAULT}; bool setup = false; + Scalar finDiffStepND = 0.0; Scalar finDiffStep = 0.0; /*!< \brief Based on RMS(solution), used in matrix-free products. */ unsigned long omp_chunk_size; /*!< \brief Chunk size used in light point loops. */ + /*--- Number of iterations and tolerance for the linear preconditioner, + * 0 iterations forces "weak" preconditioning, i.e. not iterative. ---*/ + unsigned short precondIters = 0; + su2double precondTol = 0.0; + + /*--- For a number of iterations, or before a certain residual drop, + * use the quasi-Newton approach instead of Newton-Krylov. If both + * criteria are zero, or the solver does not provide a linear + * preconditioner, there is no startup phase. ---*/ + bool startupPeriod = false; + unsigned short startupIters = 0; + su2double startupResidual = 0.0; + su2double firstResidual = -20.0; + + /*--- Relax (increase) the tolerance for NK solves by a factor, until a + * certain drop in residuals, to reduce the cost of early iterations. ---*/ + unsigned short tolRelaxFactor = 0; + su2double fullTolResidual = 0.0; + CConfig* config = nullptr; CSolver** solvers = nullptr; CGeometry* geometry = nullptr; @@ -103,28 +123,35 @@ class CNewtonIntegration final : public CIntegration { mutable CSysVector precondIn, precondOut; template::value> = 0> - inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { + inline unsigned long Preconditioner_impl(const CSysVector& u, CSysVector& v, + unsigned long iters, Scalar& eps) const { CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) precondIn[i] = u[i]; - Preconditioner_impl(precondIn, precondOut); + iters = Preconditioner_impl(precondIn, precondOut, iters, eps); CNEWTON_PARFOR for (auto i = 0ul; i < u.GetLocSize(); ++i) v[i] = precondOut[i]; SU2_OMP_BARRIER + + return iters; } /*--- Otherwise they are not needed. ---*/ template::value> = 0> - inline void Preconditioner_impl(const CSysVector& u, CSysVector& v) const { - -// (*preconditioner)(u, v); - - MixedScalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); - auto iter = config->GetLinear_Solver_Iter(); + inline unsigned long Preconditioner_impl(const CSysVector& u, CSysVector& v, + unsigned long iters, Scalar& eps) const { + if (iters == 0) { + (*preconditioner)(u, v); + return 0; + } auto product = CSysMatrixVectorProduct(solvers[FLOW_SOL]->Jacobian, geometry, config); v = MixedScalar(0.0); - solvers[FLOW_SOL]->System.FGMRES_LinSolver(u, v, product, *preconditioner, eps, iter, eps, false, config, true); + MixedScalar eps_t = eps; + iters = solvers[FLOW_SOL]->System.FGMRES_LinSolver(u, v, product, *preconditioner, + eps, iters, eps_t, false, config, true); + eps = eps_t; + return iters; } /*! @@ -143,6 +170,11 @@ class CNewtonIntegration final : public CIntegration { */ void ComputeResiduals(ResEvalType type); + /*! + * \brief Compute the step size for finite differences. + */ + void ComputeFinDiffStep(); + public: /*! * \brief Constructor. diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 1398bb284928..af22c01ded42 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -63,6 +63,17 @@ CNewtonIntegration::~CNewtonIntegration() { delete preconditioner; } void CNewtonIntegration::Setup() { + auto iparam = config->GetNewtonKrylovIntParam(); + auto dparam = config->GetNewtonKrylovDblParam(); + + startupIters = iparam[0]; + startupResidual = dparam[0]; + precondIters = iparam[1]; + precondTol = dparam[1]; + tolRelaxFactor = iparam[2]; + fullTolResidual = dparam[2]; + finDiffStepND = SU2_TYPE::GetValue(dparam[3]); + const auto nVar = solvers[FLOW_SOL]->GetnVar(); const auto nPoint = geometry->GetnPoint(); const auto nPointDomain = geometry->GetnPointDomain(); @@ -95,12 +106,19 @@ void CNewtonIntegration::Setup() { preconditioner = new CPastixPreconditioner(solvers[FLOW_SOL]->Jacobian, geometry, config, config->GetKind_Linear_Solver_Prec(), false); break; + default: + SU2_MPI::Error("Unrecognized preconditioner for Newton-Krylov iterations.", CURRENT_FUNCTION); + break; } if (!std::is_same::value) { precondIn.Initialize(nPoint, nPointDomain, nVar, nullptr); precondOut.Initialize(nPoint, nPointDomain, nVar, nullptr); } + + /*--- Only possible with a preconditioner. ---*/ + startupPeriod = (startupIters > 0) || (startupResidual < 0.0); + } void CNewtonIntegration::PerturbSolution(const CSysVector& dir, Scalar mag) { @@ -136,6 +154,31 @@ void CNewtonIntegration::ComputeResiduals(ResEvalType type) { } +void CNewtonIntegration::ComputeFinDiffStep() { + + static su2double rmsSol; + su2double rmsSol_loc = 0.0; + + SU2_OMP_MASTER + rmsSol = 0.0; + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) + for (auto iVar = 0ul; iVar < solvers[FLOW_SOL]->GetnVar(); ++iVar) + rmsSol_loc += pow(solvers[FLOW_SOL]->GetNodes()->GetSolution(iPoint,iVar), 2); + + atomicAdd(rmsSol_loc, rmsSol); + + SU2_OMP_BARRIER + SU2_OMP_MASTER { + su2double t = rmsSol; + SU2_MPI::Allreduce(&t, &rmsSol, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + finDiffStep = finDiffStepND * max(1.0, sqrt(SU2_TYPE::GetValue(rmsSol) / geometry->GetGlobal_nPointDomain())); + } + SU2_OMP_BARRIER + +} + void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver *****solvers_, CNumerics ******numerics_, CConfig **config_, unsigned short EqSystem, unsigned short iZone, unsigned short iInst) { @@ -146,60 +189,75 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** if (!setup) { Setup(); setup = true; } - /*--- The step for finite-difference-based matrix-free product depends on the RMS of the solution. ---*/ - su2double rmsSol = 0.0; - SU2_OMP_PARALLEL_(if(solvers[FLOW_SOL]->GetHasHybridParallel())) { - /*--- Compute the current residual and the approximate Jacobian for preconditioning. ---*/ + /*--- Save the current solution to be able to perturb it. ---*/ + + solvers[FLOW_SOL]->Set_OldSolution(); + + /*--- Current residual. ---*/ ComputeResiduals(DEFAULT); + /*--- Compute the approximate Jacobian for preconditioning. ---*/ + solvers[FLOW_SOL]->SetTime_Step(geometry, solvers, config, MESH_0, config->GetTimeIter()); solvers[FLOW_SOL]->PrepareImplicitIteration(geometry, solvers, config); if (preconditioner) preconditioner->Build(); - /*--- Save current residuals and the solution to be able to perturb it. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) for (auto i = 0ul; i < LinSysRes.GetNElmDomain(); ++i) LinSysRes[i] = SU2_TYPE::GetValue(solvers[FLOW_SOL]->LinSysRes[i]); - solvers[FLOW_SOL]->Set_OldSolution(); + su2double residual = 0.0; + for (auto iVar = 0ul; iVar < LinSysRes.GetNVar(); ++iVar) + residual += log10(solvers[FLOW_SOL]->GetRes_RMS(iVar)) / LinSysRes.GetNVar(); - /*--- Compute RMS(solution). ---*/ + /*--- Check if startup period should end after this iteration. ---*/ - su2double rmsSol_loc = 0.0; + bool endStartup = false; - SU2_OMP_FOR_STAT(omp_chunk_size) - for (auto iPoint = 0ul; iPoint < geometry->GetnPointDomain(); ++iPoint) - for (auto iVar = 0ul; iVar < solvers[FLOW_SOL]->GetnVar(); ++iVar) - rmsSol_loc += pow(solvers[FLOW_SOL]->GetNodes()->GetSolution(iPoint,iVar), 2); + if (startupPeriod) { + SU2_OMP_MASTER + firstResidual = max(firstResidual, residual); + SU2_OMP_BARRIER + if (startupIters) startupIters -= 1; + endStartup = (startupIters == 0) && (residual - firstResidual < startupResidual); + } - atomicAdd(rmsSol_loc, rmsSol); + /*--- The NK solves are expensive, the tolerance is relaxed while the residuals are high. ---*/ - SU2_OMP_BARRIER - SU2_OMP_MASTER { - su2double t = rmsSol; - SU2_MPI::Allreduce(&t, &rmsSol, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - /// TODO: Customize the step size (1e-4). - finDiffStep = 1e-4 * max(1.0, sqrt(SU2_TYPE::GetValue(rmsSol) / geometry->GetGlobal_nPointDomain())); + Scalar toleranceFactor = 1.0; + + if (!startupPeriod && tolRelaxFactor > 1 && fullTolResidual < 0.0) { + SU2_OMP_MASTER + firstResidual = max(firstResidual, residual); + SU2_OMP_BARRIER + su2double x = (residual - firstResidual) / fullTolResidual; + toleranceFactor = 1.0 + (tolRelaxFactor-1)*max(0.0, 1.0-SU2_TYPE::GetValue(x)); } - SU2_OMP_BARRIER /*--- Solve for the solution update. ---*/ - CMatrixFreeProductWrapper product(this); - CPreconditionerWrapper precond(this); - auto& linSysSol = GetSolutionVec(solvers[FLOW_SOL]->LinSysSol); - - Scalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); auto iter = config->GetLinear_Solver_Iter(); + Scalar eps = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); - iter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, product, precond, eps, iter, eps, false, config, true); + auto& linSysSol = GetSolutionVec(solvers[FLOW_SOL]->LinSysSol); + if (startupPeriod) { + iter = Preconditioner_impl(LinSysRes, linSysSol, iter, eps); + } + else { + ComputeFinDiffStep(); + + eps *= toleranceFactor; + iter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, CMatrixFreeProductWrapper(this), + CPreconditionerWrapper(this), eps, iter, eps, false, config, true); + /*--- Scale back the residual to trick the CFL adaptation. ---*/ + eps /= toleranceFactor; + } SetSolutionResult(solvers[FLOW_SOL]->LinSysSol); SU2_OMP_MASTER { @@ -226,6 +284,18 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** solvers[FLOW_SOL]->Friction_Forces(geometry, config); } + /*--- At the end of the startup period the CFL is reset to the initial value. ---*/ + + if (endStartup) { + SU2_OMP_MASTER { + startupPeriod = false; + firstResidual = residual; + } + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < geometry->GetnPoint(); ++iPoint) + solvers[FLOW_SOL]->GetNodes()->SetLocalCFL(iPoint, config->GetCFL(MESH_0)); + } + } // end SU2_OMP_PARALLEL } @@ -263,7 +333,8 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVect void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector& v) const { if (preconditioner) { - Preconditioner_impl(u, v); + Scalar eps = SU2_TYPE::GetValue(precondTol); + Preconditioner_impl(u, v, precondIters, eps); } else { /*--- Approximate diagonal preconditioner. ---*/ diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 63af4c74fd5a..248f08956df4 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2080,7 +2080,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, signChanges += (prev > 0) ^ (val > 0); prev = val; } - reduceCFL |= (signChanges > Res_Count/4) && (totalChange > -0.5) && !config->GetNewtonKrylov(); + reduceCFL |= (signChanges > Res_Count/4) && (totalChange > -0.5); if (totalChange > 2.0) { // orders of magnitude resetCFL = true; From d4435423340aa17d9148ab4fb0a92a99feb8c9bd Mon Sep 17 00:00:00 2001 From: Florian <55834287+FlorianDm@users.noreply.github.com> Date: Tue, 9 Feb 2021 11:03:10 +0100 Subject: [PATCH 220/326] Update AUTHORS.md --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index ed5c60e4312d..2faa1f10727d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -63,7 +63,7 @@ Daumantas Kavolis Dave Taflin Eduardo Molina Ethan Alan Hereth -FlorianDm +Florian Dittmann Francisco D. Palacios Gaurav Bansal Giulio Gori From 18b592bc92bbd0541cabecef169291ae83b01a10 Mon Sep 17 00:00:00 2001 From: cvencro Date: Tue, 9 Feb 2021 10:53:34 +0000 Subject: [PATCH 221/326] update authors - alphabetical, duplication --- AUTHORS.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 2faa1f10727d..9ac39ec05e9c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -55,9 +55,10 @@ Arne Bachmann Beckett Y. Zhou Benjamin S. Kirk Brendan Tracey -Carsten Othmer Brian Munguía +Carsten Othmer Catarina Garbacz +Charanya Venkatesan-Crome Clark Pederson Daumantas Kavolis Dave Taflin @@ -68,8 +69,8 @@ Francisco D. Palacios Gaurav Bansal Giulio Gori Guillaume Bâty -HL Kline Harichand M V +HL Kline IndianaStokes J. Sinsay JSmith36 @@ -78,9 +79,9 @@ Jason Howison Jayant Mukhopadhaya Jeffrey van Oostrom Jessie Lauzon +João Loureiro Johannes Blühdorn JonathanSmith1936 -João Loureiro Kedar Naik LaSerpe Lennaert Tol @@ -122,8 +123,6 @@ bigfootedrockmidget bmunguia chamsolli costat -cr109 -cvencro daniel-linton demanosalvas dmudiger From 5f66f8191e94f621bf80c010b7648af4a0392f7e Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 9 Feb 2021 12:40:09 +0000 Subject: [PATCH 222/326] fix #1190 --- Common/src/CConfig.cpp | 13 ++- Common/src/geometry/CPhysicalGeometry.cpp | 98 ++++++++--------------- 2 files changed, 38 insertions(+), 73 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 9a0a815a4fb7..01137a94aae3 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -7236,21 +7236,18 @@ unsigned short CConfig::GetMarker_ZoneInterface(string val_marker) const { return Marker_CfgFile_ZoneInterface[iMarker_CfgFile]; } -bool CConfig::GetSolid_Wall(unsigned short iMarker) const { +bool CConfig::GetViscous_Wall(unsigned short iMarker) const { return (Marker_All_KindBC[iMarker] == HEAT_FLUX || Marker_All_KindBC[iMarker] == ISOTHERMAL || Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || - Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE || - Marker_All_KindBC[iMarker] == EULER_WALL); + Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE); } -bool CConfig::GetViscous_Wall(unsigned short iMarker) const { +bool CConfig::GetSolid_Wall(unsigned short iMarker) const { - return (Marker_All_KindBC[iMarker] == HEAT_FLUX || - Marker_All_KindBC[iMarker] == ISOTHERMAL || - Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || - Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE); + return GetViscous_Wall(iMarker) || + Marker_All_KindBC[iMarker] == EULER_WALL; } void CConfig::SetSurface_Movement(unsigned short iMarker, unsigned short kind_movement) { diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 33a75ef557f3..411e4d0c7aa0 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -4557,8 +4557,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { TotalMinCoordZ = 1E10, TotalMaxCoordX = -1E10, TotalMaxCoordY = -1E10, TotalMaxCoordZ = -1E10; su2double TotalPositiveXArea = 0.0, TotalPositiveYArea = 0.0, TotalPositiveZArea = 0.0, TotalWettedArea = 0.0, AxiFactor; - bool axisymmetric = config->GetAxisymmetric(); - bool fea = ((config->GetKind_Solver() == FEM_ELASTICITY) || (config->GetKind_Solver() == DISC_ADJ_FEM)); + const bool axisymmetric = config->GetAxisymmetric(); + const bool fea = config->GetStructuralProblem(); PositiveXArea = 0.0; PositiveYArea = 0.0; @@ -4569,12 +4569,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { Boundary = config->GetMarker_All_KindBC(iMarker); Monitoring = config->GetMarker_All_Monitoring(iMarker); - if ((((Boundary == EULER_WALL) || - (Boundary == HEAT_FLUX) || - (Boundary == ISOTHERMAL) || - (Boundary == LOAD_BOUNDARY) || - (Boundary == DISPLACEMENT_BOUNDARY)) && (Monitoring == YES)) - || (fea)) + if (((config->GetSolid_Wall(iMarker) || Boundary == LOAD_BOUNDARY || + Boundary == DISPLACEMENT_BOUNDARY) && Monitoring == YES) || fea) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); @@ -4588,8 +4584,7 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { if (axisymmetric) AxiFactor = 2.0*PI_NUMBER*nodes->GetCoord(iPoint, 1); else AxiFactor = 1.0; - if (nDim == 2) WettedArea = AxiFactor * GeometryToolbox::Norm(nDim, Normal); - if (nDim == 3) WettedArea = GeometryToolbox::Norm(nDim, Normal); + WettedArea += AxiFactor * GeometryToolbox::Norm(nDim, Normal); if (Normal[0] < 0) PositiveXArea -= Normal[0]; if (Normal[1] < 0) PositiveYArea -= Normal[1]; @@ -4605,10 +4600,9 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { if (CoordZ < MinCoordZ) MinCoordZ = CoordZ; if (CoordZ > MaxCoordZ) MaxCoordZ = CoordZ; } - } } - + } } SU2_MPI::Allreduce(&PositiveXArea, &TotalPositiveXArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); @@ -4627,80 +4621,54 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { /*--- Set a reference area if no value is provided ---*/ + const string L = (config->GetSystemMeasurements() == SI)? " m" : " ft"; + const string A = (config->GetSystemMeasurements() == SI)? " m^2" : " ft^2"; + const bool D3 = (nDim == 3); + if (config->GetRefArea() == 0.0) { - if (nDim == 3) config->SetRefArea(TotalPositiveZArea); + if (D3) config->SetRefArea(TotalPositiveZArea); else config->SetRefArea(TotalPositiveYArea); if (rank == MASTER_NODE) { - if (nDim == 3) { - cout << "Reference area = "<< TotalPositiveZArea; - if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl; - } - else { - cout << "Reference length = "<< TotalPositiveYArea; - if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; - } + if (D3) cout << "Reference area = "<< TotalPositiveZArea << A << ".\n"; + else cout << "Reference length = "<< TotalPositiveYArea << L << ".\n"; } - } /*--- Set a semi-span value if no value is provided ---*/ if (config->GetSemiSpan() == 0.0) { - if (nDim == 3) config->SetSemiSpan(fabs(TotalMaxCoordY)); + if (D3) config->SetSemiSpan(fabs(TotalMaxCoordY)); else config->SetSemiSpan(1.0); - if ((nDim == 3) && (rank == MASTER_NODE)) { - cout << "Semi-span length = "<< TotalMaxCoordY; - if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; + if (D3 && (rank == MASTER_NODE)) { + cout << "Semi-span length = "<< TotalMaxCoordY << L << ".\n"; } - } if (rank == MASTER_NODE) { if (fea) cout << "Surface area = "<< TotalWettedArea; else cout << "Wetted area = "<< TotalWettedArea; - - if ((nDim == 3) || (axisymmetric)) { if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl; } - else { if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; } - - cout << "Area projection in the x-plane = "<< TotalPositiveXArea; - if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout <<" m^2,"; else cout <<" ft^2,"; } - else { if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft,"; } - - cout << " y-plane = "<< TotalPositiveYArea; - if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout <<" m^2,"; else cout <<" ft^2,"; } - else { if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; } - - if (nDim == 3) { cout << " z-plane = "<< TotalPositiveZArea; - if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2."<< endl; } - - cout << "Max. coordinate in the x-direction = "<< TotalMaxCoordX; - if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft,"; - - cout << " y-direction = "<< TotalMaxCoordY; - if (config->GetSystemMeasurements() == SI) cout <<" m"; else cout <<" ft"; - - if (nDim == 3) { - cout << ", z-direction = "<< TotalMaxCoordZ; - if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft."<< endl; - } - else cout << "." << endl; - - cout << "Min. coordinate in the x-direction = "<< TotalMinCoordX; - if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft"; - - cout << " y-direction = "<< TotalMinCoordY; - if (config->GetSystemMeasurements() == SI) cout <<" m"; else cout <<" ft"; - - if (nDim == 3) { - cout << ", z-direction = "<< TotalMinCoordZ; - if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft."<< endl; - } - else cout << "." << endl; + if (D3 || axisymmetric) cout << A << ".\n"; + else cout << L << ".\n"; + + cout << "Area projection in the x-plane = "<< TotalPositiveXArea << (D3? A : L); + cout << ", y-plane = "<< TotalPositiveYArea << (D3? A : L); + if (D3) cout << ", z-plane = "<< TotalPositiveZArea << A; + cout << ".\n"; + + cout << "Max. coordinate in the x-direction = "<< TotalMaxCoordX << L; + cout << ", y-direction = "<< TotalMaxCoordY << L; + if (D3) cout << ", z-direction = "<< TotalMaxCoordZ << L; + cout << ".\n"; + + cout << "Min. coordinate in the x-direction = "<< TotalMinCoordX << L; + cout << ", y-direction = "<< TotalMinCoordY << L; + if (D3) cout << ", z-direction = "<< TotalMinCoordZ << L; + cout << "." << endl; } From 61bc6883cc07b0a9c8dfcd97ac7d674e0aee83b4 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 9 Feb 2021 12:47:24 +0000 Subject: [PATCH 223/326] make some things less ugly --- SU2_CFD/src/output/CFlowOutput.cpp | 55 +++++++++--------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index f0c8375a45ad..b064e6ac9a23 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -380,41 +380,23 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi } -#ifdef HAVE_MPI - - SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - -#else - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - Surface_MassFlow_Total[iMarker_Analyze] = Surface_MassFlow_Local[iMarker_Analyze]; - Surface_Mach_Total[iMarker_Analyze] = Surface_Mach_Local[iMarker_Analyze]; - Surface_Temperature_Total[iMarker_Analyze] = Surface_Temperature_Local[iMarker_Analyze]; - Surface_Density_Total[iMarker_Analyze] = Surface_Density_Local[iMarker_Analyze]; - Surface_Enthalpy_Total[iMarker_Analyze] = Surface_Enthalpy_Local[iMarker_Analyze]; - Surface_NormalVelocity_Total[iMarker_Analyze] = Surface_NormalVelocity_Local[iMarker_Analyze]; - Surface_StreamVelocity2_Total[iMarker_Analyze] = Surface_StreamVelocity2_Local[iMarker_Analyze]; - Surface_TransvVelocity2_Total[iMarker_Analyze] = Surface_TransvVelocity2_Local[iMarker_Analyze]; - Surface_Pressure_Total[iMarker_Analyze] = Surface_Pressure_Local[iMarker_Analyze]; - Surface_TotalTemperature_Total[iMarker_Analyze] = Surface_TotalTemperature_Local[iMarker_Analyze]; - Surface_TotalPressure_Total[iMarker_Analyze] = Surface_TotalPressure_Local[iMarker_Analyze]; - Surface_Area_Total[iMarker_Analyze] = Surface_Area_Local[iMarker_Analyze]; - Surface_MassFlow_Abs_Total[iMarker_Analyze] = Surface_MassFlow_Abs_Local[iMarker_Analyze]; - } - -#endif + auto Allreduce = [nMarker_Analyze](const su2double* src, su2double* dst) { + SU2_MPI::Allreduce(src, dst, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + }; + + Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total); + Allreduce(Surface_Mach_Local, Surface_Mach_Total); + Allreduce(Surface_Temperature_Local, Surface_Temperature_Total); + Allreduce(Surface_Density_Local, Surface_Density_Total); + Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total); + Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total); + Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total); + Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total); + Allreduce(Surface_Pressure_Local, Surface_Pressure_Total); + Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total); + Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total); + Allreduce(Surface_Area_Local, Surface_Area_Total); + Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total); /*--- Compute the value of Surface_Area_Total, and Surface_Pressure_Total, and set the value in the config structure for future use ---*/ @@ -918,11 +900,8 @@ void CFlowOutput::Set_CpInverseDesign(CSolver *solver, CGeometry *geometry, CCon } } -#ifdef HAVE_MPI su2double MyPressDiff = PressDiff; SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); -#endif - } /*--- Update the total Cp difference coeffient ---*/ From 742048c91bf66d10033914e5b15c45f9858e5862 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 9 Feb 2021 12:58:33 +0000 Subject: [PATCH 224/326] not rocket science --- SU2_CFD/src/output/CFlowOutput.cpp | 213 ++++++++--------------------- 1 file changed, 59 insertions(+), 154 deletions(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index b064e6ac9a23..e0b28799cf5e 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -114,38 +114,36 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi unsigned short iDim, iMarker, iMarker_Analyze; unsigned long iVertex, iPoint; su2double Mach = 0.0, Pressure, Temperature = 0.0, TotalPressure = 0.0, TotalTemperature = 0.0, - Enthalpy, Velocity[3] = {}, TangVel[3], Velocity2, MassFlow, Density, Area, + Enthalpy, Velocity[3] = {0.0}, TangVel[3], Vector[3], Velocity2, MassFlow, Density, Area, AxiFactor = 1.0, SoundSpeed, Vn, Vn2, Vtang2, Weight = 1.0; - su2double Gas_Constant = config->GetGas_ConstantND(); - su2double Gamma = config->GetGamma(); - unsigned short nMarker = config->GetnMarker_All(); - unsigned short nDim = geometry->GetnDim(); - unsigned short Kind_Average = config->GetKind_Average(); - - bool compressible = config->GetKind_Regime() == COMPRESSIBLE; - bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; - bool energy = config->GetEnergy_Equation(); - - - bool axisymmetric = config->GetAxisymmetric(); - unsigned short nMarker_Analyze = config->GetnMarker_Analyze(); - - su2double *Vector = new su2double[nDim]; - su2double *Surface_MassFlow = new su2double[nMarker]; - su2double *Surface_Mach = new su2double[nMarker]; - su2double *Surface_Temperature = new su2double[nMarker]; - su2double *Surface_Density = new su2double[nMarker]; - su2double *Surface_Enthalpy = new su2double[nMarker]; - su2double *Surface_NormalVelocity = new su2double[nMarker]; - su2double *Surface_StreamVelocity2 = new su2double[nMarker]; - su2double *Surface_TransvVelocity2 = new su2double[nMarker]; - su2double *Surface_Pressure = new su2double[nMarker]; - su2double *Surface_TotalTemperature = new su2double[nMarker]; - su2double *Surface_TotalPressure = new su2double[nMarker]; - su2double *Surface_VelocityIdeal = new su2double[nMarker]; - su2double *Surface_Area = new su2double[nMarker]; - su2double *Surface_MassFlow_Abs = new su2double[nMarker]; + const su2double Gas_Constant = config->GetGas_ConstantND(); + const su2double Gamma = config->GetGamma(); + const unsigned short nMarker = config->GetnMarker_All(); + const unsigned short nDim = geometry->GetnDim(); + const unsigned short Kind_Average = config->GetKind_Average(); + + const bool compressible = config->GetKind_Regime() == COMPRESSIBLE; + const bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; + const bool energy = config->GetEnergy_Equation(); + + const bool axisymmetric = config->GetAxisymmetric(); + const unsigned short nMarker_Analyze = config->GetnMarker_Analyze(); + + vector Surface_MassFlow (nMarker,0.0); + vector Surface_Mach (nMarker,0.0); + vector Surface_Temperature (nMarker,0.0); + vector Surface_Density (nMarker,0.0); + vector Surface_Enthalpy (nMarker,0.0); + vector Surface_NormalVelocity (nMarker,0.0); + vector Surface_StreamVelocity2 (nMarker,0.0); + vector Surface_TransvVelocity2 (nMarker,0.0); + vector Surface_Pressure (nMarker,0.0); + vector Surface_TotalTemperature (nMarker,0.0); + vector Surface_TotalPressure (nMarker,0.0); + vector Surface_VelocityIdeal (nMarker,0.0); + vector Surface_Area (nMarker,0.0); + vector Surface_MassFlow_Abs (nMarker,0.0); su2double Tot_Surface_MassFlow = 0.0; su2double Tot_Surface_Mach = 0.0; @@ -166,21 +164,6 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi for (iMarker = 0; iMarker < nMarker; iMarker++) { - Surface_MassFlow[iMarker] = 0.0; - Surface_Mach[iMarker] = 0.0; - Surface_Temperature[iMarker] = 0.0; - Surface_Density[iMarker] = 0.0; - Surface_Enthalpy[iMarker] = 0.0; - Surface_NormalVelocity[iMarker] = 0.0; - Surface_StreamVelocity2[iMarker] = 0.0; - Surface_TransvVelocity2[iMarker] = 0.0; - Surface_Pressure[iMarker] = 0.0; - Surface_TotalTemperature[iMarker] = 0.0; - Surface_TotalPressure[iMarker] = 0.0; - Surface_VelocityIdeal[iMarker] = 0.0; - Surface_Area[iMarker] = 0.0; - Surface_MassFlow_Abs[iMarker] = 0.0; - if (config->GetMarker_All_Analyze(iMarker) == YES) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -285,68 +268,35 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi /*--- Copy to the appropriate structure ---*/ - su2double *Surface_MassFlow_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Mach_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Temperature_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Density_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Enthalpy_Local = new su2double [nMarker_Analyze]; - su2double *Surface_NormalVelocity_Local = new su2double [nMarker_Analyze]; - su2double *Surface_StreamVelocity2_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TransvVelocity2_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Pressure_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TotalTemperature_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TotalPressure_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Area_Local = new su2double [nMarker_Analyze]; - su2double *Surface_MassFlow_Abs_Local = new su2double [nMarker_Analyze]; - - su2double *Surface_MassFlow_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Mach_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Temperature_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Density_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Enthalpy_Total = new su2double [nMarker_Analyze]; - su2double *Surface_NormalVelocity_Total = new su2double [nMarker_Analyze]; - su2double *Surface_StreamVelocity2_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TransvVelocity2_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Pressure_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TotalTemperature_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TotalPressure_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Area_Total = new su2double [nMarker_Analyze]; - su2double *Surface_MassFlow_Abs_Total = new su2double [nMarker_Analyze]; - - su2double *Surface_MomentumDistortion_Total = new su2double [nMarker_Analyze]; - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - Surface_MassFlow_Local[iMarker_Analyze] = 0.0; - Surface_Mach_Local[iMarker_Analyze] = 0.0; - Surface_Temperature_Local[iMarker_Analyze] = 0.0; - Surface_Density_Local[iMarker_Analyze] = 0.0; - Surface_Enthalpy_Local[iMarker_Analyze] = 0.0; - Surface_NormalVelocity_Local[iMarker_Analyze] = 0.0; - Surface_StreamVelocity2_Local[iMarker_Analyze] = 0.0; - Surface_TransvVelocity2_Local[iMarker_Analyze] = 0.0; - Surface_Pressure_Local[iMarker_Analyze] = 0.0; - Surface_TotalTemperature_Local[iMarker_Analyze] = 0.0; - Surface_TotalPressure_Local[iMarker_Analyze] = 0.0; - Surface_Area_Local[iMarker_Analyze] = 0.0; - Surface_MassFlow_Abs_Local[iMarker_Analyze] = 0.0; - - Surface_MassFlow_Total[iMarker_Analyze] = 0.0; - Surface_Mach_Total[iMarker_Analyze] = 0.0; - Surface_Temperature_Total[iMarker_Analyze] = 0.0; - Surface_Density_Total[iMarker_Analyze] = 0.0; - Surface_Enthalpy_Total[iMarker_Analyze] = 0.0; - Surface_NormalVelocity_Total[iMarker_Analyze] = 0.0; - Surface_StreamVelocity2_Total[iMarker_Analyze] = 0.0; - Surface_TransvVelocity2_Total[iMarker_Analyze] = 0.0; - Surface_Pressure_Total[iMarker_Analyze] = 0.0; - Surface_TotalTemperature_Total[iMarker_Analyze] = 0.0; - Surface_TotalPressure_Total[iMarker_Analyze] = 0.0; - Surface_Area_Total[iMarker_Analyze] = 0.0; - Surface_MassFlow_Abs_Total[iMarker_Analyze] = 0.0; - - Surface_MomentumDistortion_Total[iMarker_Analyze] = 0.0; - - } + vector Surface_MassFlow_Local (nMarker_Analyze,0.0); + vector Surface_Mach_Local (nMarker_Analyze,0.0); + vector Surface_Temperature_Local (nMarker_Analyze,0.0); + vector Surface_Density_Local (nMarker_Analyze,0.0); + vector Surface_Enthalpy_Local (nMarker_Analyze,0.0); + vector Surface_NormalVelocity_Local (nMarker_Analyze,0.0); + vector Surface_StreamVelocity2_Local (nMarker_Analyze,0.0); + vector Surface_TransvVelocity2_Local (nMarker_Analyze,0.0); + vector Surface_Pressure_Local (nMarker_Analyze,0.0); + vector Surface_TotalTemperature_Local (nMarker_Analyze,0.0); + vector Surface_TotalPressure_Local (nMarker_Analyze,0.0); + vector Surface_Area_Local (nMarker_Analyze,0.0); + vector Surface_MassFlow_Abs_Local (nMarker_Analyze,0.0); + + vector Surface_MassFlow_Total (nMarker_Analyze,0.0); + vector Surface_Mach_Total (nMarker_Analyze,0.0); + vector Surface_Temperature_Total (nMarker_Analyze,0.0); + vector Surface_Density_Total (nMarker_Analyze,0.0); + vector Surface_Enthalpy_Total (nMarker_Analyze,0.0); + vector Surface_NormalVelocity_Total (nMarker_Analyze,0.0); + vector Surface_StreamVelocity2_Total (nMarker_Analyze,0.0); + vector Surface_TransvVelocity2_Total (nMarker_Analyze,0.0); + vector Surface_Pressure_Total (nMarker_Analyze,0.0); + vector Surface_TotalTemperature_Total (nMarker_Analyze,0.0); + vector Surface_TotalPressure_Total (nMarker_Analyze,0.0); + vector Surface_Area_Total (nMarker_Analyze,0.0); + vector Surface_MassFlow_Abs_Total (nMarker_Analyze,0.0); + + vector Surface_MomentumDistortion_Total (nMarker_Analyze,0.0); /*--- Compute the numerical fan face Mach number, mach number, temperature and the total area ---*/ @@ -380,8 +330,8 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi } - auto Allreduce = [nMarker_Analyze](const su2double* src, su2double* dst) { - SU2_MPI::Allreduce(src, dst, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + auto Allreduce = [](const vector& src, vector& dst) { + SU2_MPI::Allreduce(src.data(), dst.data(), src.size(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); }; Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total); @@ -631,51 +581,6 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi } - delete [] Surface_MassFlow_Local; - delete [] Surface_Mach_Local; - delete [] Surface_Temperature_Local; - delete [] Surface_Density_Local; - delete [] Surface_Enthalpy_Local; - delete [] Surface_NormalVelocity_Local; - delete [] Surface_StreamVelocity2_Local; - delete [] Surface_TransvVelocity2_Local; - delete [] Surface_Pressure_Local; - delete [] Surface_TotalTemperature_Local; - delete [] Surface_TotalPressure_Local; - delete [] Surface_Area_Local; - delete [] Surface_MassFlow_Abs_Local; - - delete [] Surface_MassFlow_Total; - delete [] Surface_Mach_Total; - delete [] Surface_Temperature_Total; - delete [] Surface_Density_Total; - delete [] Surface_Enthalpy_Total; - delete [] Surface_NormalVelocity_Total; - delete [] Surface_StreamVelocity2_Total; - delete [] Surface_TransvVelocity2_Total; - delete [] Surface_Pressure_Total; - delete [] Surface_TotalTemperature_Total; - delete [] Surface_TotalPressure_Total; - delete [] Surface_Area_Total; - delete [] Surface_MassFlow_Abs_Total; - delete [] Surface_MomentumDistortion_Total; - - delete [] Surface_MassFlow; - delete [] Surface_Mach; - delete [] Surface_Temperature; - delete [] Surface_Density; - delete [] Surface_Enthalpy; - delete [] Surface_NormalVelocity; - delete [] Surface_StreamVelocity2; - delete [] Surface_TransvVelocity2; - delete [] Surface_Pressure; - delete [] Surface_TotalTemperature; - delete [] Surface_TotalPressure; - delete [] Surface_Area; - delete [] Vector; - delete [] Surface_VelocityIdeal; - delete [] Surface_MassFlow_Abs; - std::cout << std::resetiosflags(std::cout.flags()); } From 48f7d51e103024e3f2ae676f3288b298713bd951 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 9 Feb 2021 13:28:29 +0000 Subject: [PATCH 225/326] fix frozen limiter logic, prevent possible OpenMP bug with val-albada --- SU2_CFD/src/solvers/CEulerSolver.cpp | 35 ++++++++------------ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 42 +++++++++++------------- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 18 +++++----- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 20 +++++------ 4 files changed, 50 insertions(+), 65 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 49a8b6de539c..0a76e7466e5b 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2330,7 +2330,6 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain return; } - const auto InnerIter = config->GetInnerIter(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR) || (config->GetKind_FluidModel() == IDEAL_GAS); @@ -2340,8 +2339,7 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain const auto kind_dissipation = config->GetKind_RoeLowDiss(); const bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && - (InnerIter <= config->GetLimiterIter()); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER); const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); /*--- Non-physical counter. ---*/ @@ -2414,13 +2412,6 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain auto Gradient_i = nodes->GetGradient_Reconstruction(iPoint); auto Gradient_j = nodes->GetGradient_Reconstruction(jPoint); - su2double *Limiter_i = nullptr, *Limiter_j = nullptr; - - if (limiter) { - Limiter_i = nodes->GetLimiter_Primitive(iPoint); - Limiter_j = nodes->GetLimiter_Primitive(jPoint); - } - for (iVar = 0; iVar < nPrimVarGrad; iVar++) { su2double Project_Grad_i = 0.0; @@ -2431,20 +2422,22 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain Project_Grad_j -= Vector_ij[iDim]*Gradient_j[iVar][iDim]; } - if (limiter) { - if (van_albada) { - su2double V_ij = V_j[iVar] - V_i[iVar]; - Limiter_i[iVar] = V_ij*( 2.0*Project_Grad_i + V_ij) / (4*pow(Project_Grad_i, 2) + pow(V_ij, 2) + EPS); - Limiter_j[iVar] = V_ij*(-2.0*Project_Grad_j + V_ij) / (4*pow(Project_Grad_j, 2) + pow(V_ij, 2) + EPS); - } - Primitive_i[iVar] = V_i[iVar] + Limiter_i[iVar]*Project_Grad_i; - Primitive_j[iVar] = V_j[iVar] + Limiter_j[iVar]*Project_Grad_j; + su2double lim_i = 1.0; + su2double lim_j = 1.0; + + if (van_albada) { + su2double V_ij = V_j[iVar] - V_i[iVar]; + lim_i = V_ij*( 2.0*Project_Grad_i + V_ij) / (4*pow(Project_Grad_i, 2) + pow(V_ij, 2) + EPS); + lim_j = V_ij*(-2.0*Project_Grad_j + V_ij) / (4*pow(Project_Grad_j, 2) + pow(V_ij, 2) + EPS); } - else { - Primitive_i[iVar] = V_i[iVar] + Project_Grad_i; - Primitive_j[iVar] = V_j[iVar] + Project_Grad_j; + else if (limiter) { + lim_i = nodes->GetLimiter_Primitive(iPoint, iVar); + lim_j = nodes->GetLimiter_Primitive(jPoint, iVar); } + Primitive_i[iVar] = V_i[iVar] + lim_i * Project_Grad_i; + Primitive_j[iVar] = V_j[iVar] + lim_j * Project_Grad_j; + } /*--- Recompute the reconstructed quantities in a thermodynamically consistent way. ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 85a14c212dce..779eca23213f 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1075,11 +1075,10 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont SU2_OMP_MASTER ErrorCounter = 0; - const unsigned long InnerIter = config->GetInnerIter(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - const bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER); + const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); /*--- Loop over edge colors. ---*/ for (auto color : EdgeColoring) @@ -1120,31 +1119,31 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont auto Gradient_i = nodes->GetGradient_Reconstruction(iPoint); auto Gradient_j = nodes->GetGradient_Reconstruction(jPoint); - su2double *Limiter_i = nullptr, *Limiter_j = nullptr; + for (iVar = 0; iVar < nPrimVarGrad; iVar++) { - if (limiter) { - Limiter_i = nodes->GetLimiter_Primitive(iPoint); - Limiter_j = nodes->GetLimiter_Primitive(jPoint); - } + su2double Project_Grad_i = 0.0; + su2double Project_Grad_j = 0.0; - for (iVar = 0; iVar < nPrimVarGrad; iVar++) { - su2double Project_Grad_i = 0.0, Project_Grad_j = 0.0; for (iDim = 0; iDim < nDim; iDim++) { Project_Grad_i += Vector_ij[iDim]*Gradient_i[iVar][iDim]; Project_Grad_j -= Vector_ij[iDim]*Gradient_j[iVar][iDim]; } - if (limiter) { - if (van_albada){ - Limiter_i[iVar] = (V_j[iVar]-V_i[iVar])*(2.0*Project_Grad_i + V_j[iVar]-V_i[iVar])/(4*Project_Grad_i*Project_Grad_i+(V_j[iVar]-V_i[iVar])*(V_j[iVar]-V_i[iVar])+EPS); - Limiter_j[iVar] = (V_j[iVar]-V_i[iVar])*(-2.0*Project_Grad_j + V_j[iVar]-V_i[iVar])/(4*Project_Grad_j*Project_Grad_j+(V_j[iVar]-V_i[iVar])*(V_j[iVar]-V_i[iVar])+EPS); - } - Primitive_i[iVar] = V_i[iVar] + Limiter_i[iVar]*Project_Grad_i; - Primitive_j[iVar] = V_j[iVar] + Limiter_j[iVar]*Project_Grad_j; + + su2double lim_i = 1.0; + su2double lim_j = 1.0; + + if (van_albada) { + su2double V_ij = V_j[iVar] - V_i[iVar]; + lim_i = V_ij*( 2.0*Project_Grad_i + V_ij) / (4*pow(Project_Grad_i, 2) + pow(V_ij, 2) + EPS); + lim_j = V_ij*(-2.0*Project_Grad_j + V_ij) / (4*pow(Project_Grad_j, 2) + pow(V_ij, 2) + EPS); } - else { - Primitive_i[iVar] = V_i[iVar] + Project_Grad_i; - Primitive_j[iVar] = V_j[iVar] + Project_Grad_j; + else if (limiter) { + lim_i = nodes->GetLimiter_Primitive(iPoint, iVar); + lim_j = nodes->GetLimiter_Primitive(jPoint, iVar); } + + Primitive_i[iVar] = V_i[iVar] + lim_i * Project_Grad_i; + Primitive_j[iVar] = V_j[iVar] + lim_j * Project_Grad_j; } for (iVar = nPrimVarGrad; iVar < nPrimVar; iVar++) { @@ -1169,8 +1168,7 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont nodes->SetNon_Physical(iPoint, neg_density_i || neg_temperature_i); nodes->SetNon_Physical(jPoint, neg_density_j || neg_temperature_j); - /* Lastly, check for existing first-order points still active - from previous iterations. */ + /* Lastly, check for existing first-order points still active from previous iterations. */ if (nodes->GetNon_Physical(iPoint)) { counter_local++; diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index ac5b0032c95c..0bba15c448b1 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -326,17 +326,17 @@ void CNEMOEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_conta unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - unsigned long InnerIter = config->GetInnerIter(); - bool muscl = config->GetMUSCL_Flow(); - bool limiter = ((config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()) && !(config->GetFrozen_Limiter_Disc())); - bool center = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED; - bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; + const unsigned long InnerIter = config->GetInnerIter(); + const bool muscl = config->GetMUSCL_Flow() && (iMesh == MESH_0); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + const bool center = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED; + const bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; /*--- Common preprocessing steps ---*/ CommonPreprocessing(geometry, solver_container, config, iMesh, iRKStep, RunTime_EqSystem, Output); /*--- Upwind second order reconstruction ---*/ - if ((muscl && !center) && (iMesh == MESH_0) && !Output) { + if (muscl && !center && !Output) { /*--- Calculate the gradients ---*/ if (config->GetKind_Gradient_Method() == GREEN_GAUSS) { @@ -347,7 +347,7 @@ void CNEMOEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_conta } /*--- Limiter computation ---*/ - if ((limiter) && (iMesh == MESH_0) && !Output && !van_albada) { + if (limiter && !van_albada) { SetPrimitive_Limiter(geometry, config); } } @@ -516,11 +516,9 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con CConfig *config, unsigned short iMesh) { /*--- Set booleans based on config settings ---*/ - const auto InnerIter = config->GetInnerIter(); //const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && - (InnerIter <= config->GetLimiterIter()); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER); const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); /*--- Non-physical counter. ---*/ diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index d0f5b8996dc2..6a0bf19e7064 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -67,14 +67,11 @@ CNEMONSSolver::~CNEMONSSolver(void) { void CNEMONSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - unsigned long InnerIter = config->GetInnerIter(); - bool cont_adjoint = config->GetContinuous_Adjoint(); - bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); - bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter())); - bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; - bool muscl = config->GetMUSCL_Flow(); - bool center = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED; + const unsigned long InnerIter = config->GetInnerIter(); + const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + const bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; + const bool muscl = config->GetMUSCL_Flow() && (iMesh == MESH_0); + const bool center = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED; /*--- Common preprocessing steps (implemented by CNEMOEulerSolver) ---*/ @@ -82,7 +79,7 @@ void CNEMONSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_containe /*--- Compute gradient for MUSCL reconstruction. ---*/ - if ((muscl && !center) && (iMesh == MESH_0)) { + if (config->GetReconstructionGradientRequired() && muscl && !center) { switch (config->GetKind_Gradient_Method_Recon()) { case GREEN_GAUSS: SetPrimitive_Gradient_GG(geometry, config, true); break; @@ -102,10 +99,9 @@ void CNEMONSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_containe SetPrimitive_Gradient_LS(geometry, config); } - /*--- Compute the limiter in case we need it in the turbulence model or to limit the - * viscous terms (check this logic with JST and 2nd order turbulence model) ---*/ + /*--- Compute the limiters ---*/ - if ((iMesh == MESH_0) && (limiter_flow || limiter_turb || limiter_adjflow) && !Output && !van_albada) { + if (muscl && !center && limiter && !van_albada && !Output) { SetPrimitive_Limiter(geometry, config); } From 81c6331eb0fde11f2fd5be787dc127e14a4e1c69 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 9 Feb 2021 15:16:00 +0100 Subject: [PATCH 226/326] first attempt complete --- .../numerics/turbulent/turb_sources.hpp | 2 +- .../src/numerics/turbulent/turb_sources.cpp | 46 ++++++++++--------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 71e400ac368f..de707f203b66 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -334,7 +334,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*! * \brief Add contribution due to axisymmetric formulation to 2D residual */ - void ResidualAxisymmetric(su2double alfa_blended); + void ResidualAxisymmetric(su2double alfa_blended, su2double zeta); public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index f9215670e2f1..33a08745820b 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -849,10 +849,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi TurbVar_i[0], MeanPerturbedRSM); SetPerturbedStrainMag(TurbVar_i[0]); pk = Eddy_Viscosity_i*PerturbedStrainMag*PerturbedStrainMag - - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + - TWO3*Density_i*TurbVar_i[0]*diverg; } else { - pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - TWO3*Density_i*TurbVar_i[0]*diverg; } pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); @@ -863,10 +863,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ if (using_uq){ - pw = PerturbedStrainMag * PerturbedStrainMag - 2.0/3.0*zeta*diverg; + pw = PerturbedStrainMag * PerturbedStrainMag - TWO3*zeta*diverg; } else { - pw = StrainMag_i*StrainMag_i - 2.0/3.0*zeta*diverg; + pw = StrainMag_i*StrainMag_i - TWO3*zeta*diverg; } pw = alfa_blended*Density_i*max(pw,0.0); @@ -911,7 +911,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi /*--- Contribution due to 2D axisymmetric formulation ---*/ - if (axisymmetric) ResidualAxisymmetric(alfa_blended); + if (axisymmetric) ResidualAxisymmetric(alfa_blended,zeta); AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -937,35 +937,37 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } -void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended){ +void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ if (Coord_i[1] > EPS) { su2double yinv = 1.0/Coord_i[1]; - - /*--- Convection ---*/ - Residual[0] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[0]; - Residual[1] -= yinv*Volume*V_i[1]*Density_i*TurbVar_i[1]; - - /*--- Production ---*/ - su2double p_axi = yinv*Volume*TWO3*V_i[1]*(2*Eddy_Viscosity_i*(yinv*V_i[1]-PrimVar_Grad_i[2][1] - -PrimVar_Grad_i[1][0]) - -Density_i*TurbVar_i[0]); - Residual[0] += p_axi; - Residual[1] += p_axi*alfa_blended*Density_i/Eddy_Viscosity_i; + su2double rhov = Density_i*V_i[2]; /*--- Compute blended constants ---*/ su2double sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; su2double sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; + + /*--- Production ---*/ + su2double pk_axi = max(0.0,TWO3*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] + -PrimVar_Grad_i[1][0]) -1.0)); + su2double pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; + + /*--- Convection ---*/ + su2double ck_axi = rhov*TurbVar_i[0]; + su2double cw_axi = rhov*TurbVar_i[1]; /*--- Diffusion ---*/ - Residual[0] += yinv*Volume*(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; - Residual[1] += yinv*Volume*(Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + su2double dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + su2double dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + + Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); + Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); if (implicit) { - Jacobian_i[0][0] += yinv*Volume*ONE3*V_i[1]; - Jacobian_i[1][1] -= yinv*Volume*V_i[1]; + Jacobian_i[0][0] -= yinv*Volume*V_i[2]; + Jacobian_i[1][1] -= yinv*Volume*V_i[2]; } - + } } From c78cfce293327f06320cf21f97957509d797b2c3 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 9 Feb 2021 22:10:18 +0100 Subject: [PATCH 227/326] add diffusion terms to jacobian --- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 33a08745820b..20b44fddc336 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -965,9 +965,13 @@ void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended, su2d Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); if (implicit) { - Jacobian_i[0][0] -= yinv*Volume*V_i[2]; - Jacobian_i[1][1] -= yinv*Volume*V_i[2]; + Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); + Jacobian_i[0][1] += -yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1] + /(TurbVar_i[1]*TurbVar_i[1]); + Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; + Jacobian_i[1][1] += yinv*Volume*(-sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1] + /(TurbVar_i[1]*TurbVar_i[1])-V_i[2]); } } -} +} \ No newline at end of file From 4c5c7182aeb968b6a244a21f82d92e15cca0381a Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 9 Feb 2021 22:49:29 +0100 Subject: [PATCH 228/326] small change --- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 20b44fddc336..362efd30749a 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -966,11 +966,9 @@ void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended, su2d if (implicit) { Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); - Jacobian_i[0][1] += -yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1] - /(TurbVar_i[1]*TurbVar_i[1]); + Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; - Jacobian_i[1][1] += yinv*Volume*(-sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1] - /(TurbVar_i[1]*TurbVar_i[1])-V_i[2]); + Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); } } From 9359db749d67c8eb7c77ef53baf0bc45c4a38b51 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 10 Feb 2021 10:26:48 +0100 Subject: [PATCH 229/326] Fix Multigrid Prologantion for inc flow with GridVel. --- .gitignore | 4 ++++ .../include/variables/CIncEulerVariable.hpp | 9 ++++++++ SU2_CFD/include/variables/CVariable.hpp | 6 ++--- .../src/integration/CMultiGridIntegration.cpp | 6 ++--- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 10 ++++----- TestCases/.gitignore | 22 +++++++++++-------- 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 711b91bb5fdf..318ff72ff1be 100644 --- a/.gitignore +++ b/.gitignore @@ -79,7 +79,11 @@ TestData # Ignore output files if tests are run locally *.vtk *.vtu +*.vtm +*.pvsm *.ref +*.plt +*.szplt Mercurial .hg* diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index b2bf8b38fb7c..a92ed9734236 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -366,4 +366,13 @@ class CIncEulerVariable : public CVariable { inline su2double GetStrainMag(unsigned long iPoint) const final { return StrainMag(iPoint); } inline su2activevector& GetStrainMag() { return StrainMag; } + /*! + * \brief Specify a vector to set the velocity components of the solution. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. + */ + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = val_vector[iDim]; + } + }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index fdcfd15161dc..412753ad5f40 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -296,12 +296,12 @@ class CVariable { } /*! - * \brief Specify a vector to set the velocity components of the solution. + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. * \param[in] iPoint - Point index. * \param[in] val_vector - Pointer to the vector. */ - inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = val_vector[iDim]; + inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = Solution(iPoint, 0) * val_vector[iDim]; } /*! diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 88d0c9b68672..3b597e98ebbf 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -543,7 +543,7 @@ void CMultiGridIntegration::SetRestricted_Solution(unsigned short RunTime_EqSyst unsigned long iVertex, Point_Fine, Point_Coarse; unsigned short iMarker, iVar, iChildren, iDim; - su2double Area_Parent, Area_Children, Vector[3] = {0.0}; + su2double Area_Parent, Area_Children; const su2double *Solution_Fine = nullptr, *Grid_Vel = nullptr; const unsigned short Solver_Position = config->GetContainerPosition(RunTime_EqSystem); @@ -594,9 +594,7 @@ void CMultiGridIntegration::SetRestricted_Solution(unsigned short RunTime_EqSyst if (grid_movement) { Grid_Vel = geo_coarse->nodes->GetGridVel(Point_Coarse); - for (iDim = 0; iDim < nDim; iDim++) - Vector[iDim] = sol_coarse->GetNodes()->GetSolution(Point_Coarse,0)*Grid_Vel[iDim]; - sol_coarse->GetNodes()->SetVelSolutionVector(Point_Coarse, Vector); + sol_coarse->GetNodes()->SetVelSolutionVector(Point_Coarse, Grid_Vel); } else { /*--- For stationary no-slip walls, set the velocity to zero. ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 85a14c212dce..1176a1f48317 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -376,8 +376,8 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Get the freestream energy. Only useful if energy equation is active. ---*/ Energy_FreeStream = auxFluidModel->GetStaticEnergy() + 0.5*ModVel_FreeStream*ModVel_FreeStream; + if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream); - if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream); /*--- Compute Mach number ---*/ @@ -390,17 +390,17 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Divide by reference values, to compute the non-dimensional free-stream values ---*/ - Pressure_FreeStreamND = Pressure_FreeStream/config->GetPressure_Ref(); config->SetPressure_FreeStreamND(Pressure_FreeStreamND); + Pressure_FreeStreamND = Pressure_FreeStream/config->GetPressure_Ref(); config->SetPressure_FreeStreamND(Pressure_FreeStreamND); Pressure_ThermodynamicND = Pressure_Thermodynamic/config->GetPressure_Ref(); config->SetPressure_ThermodynamicND(Pressure_ThermodynamicND); - Density_FreeStreamND = Density_FreeStream/config->GetDensity_Ref(); config->SetDensity_FreeStreamND(Density_FreeStreamND); + Density_FreeStreamND = Density_FreeStream/config->GetDensity_Ref(); config->SetDensity_FreeStreamND(Density_FreeStreamND); for (iDim = 0; iDim < nDim; iDim++) { Velocity_FreeStreamND[iDim] = config->GetVelocity_FreeStream()[iDim]/Velocity_Ref; config->SetVelocity_FreeStreamND(Velocity_FreeStreamND[iDim], iDim); } Temperature_FreeStreamND = Temperature_FreeStream/config->GetTemperature_Ref(); config->SetTemperature_FreeStreamND(Temperature_FreeStreamND); - Gas_ConstantND = config->GetGas_Constant()/Gas_Constant_Ref; config->SetGas_ConstantND(Gas_ConstantND); - Specific_Heat_CpND = config->GetSpecific_Heat_Cp()/Gas_Constant_Ref; config->SetSpecific_Heat_CpND(Specific_Heat_CpND); + Gas_ConstantND = config->GetGas_Constant()/Gas_Constant_Ref; config->SetGas_ConstantND(Gas_ConstantND); + Specific_Heat_CpND = config->GetSpecific_Heat_Cp()/Gas_Constant_Ref; config->SetSpecific_Heat_CpND(Specific_Heat_CpND); /*--- We assume that Cp = Cv for our incompressible fluids. ---*/ Specific_Heat_CvND = config->GetSpecific_Heat_Cp()/Gas_Constant_Ref; config->SetSpecific_Heat_CvND(Specific_Heat_CvND); diff --git a/TestCases/.gitignore b/TestCases/.gitignore index 6ee7dd18cdce..315ff14f09e1 100644 --- a/TestCases/.gitignore +++ b/TestCases/.gitignore @@ -9,19 +9,23 @@ # changes to the meshes/solutions/restarts. # Things appearing in TestCases/ repo to ignore: +# mesh files *.su2 +*.cgns +*.pw + +# binary/ascii restart/solution files. Note that .csv can be a history, of_grad, etc file as well. *.dat -*.vtk *.csv -*.plt -*.szplt -*.pw + +# auto-generated files by regression tests +*.autotest +config_*.cfg + +# flip the pickle +*.pkl + *.IGS -*.cgns *.tgz COPYING -README.md -*.autotest -config_*.cfg *.eqn -*.pkl From dffd32e2df007bf84ec8fb32fcea4aba1675550e Mon Sep 17 00:00:00 2001 From: Max Aehle Date: Wed, 10 Feb 2021 10:37:33 +0100 Subject: [PATCH 230/326] Update regression tests --- TestCases/hybrid_regression.py | 6 +++--- TestCases/parallel_regression.py | 8 ++++---- TestCases/parallel_regression_AD.py | 2 +- TestCases/serial_regression.py | 8 ++++---- TestCases/serial_regression_AD.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index bf64ec6bc441..f1ea011f4f50 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -338,7 +338,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-7.852778, -2.091519, 0.029298, 1.922006] + inc_poly_cylinder.test_vals = [-7.849071, -2.092548, 0.029423, 1.922053] inc_poly_cylinder.new_output = True test_list.append(inc_poly_cylinder) @@ -478,7 +478,7 @@ def main(): Jones_tc.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc.cfg_file = "Jones.cfg" Jones_tc.test_iter = 5 - Jones_tc.test_vals = [-5.280316, 0.379651, 72.212090, 1.277440] + Jones_tc.test_vals = [-5.279930, 0.379651, 72.212090, 1.277440] Jones_tc.new_output = False test_list.append(Jones_tc) @@ -596,7 +596,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.762730, -2.263278] #last 3 columns + slinc_steady.test_vals = [19.000000, -1.800461, -2.115195] #last 3 columns slinc_steady.multizone = True test_list.append(slinc_steady) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 5a01f8177fd6..db8ffc2b94ab 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -420,7 +420,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-7.796386, -2.062578, 0.013001, 1.913804] + inc_poly_cylinder.test_vals = [-7.791831, -2.062292, 0.013040, 1.913997] inc_poly_cylinder.su2_exec = "parallel_computation.py -f" inc_poly_cylinder.timeout = 1600 inc_poly_cylinder.tol = 0.00001 @@ -910,7 +910,7 @@ def main(): Jones_tc.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc.cfg_file = "Jones.cfg" Jones_tc.test_iter = 5 - Jones_tc.test_vals = [-5.280323, 0.379652, 72.211410, 1.277509] + Jones_tc.test_vals = [-5.279937, 0.379652, 72.211410, 1.277508] Jones_tc.su2_exec = "parallel_computation.py -f" Jones_tc.timeout = 1600 Jones_tc.new_output = False @@ -934,7 +934,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.933208, 5.379977, 73.357930, 0.925863] + axial_stage2D.test_vals = [-1.933143, 5.379977, 73.357940, 0.925863] axial_stage2D.su2_exec = "parallel_computation.py -f" axial_stage2D.timeout = 1600 axial_stage2D.new_output = False @@ -1064,7 +1064,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 4 columns + slinc_steady.test_vals = [19.000000, -1.803326, -2.097400] #last 4 columns slinc_steady.su2_exec = "SU2_CFD" slinc_steady.timeout = 100 slinc_steady.tol = 0.00002 diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 212b41525ebb..daf5969d201b 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -125,7 +125,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [20.000000, -2.195519, -2.126967, 0.000000] + discadj_incomp_cylinder.test_vals = [20.000000, -2.195614, -2.162059, 0.000000] discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 36e1985f4a3a..3f75d2d9ab00 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -469,7 +469,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-8.108218, -2.158606, 0.019142, 1.902461] #last 4 columns + inc_poly_cylinder.test_vals = [-8.106741, -2.160042, 0.019225, 1.902421] #last 4 columns inc_poly_cylinder.new_output = True inc_poly_cylinder.su2_exec = "SU2_CFD" inc_poly_cylinder.timeout = 1600 @@ -1058,7 +1058,7 @@ def main(): Jones_tc.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc.cfg_file = "Jones.cfg" Jones_tc.test_iter = 5 - Jones_tc.test_vals = [-5.280323, 0.379653, 72.211730, 1.277473] #last 4 columns + Jones_tc.test_vals = [-5.279937, 0.379653, 72.211730, 1.277472] #last 4 columns Jones_tc.su2_exec = "SU2_CFD" Jones_tc.new_output = False Jones_tc.timeout = 1600 @@ -1082,7 +1082,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.933219, 5.379657, 73.357940, 0.925870] #last 4 columns + axial_stage2D.test_vals = [-1.933153, 5.379657, 73.357940, 0.925870] #last 4 columns axial_stage2D.su2_exec = "SU2_CFD" axial_stage2D.new_output = False axial_stage2D.timeout = 1600 @@ -1221,7 +1221,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 3 columns + slinc_steady.test_vals = [19.000000, -1.803326, -2.097400] #last 3 columns slinc_steady.su2_exec = "SU2_CFD" slinc_steady.timeout = 100 slinc_steady.tol = 0.00001 diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index b1081b1ab677..97f86d64a150 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -125,7 +125,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [20.000000, -2.374306, -2.371564, 0.000000] #last 4 columns + discadj_incomp_cylinder.test_vals = [20.000000, -2.373367, -2.368305, 0.000000] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 From 44aba4d5aa60a8863ea29f7d61256ce71e84b7a4 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 11 Feb 2021 09:08:27 +0100 Subject: [PATCH 231/326] Change SetVelSolutionVector function in CVariable. --- SU2_CFD/include/variables/CEulerVariable.hpp | 9 +++++++++ SU2_CFD/include/variables/CNEMOEulerVariable.hpp | 10 ++++++++++ SU2_CFD/include/variables/CVariable.hpp | 7 +++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index 8e550b28e065..ce12e7af9915 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -487,4 +487,13 @@ class CEulerVariable : public CVariable { inline su2double GetStrainMag(unsigned long iPoint) const final { return StrainMag(iPoint); } inline su2activevector& GetStrainMag() { return StrainMag; } + /*! + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. + */ + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim]; + } + }; diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index dea4fbbbb67f..42e77da5fdc4 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -576,4 +576,14 @@ class CNEMOEulerVariable : public CVariable { */ inline unsigned short GetRhoCvveIndex(void) { return RHOCVVE_INDEX; } + /*! + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. + */ + inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + SU2_MPI::Error("Please add the correct for `multigrid` + `moving grid` and Solution-Position for momentum below!", CURRENT_FUNCTION); + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, nSpecies+iDim) = GetDensity(iPoint) * val_vector[iDim]; + } + }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 412753ad5f40..efd81526190b 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -296,13 +296,12 @@ class CVariable { } /*! - * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \brief Virtual Member. Specify a vector to set the velocity components of the solution. + * Multiplied by density for compressible cases. * \param[in] iPoint - Point index. * \param[in] val_vector - Pointer to the vector. */ - inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = Solution(iPoint, 0) * val_vector[iDim]; - } + inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) { } /*! * \brief Set to zero velocity components of the solution. From 5e28b6b4c2fe873c9f393a897f8c3f52cb3d758a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 11 Feb 2021 09:10:15 +0100 Subject: [PATCH 232/326] Remove virtual --- SU2_CFD/include/variables/CNEMOEulerVariable.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index 42e77da5fdc4..3eea7ce02af2 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -581,7 +581,7 @@ class CNEMOEulerVariable : public CVariable { * \param[in] iPoint - Point index. * \param[in] val_vector - Pointer to the vector. */ - inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { SU2_MPI::Error("Please add the correct for `multigrid` + `moving grid` and Solution-Position for momentum below!", CURRENT_FUNCTION); for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, nSpecies+iDim) = GetDensity(iPoint) * val_vector[iDim]; } From 621f58b4a0b5720ab5c9f320a3f795dbffda2137 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 11 Feb 2021 11:26:59 +0000 Subject: [PATCH 233/326] fix the "velocity to zero" part for NEMO --- SU2_CFD/include/variables/CEulerVariable.hpp | 8 ++++++ .../include/variables/CIncEulerVariable.hpp | 8 ++++++ .../include/variables/CNEMOEulerVariable.hpp | 12 ++++++-- SU2_CFD/include/variables/CVariable.hpp | 28 ++----------------- .../src/integration/CMultiGridIntegration.cpp | 10 +++---- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index ce12e7af9915..24e5a0d2410d 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -428,6 +428,14 @@ class CEulerVariable : public CVariable { Solution_Old(iPoint,iDim+1) = val_velocity[iDim]*Solution(iPoint,0); } + /*! + * \brief Set the momentum part of the truncation error to zero. + * \param[in] iPoint - Point index. + */ + inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0; + } + /*! * \brief Set the harmonic balance source term. * \param[in] iVar - Index of the variable. diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index a92ed9734236..bdd874685f48 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -326,6 +326,14 @@ class CIncEulerVariable : public CVariable { Solution_Old(iPoint,iDim+1) = val_velocity[iDim]; } + /*! + * \brief Set the momentum part of the truncation error to zero. + * \param[in] iPoint - Point index. + */ + inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0; + } + /*! * \brief Set all the primitive variables for incompressible flows. */ diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index 3eea7ce02af2..b68e94984000 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -582,8 +582,16 @@ class CNEMOEulerVariable : public CVariable { * \param[in] val_vector - Pointer to the vector. */ inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { - SU2_MPI::Error("Please add the correct for `multigrid` + `moving grid` and Solution-Position for momentum below!", CURRENT_FUNCTION); - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, nSpecies+iDim) = GetDensity(iPoint) * val_vector[iDim]; + for (unsigned long iDim = 0; iDim < nDim; iDim++) + Solution(iPoint, nSpecies+iDim) = Primitive(iPoint,RHO_INDEX) * val_vector[iDim]; + } + + /*! + * \brief Set the momentum part of the truncation error to zero. + * \param[in] iPoint - Point index. + */ + inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,nSpecies+iDim) = 0.0; } }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index efd81526190b..e904d76912e9 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -287,14 +287,6 @@ class CVariable { Solution_time_n1(iPoint,iVar) = val_sol; } - /*! - * \brief Set to zero the velocity components of the solution. - * \param[in] iPoint - Point index. - */ - inline void SetVelSolutionZero(unsigned long iPoint) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint,iDim+1) = 0.0; - } - /*! * \brief Virtual Member. Specify a vector to set the velocity components of the solution. * Multiplied by density for compressible cases. @@ -303,14 +295,6 @@ class CVariable { */ inline virtual void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) { } - /*! - * \brief Set to zero velocity components of the solution. - * \param[in] iPoint - Point index. - */ - inline void SetVelSolutionOldZero(unsigned long iPoint) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution_Old(iPoint, iDim+1) = 0.0; - } - /*! * \brief Add a value to the solution. * \param[in] iPoint - Point index. @@ -510,12 +494,6 @@ class CVariable { for (unsigned long iVar = 0; iVar < nVar; iVar++) Residual_Sum(iPoint,iVar) = 0.0; } - /*! - * \brief Set the velocity of the truncation error to zero. - * \param[in] iPoint - Point index. - */ - inline virtual void SetVel_ResTruncError_Zero(unsigned long iPoint, unsigned long iSpecies) {} - /*! * \brief Get the value of the summed residual. * \param[in] iPoint - Point index. @@ -661,12 +639,10 @@ class CVariable { inline void SetVal_ResTruncError_Zero(unsigned long iPoint, unsigned long iVar) {Res_TruncError(iPoint, iVar) = 0.0;} /*! - * \brief Set the velocity of the truncation error to zero. + * \brief Set the momentum part of the truncation error to zero. * \param[in] iPoint - Point index. */ - inline void SetVel_ResTruncError_Zero(unsigned long iPoint) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0; - } + inline virtual void SetVel_ResTruncError_Zero(unsigned long iPoint) { } /*! * \brief Set the velocity of the truncation error to zero. diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 3b597e98ebbf..1143ce564e8e 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -350,7 +350,8 @@ void CMultiGridIntegration::GetProlongated_Correction(unsigned short RunTime_EqS /*--- For dirichlet boundary condtions, set the correction to zero. Note that Solution_Old stores the correction not the actual value ---*/ - sol_coarse->GetNodes()->SetVelSolutionOldZero(Point_Coarse); + su2double zero[3] = {0.0}; + sol_coarse->GetNodes()->SetVelocity_Old(Point_Coarse, zero); } } @@ -542,13 +543,12 @@ void CMultiGridIntegration::SetRestricted_Solution(unsigned short RunTime_EqSyst CGeometry *geo_fine, CGeometry *geo_coarse, CConfig *config) { unsigned long iVertex, Point_Fine, Point_Coarse; - unsigned short iMarker, iVar, iChildren, iDim; + unsigned short iMarker, iVar, iChildren; su2double Area_Parent, Area_Children; const su2double *Solution_Fine = nullptr, *Grid_Vel = nullptr; const unsigned short Solver_Position = config->GetContainerPosition(RunTime_EqSystem); const unsigned short nVar = sol_coarse->GetnVar(); - const unsigned short nDim = geo_fine->GetnDim(); const bool grid_movement = config->GetGrid_Movement(); su2double *Solution = new su2double[nVar]; @@ -598,8 +598,8 @@ void CMultiGridIntegration::SetRestricted_Solution(unsigned short RunTime_EqSyst } else { /*--- For stationary no-slip walls, set the velocity to zero. ---*/ - - sol_coarse->GetNodes()->SetVelSolutionZero(Point_Coarse); + su2double zero[3] = {0.0}; + sol_coarse->GetNodes()->SetVelSolutionVector(Point_Coarse, zero); } } From 98c89d0892a5d51d5282aae120fcac8d9c33c0ec Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 11 Feb 2021 13:46:59 +0100 Subject: [PATCH 234/326] (Re)Add moved func to fix reg test. --- SU2_CFD/include/variables/CAdjEulerVariable.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SU2_CFD/include/variables/CAdjEulerVariable.hpp b/SU2_CFD/include/variables/CAdjEulerVariable.hpp index abd52c138c24..3d0d40bbd1d3 100644 --- a/SU2_CFD/include/variables/CAdjEulerVariable.hpp +++ b/SU2_CFD/include/variables/CAdjEulerVariable.hpp @@ -102,6 +102,14 @@ class CAdjEulerVariable : public CVariable { for (unsigned long iVar = 0; iVar < nVar; iVar++) IntBoundary_Jump(iPoint,iVar) = val_IntBoundary_Jump[iVar]; } + /*! + * \brief Set the momentum part of the truncation error to zero. + * \param[in] iPoint - Point index. + */ + inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0; + } + /*! * \brief Get the value of the force projection vector. * \return Pointer to the force projection vector. From f19af6d8c78fedbba4a3c29212e0ec9eca25fcf7 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 11 Feb 2021 14:44:52 +0100 Subject: [PATCH 235/326] Now fix the reg tests for real --- .../include/variables/CAdjEulerVariable.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/SU2_CFD/include/variables/CAdjEulerVariable.hpp b/SU2_CFD/include/variables/CAdjEulerVariable.hpp index 3d0d40bbd1d3..60b47dba6101 100644 --- a/SU2_CFD/include/variables/CAdjEulerVariable.hpp +++ b/SU2_CFD/include/variables/CAdjEulerVariable.hpp @@ -102,6 +102,15 @@ class CAdjEulerVariable : public CVariable { for (unsigned long iVar = 0; iVar < nVar; iVar++) IntBoundary_Jump(iPoint,iVar) = val_IntBoundary_Jump[iVar]; } + /*! + * \brief Set the velocity vector from the old solution. + * \param[in] val_velocity - Pointer to the velocity. + */ + inline void SetVelocity_Old(unsigned long iPoint, const su2double *val_velocity) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) + Solution_Old(iPoint,iDim+1) = val_velocity[iDim]*Solution(iPoint,0); + } + /*! * \brief Set the momentum part of the truncation error to zero. * \param[in] iPoint - Point index. @@ -110,6 +119,15 @@ class CAdjEulerVariable : public CVariable { for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0; } + /*! + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. + */ + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim]; + } + /*! * \brief Get the value of the force projection vector. * \return Pointer to the force projection vector. From f3637d8239f761b0fe28db6aa5921e72de3e9a32 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Thu, 11 Feb 2021 14:54:15 +0100 Subject: [PATCH 236/326] Corrections based on PR comments --- .../numerics/turbulent/turb_sources.hpp | 46 +++- .../src/numerics/turbulent/turb_sources.cpp | 210 +++++++----------- 2 files changed, 127 insertions(+), 129 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index de707f203b66..8496fdbe8ee5 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -322,7 +322,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { bool incompressible; bool sustaining_terms; - bool implicit; bool axisymmetric; /*! @@ -334,7 +333,50 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*! * \brief Add contribution due to axisymmetric formulation to 2D residual */ - void ResidualAxisymmetric(su2double alfa_blended, su2double zeta); + inline void ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ + + if (Coord_i[1] < EPS) { + return; + } + + else{ + + su2double yinv, rhov; + su2double sigma_k_i, sigma_omega_i; + su2double pk_axi, pw_axi, ck_axi, cw_axi, dk_axi, dw_axi; + + yinv = 1.0/Coord_i[1]; + rhov = Density_i*V_i[2]; + + /*--- Compute blended constants ---*/ + sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; + sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; + + /*--- Production ---*/ + pk_axi = max(0.0,2.0/3.0*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] + -PrimVar_Grad_i[1][0]) -1.0)); + pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; + + /*--- Convection ---*/ + ck_axi = rhov*TurbVar_i[0]; + cw_axi = rhov*TurbVar_i[1]; + + /*--- Diffusion ---*/ + dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + + /*--- Add all terms to the residuals ---*/ + Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); + Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); + + /*--- Add contribution to the jacobian for implicit time integration---*/ + Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); + Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); + Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; + Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); + + } + } public: /*! diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 362efd30749a..d2459fc079e1 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -761,7 +761,6 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); - implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); axisymmetric = config->GetAxisymmetric(); /*--- Closure constants ---*/ @@ -780,11 +779,9 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, kAmb = val_kine_Inf; omegaAmb = val_omega_Inf; - if (implicit) { - /*--- "Allocate" the Jacobian using the static buffer. ---*/ - Jacobian_i[0] = Jacobian_Buffer; - Jacobian_i[1] = Jacobian_Buffer+2; - } + /*--- "Allocate" the Jacobian using the static buffer. ---*/ + Jacobian_i[0] = Jacobian_Buffer; + Jacobian_i[1] = Jacobian_Buffer+2; } @@ -822,96 +819,92 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi } Residual[0] = 0.0; Residual[1] = 0.0; - - if (implicit) { - Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; - Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = 0.0; - } - + Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; + Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = 0.0; + /*--- Computation of blended constants for the source terms---*/ alfa_blended = F1_i*alfa_1 + (1.0 - F1_i)*alfa_2; beta_blended = F1_i*beta_1 + (1.0 - F1_i)*beta_2; if (dist_i > 1e-10) { - - /*--- Production ---*/ - - diverg = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - diverg += PrimVar_Grad_i[iDim+1][iDim]; - - /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ - - if (using_uq){ - ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, - PrimVar_Grad_i+1, Density_i, Eddy_Viscosity_i, - TurbVar_i[0], MeanPerturbedRSM); - SetPerturbedStrainMag(TurbVar_i[0]); - pk = Eddy_Viscosity_i*PerturbedStrainMag*PerturbedStrainMag - - TWO3*Density_i*TurbVar_i[0]*diverg; - } - else { - pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - TWO3*Density_i*TurbVar_i[0]*diverg; - } - - pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); - pk = max(pk,0.0); - - zeta = max(TurbVar_i[1], VorticityMag*F2_i/a1); - - /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ - - if (using_uq){ - pw = PerturbedStrainMag * PerturbedStrainMag - TWO3*zeta*diverg; - } - else { - pw = StrainMag_i*StrainMag_i - TWO3*zeta*diverg; - } - pw = alfa_blended*Density_i*max(pw,0.0); - - /*--- Sustaining terms, if desired. Note that if the production terms are - larger equal than the sustaining terms, the original formulation is - obtained again. This is in contrast to the version in literature - where the sustaining terms are simply added. This latter approach could - lead to problems for very big values of the free-stream turbulence - intensity. ---*/ - - if ( sustaining_terms ) { - const su2double sust_k = beta_star*Density_i*kAmb*omegaAmb; - const su2double sust_w = beta_blended*Density_i*omegaAmb*omegaAmb; - - pk = max(pk, sust_k); - pw = max(pw, sust_w); - } - - /*--- Add the production terms to the residuals. ---*/ - - Residual[0] += pk*Volume; - Residual[1] += pw*Volume; - - /*--- Dissipation ---*/ - - Residual[0] -= beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]*Volume; - Residual[1] -= beta_blended*Density_i*TurbVar_i[1]*TurbVar_i[1]*Volume; - - /*--- Cross diffusion ---*/ - - Residual[1] += (1.0 - F1_i)*CDkw_i*Volume; - - /*--- Implicit part ---*/ - - if (implicit) { - Jacobian_i[0][0] = -beta_star*TurbVar_i[1]*Volume; - Jacobian_i[0][1] = -beta_star*TurbVar_i[0]*Volume; - Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0*beta_blended*TurbVar_i[1]*Volume; - } - } - - /*--- Contribution due to 2D axisymmetric formulation ---*/ + + /*--- Production ---*/ + + diverg = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + diverg += PrimVar_Grad_i[iDim+1][iDim]; + + /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ + + if (using_uq){ + ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, + PrimVar_Grad_i+1, Density_i, Eddy_Viscosity_i, + TurbVar_i[0], MeanPerturbedRSM); + SetPerturbedStrainMag(TurbVar_i[0]); + pk = Eddy_Viscosity_i*PerturbedStrainMag*PerturbedStrainMag + - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + } + else { + pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; + } + + + pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); + pk = max(pk,0.0); + + zeta = max(TurbVar_i[1], VorticityMag*F2_i/a1); + + /* if using UQ methodolgy, calculate production using perturbed Reynolds stress matrix */ + + if (using_uq){ + pw = PerturbedStrainMag * PerturbedStrainMag - 2.0/3.0*zeta*diverg; + } + else { + pw = StrainMag_i*StrainMag_i - 2.0/3.0*zeta*diverg; + } + pw = alfa_blended*Density_i*max(pw,0.0); + + /*--- Sustaining terms, if desired. Note that if the production terms are + larger equal than the sustaining terms, the original formulation is + obtained again. This is in contrast to the version in literature + where the sustaining terms are simply added. This latter approach could + lead to problems for very big values of the free-stream turbulence + intensity. ---*/ + + if ( sustaining_terms ) { + const su2double sust_k = beta_star*Density_i*kAmb*omegaAmb; + const su2double sust_w = beta_blended*Density_i*omegaAmb*omegaAmb; + + pk = max(pk, sust_k); + pw = max(pw, sust_w); + } + + /*--- Add the production terms to the residuals. ---*/ + + Residual[0] += pk*Volume; + Residual[1] += pw*Volume; + + /*--- Dissipation ---*/ + + Residual[0] -= beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]*Volume; + Residual[1] -= beta_blended*Density_i*TurbVar_i[1]*TurbVar_i[1]*Volume; + + /*--- Cross diffusion ---*/ + + Residual[1] += (1.0 - F1_i)*CDkw_i*Volume; + + /*--- Contribution due to 2D axisymmetric formulation ---*/ - if (axisymmetric) ResidualAxisymmetric(alfa_blended,zeta); + if (axisymmetric) ResidualAxisymmetric(alfa_blended,zeta); + + /*--- Implicit part ---*/ + + Jacobian_i[0][0] = -beta_star*TurbVar_i[1]*Volume; + Jacobian_i[0][1] = -beta_star*TurbVar_i[0]*Volume; + Jacobian_i[1][0] = 0.0; + Jacobian_i[1][1] = -2.0*beta_blended*TurbVar_i[1]*Volume; + } AD::SetPreaccOut(Residual, nVar); AD::EndPreacc(); @@ -919,7 +912,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi return ResidualType<>(Residual, Jacobian_i, nullptr); } - + void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ /*--- Compute norm of perturbed strain rate tensor. ---*/ @@ -935,41 +928,4 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } PerturbedStrainMag = sqrt(2.0*PerturbedStrainMag); -} - -void CSourcePieceWise_TurbSST::ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ - - if (Coord_i[1] > EPS) { - - su2double yinv = 1.0/Coord_i[1]; - su2double rhov = Density_i*V_i[2]; - - /*--- Compute blended constants ---*/ - su2double sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; - su2double sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; - - /*--- Production ---*/ - su2double pk_axi = max(0.0,TWO3*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] - -PrimVar_Grad_i[1][0]) -1.0)); - su2double pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; - - /*--- Convection ---*/ - su2double ck_axi = rhov*TurbVar_i[0]; - su2double cw_axi = rhov*TurbVar_i[1]; - - /*--- Diffusion ---*/ - su2double dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; - su2double dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; - - Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); - Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); - - if (implicit) { - Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); - Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); - Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; - Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); - } - - } } \ No newline at end of file From c59e7a626b818ec186c4eb3f4972808ec9c55ceb Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Thu, 11 Feb 2021 14:56:58 +0100 Subject: [PATCH 237/326] cosmetics --- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index d2459fc079e1..2bda748ccb1c 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -912,7 +912,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi return ResidualType<>(Residual, Jacobian_i, nullptr); } - + void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ /*--- Compute norm of perturbed strain rate tensor. ---*/ @@ -928,4 +928,4 @@ void CSourcePieceWise_TurbSST::SetPerturbedStrainMag(su2double turb_ke){ } PerturbedStrainMag = sqrt(2.0*PerturbedStrainMag); -} \ No newline at end of file +} From 459362a2063fd6bf2534a023990a99accc5adc52 Mon Sep 17 00:00:00 2001 From: Florian <55834287+FlorianDm@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:36:28 +0100 Subject: [PATCH 238/326] remove else --- .../numerics/turbulent/turb_sources.hpp | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 8496fdbe8ee5..a1476f6ef13b 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -338,44 +338,41 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if (Coord_i[1] < EPS) { return; } + + su2double yinv, rhov; + su2double sigma_k_i, sigma_omega_i; + su2double pk_axi, pw_axi, ck_axi, cw_axi, dk_axi, dw_axi; - else{ - - su2double yinv, rhov; - su2double sigma_k_i, sigma_omega_i; - su2double pk_axi, pw_axi, ck_axi, cw_axi, dk_axi, dw_axi; - - yinv = 1.0/Coord_i[1]; - rhov = Density_i*V_i[2]; - - /*--- Compute blended constants ---*/ - sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; - sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; - - /*--- Production ---*/ - pk_axi = max(0.0,2.0/3.0*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] - -PrimVar_Grad_i[1][0]) -1.0)); - pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; - - /*--- Convection ---*/ - ck_axi = rhov*TurbVar_i[0]; - cw_axi = rhov*TurbVar_i[1]; - - /*--- Diffusion ---*/ - dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; - dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; - - /*--- Add all terms to the residuals ---*/ - Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); - Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); + yinv = 1.0/Coord_i[1]; + rhov = Density_i*V_i[2]; - /*--- Add contribution to the jacobian for implicit time integration---*/ - Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); - Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); - Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; - Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); - - } + /*--- Compute blended constants ---*/ + sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; + sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; + + /*--- Production ---*/ + pk_axi = max(0.0,2.0/3.0*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] + -PrimVar_Grad_i[1][0]) -1.0)); + pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; + + /*--- Convection ---*/ + ck_axi = rhov*TurbVar_i[0]; + cw_axi = rhov*TurbVar_i[1]; + + /*--- Diffusion ---*/ + dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + + /*--- Add all terms to the residuals ---*/ + Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); + Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); + + /*--- Add contribution to the jacobian for implicit time integration---*/ + Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); + Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); + Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; + Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); + } public: From 63e89f190bed527a501c8020319bd934c7b9e1c4 Mon Sep 17 00:00:00 2001 From: Florian <55834287+FlorianDm@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:47:17 +0100 Subject: [PATCH 239/326] add AD::SetPreaccIn --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index a1476f6ef13b..52bb1c46cd47 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -342,7 +342,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { su2double yinv, rhov; su2double sigma_k_i, sigma_omega_i; su2double pk_axi, pw_axi, ck_axi, cw_axi, dk_axi, dw_axi; - + + AD::SetPreaccIn(Coord_i[1]); yinv = 1.0/Coord_i[1]; rhov = Density_i*V_i[2]; From e64b5922753b74b20b5966fdb2f1a723a67dbe69 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 12 Feb 2021 00:24:59 +0000 Subject: [PATCH 240/326] a little more selective CVariable allocation --- SU2_CFD/src/solvers/CEulerSolver.cpp | 2 +- SU2_CFD/src/variables/CEulerVariable.cpp | 38 +++++++++++---------- SU2_CFD/src/variables/CIncEulerVariable.cpp | 32 +++++++++-------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index ac70e217dbc7..4239796ce30a 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2253,7 +2253,7 @@ unsigned long CEulerSolver::SetPrimitive_Variables(CSolver **solver_container, c SU2_OMP_FOR_STAT(omp_chunk_size) for (unsigned long iPoint = 0; iPoint < nPoint; iPoint ++) { - /*--- Compressible flow, primitive variables nDim+5, (T, vx, vy, vz, P, rho, h, c, lamMu, eddyMu, ThCond, Cp) ---*/ + /*--- Compressible flow, primitive variables nDim+9, (T, vx, vy, vz, P, rho, h, c, lamMu, eddyMu, ThCond, Cp) ---*/ bool physical = nodes->SetPrimVar(iPoint, GetFluidModel()); nodes->SetSecondaryVar(iPoint, GetFluidModel()); diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index ccc28bcf1014..25e89c0fdf81 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -32,11 +32,11 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 unsigned long ndim, unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); - bool viscous = config->GetViscous(); - bool windgust = config->GetWind_Gust(); - bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); + const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool viscous = config->GetViscous(); + const bool windgust = config->GetWind_Gust(); + const bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); /*--- Allocate and initialize the primitive variables and gradients ---*/ @@ -59,19 +59,20 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 } } - /*--- Allocate undivided laplacian (centered) and limiter (upwind)---*/ + /*--- Allocate undivided laplacian (centered) ---*/ if (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) Undivided_Laplacian.resize(nPoint,nVar); - /*--- Always allocate the slope limiter, - and the auxiliar variables (check the logic - JST with 2nd order Turb model - ) ---*/ + /*--- Allocate the slope limiter (MUSCL upwind) ---*/ - Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); - Limiter.resize(nPoint,nVar) = su2double(0.0); - - Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); - Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); + if (config->GetMUSCL_Flow() && + config->GetKind_SlopeLimit_Flow() != NO_LIMITER && + config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); + Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); + Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); + } /*--- Solution initialization ---*/ @@ -107,17 +108,18 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 WindGustDer.resize(nPoint,nDim+1); } - /*--- Compressible flow, primitive variables nDim+5, (T, vx, vy, vz, P, rho, h, c) ---*/ + /*--- Compressible flow, primitive variables (T, vx, vy, vz, P, rho, h, c, mu, mut, k, Cp) ---*/ Primitive.resize(nPoint,nPrimVar) = su2double(0.0); Secondary.resize(nPoint,nSecondaryVar) = su2double(0.0); - /*--- Compressible flow, gradients primitive variables nDim+4, (T, vx, vy, vz, P, rho, h) - We need P, and rho for running the adjoint problem ---*/ + /*--- Compressible flow, gradients primitive variables (T, vx, vy, vz, P, rho, h) ---*/ - Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); + if (config->GetMUSCL_Flow() || viscous) { + Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); + } - if (config->GetReconstructionGradientRequired()) { + if (config->GetMUSCL_Flow() && config->GetReconstructionGradientRequired()) { Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); } diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 657081133bcf..256853580575 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -32,8 +32,9 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci unsigned long ndim, unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool viscous = config->GetViscous(); /*--- Allocate and initialize the primitive variables and gradients ---*/ @@ -53,20 +54,20 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci } } - /*--- Allocate undivided laplacian (centered) and limiter (upwind)---*/ + /*--- Allocate undivided laplacian (centered) ---*/ if (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) Undivided_Laplacian.resize(nPoint,nVar); - /*--- Always allocate the slope limiter, - and the auxiliar variables (check the logic - JST with 2nd order Turb model - ) ---*/ + /*--- Allocate the slope limiter (MUSCL upwind) ---*/ - Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); - - Limiter.resize(nPoint,nVar) = su2double(0.0); - - Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); - Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); + if (config->GetMUSCL_Flow() && + config->GetKind_SlopeLimit_Flow() != NO_LIMITER && + config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); + Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); + Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); + } /*--- Solution initialization ---*/ @@ -90,12 +91,13 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Primitive.resize(nPoint,nPrimVar) = su2double(0.0); - /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta), - We need P, and rho for running the adjoint problem ---*/ + /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta) ---*/ - Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); + if (config->GetMUSCL_Flow() || viscous) { + Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); + } - if (config->GetReconstructionGradientRequired()) { + if (config->GetMUSCL_Flow() && config->GetReconstructionGradientRequired()) { Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); } From f65b970c30deddc2b994a41ce71935e57e5d0145 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 12 Feb 2021 09:56:43 +0100 Subject: [PATCH 241/326] Fix error in merge. --- SU2_CFD/include/variables/CIncEulerVariable.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index 94dc33e01b79..bcb0b351c4e3 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -412,14 +412,15 @@ class CIncEulerVariable : public CVariable { */ inline su2double GetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint) const final { return Streamwise_Periodic_RecoveredTemperature(iPoint); + } + /*! * \brief Specify a vector to set the velocity components of the solution. * \param[in] iPoint - Point index. * \param[in] val_vector - Pointer to the vector. */ inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = val_vector[iDim]; - } }; From 4ea7de12b34d2156721e363dde31c4db6687ebfd Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 12 Feb 2021 10:28:15 +0000 Subject: [PATCH 242/326] limiter logic for output --- SU2_CFD/src/output/CFlowCompOutput.cpp | 82 +++++++++++---------- SU2_CFD/src/output/CFlowIncOutput.cpp | 81 ++++++++++---------- SU2_CFD/src/output/CNEMOCompOutput.cpp | 48 ++++++------ SU2_CFD/src/solvers/CTurbSASolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- SU2_CFD/src/variables/CEulerVariable.cpp | 6 +- SU2_CFD/src/variables/CIncEulerVariable.cpp | 6 +- 7 files changed, 122 insertions(+), 105 deletions(-) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index e07c53d3eb6e..3b6f328b533f 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -370,30 +370,32 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ break; } - // Limiter values - AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); - AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); - if (nDim == 3) { - AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); + AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); + if (nDim == 3) { + AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); + } + AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); + AddVolumeOutput("LIMITER_DENSITY", "Limiter_Density", "LIMITER", "Limiter value of the density"); + AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy"); } - AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); - AddVolumeOutput("LIMITER_DENSITY", "Limiter_Density", "LIMITER", "Limiter value of the density"); - AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy"); - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); - AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); + AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); + break; + case NONE: + break; + } } - // Hybrid RANS-LES if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ AddVolumeOutput("DES_LENGTHSCALE", "DES_LengthScale", "DDES", "DES length scale value"); @@ -522,26 +524,30 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv break; } - SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1)); - SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2)); - if (nDim == 3){ - SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1)); + SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2)); + if (nDim == 3){ + SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); + } + SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1)); + SetVolumeOutputValue("LIMITER_DENSITY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+2)); + SetVolumeOutputValue("LIMITER_ENTHALPY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+3)); } - SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1)); - SetVolumeOutputValue("LIMITER_DENSITY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+2)); - SetVolumeOutputValue("LIMITER_ENTHALPY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+3)); - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 1)); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + break; + case NONE: + break; + } } if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index b5ebcc58621d..74f6358fc4d9 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -436,25 +436,28 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ break; } - // Limiter values - AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); - AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); - AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); - if (nDim == 3) - AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); - AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); + AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); + AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); + if (nDim == 3) + AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); + AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); + } - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy."); - AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate."); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of Spalart–Allmaras variable."); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy."); + AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate."); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of Spalart–Allmaras variable."); + break; + case NONE: + break; + } } // Hybrid RANS-LES @@ -587,27 +590,31 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve break; } - SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 0)); - SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1)); - SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2)); - if (nDim == 3){ - SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); - SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 4)); - } else { - SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { + SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 0)); + SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1)); + SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2)); + if (nDim == 3){ + SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); + SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 4)); + } else { + SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); + } } - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 1)); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + break; + case NONE: + break; + } } if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index ef4e13f88eda..917823fa4fd4 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -391,17 +391,19 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_MOMENTUM-Z", "Limiter_Momentum_z", "LIMITER", "Limiter value of the z-momentum"); AddVolumeOutput("LIMITER_ENERGY", "Limiter_Energy", "LIMITER", "Limiter value of the energy"); - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); - AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); + AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); + break; + case NONE: + break; + } } // Roe Low Dissipation @@ -535,17 +537,19 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("LIMITER_ENERGY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); } - switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: - SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 1)); - break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: - SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0)); - break; - case NONE: - break; + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) { + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); + break; + case NONE: + break; + } } if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index ccb393464ea2..0c3ea4147e3b 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -257,7 +257,7 @@ void CTurbSASolver::Preprocessing(CGeometry *geometry, CSolver **solver_containe /*--- Upwind second order reconstruction and gradients ---*/ - if (config->GetReconstructionGradientRequired() && muscl) { + if (config->GetReconstructionGradientRequired()) { if (config->GetKind_Gradient_Method_Recon() == GREEN_GAUSS) SetSolution_Gradient_GG(geometry, config, true); if (config->GetKind_Gradient_Method_Recon() == LEAST_SQUARES) diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index ab5d5a3309b4..0a560888d9f6 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -255,7 +255,7 @@ void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contain /*--- Upwind second order reconstruction and gradients ---*/ - if (config->GetReconstructionGradientRequired() && muscl) { + if (config->GetReconstructionGradientRequired()) { if (config->GetKind_Gradient_Method_Recon() == GREEN_GAUSS) SetSolution_Gradient_GG(geometry, config, true); if (config->GetKind_Gradient_Method_Recon() == LEAST_SQUARES) diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 25e89c0fdf81..9a48d45d8cce 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -66,8 +66,7 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 /*--- Allocate the slope limiter (MUSCL upwind) ---*/ - if (config->GetMUSCL_Flow() && - config->GetKind_SlopeLimit_Flow() != NO_LIMITER && + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); @@ -119,7 +118,8 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); } - if (config->GetMUSCL_Flow() && config->GetReconstructionGradientRequired()) { + if (config->GetReconstructionGradientRequired() && + config->GetKind_ConvNumScheme_Flow() != SPACE_CENTERED) { Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); } diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 256853580575..1b5bbe9482cc 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -61,8 +61,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci /*--- Allocate the slope limiter (MUSCL upwind) ---*/ - if (config->GetMUSCL_Flow() && - config->GetKind_SlopeLimit_Flow() != NO_LIMITER && + if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) { Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); @@ -97,7 +96,8 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); } - if (config->GetMUSCL_Flow() && config->GetReconstructionGradientRequired()) { + if (config->GetReconstructionGradientRequired() && + config->GetKind_ConvNumScheme_Flow() != SPACE_CENTERED) { Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); } From 0dd42ad22c6bb5bec0c8f0dca6d27739071f82cf Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Fri, 12 Feb 2021 17:12:59 +0100 Subject: [PATCH 243/326] Update geo in the mesh deformation was not used --- SU2_CFD/src/drivers/CDriver.cpp | 2 +- SU2_CFD/src/solvers/CMeshSolver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 7ee5c3571587..e68f59b2ae44 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1334,7 +1334,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, if ((restart || restart_flow) && config->GetDeform_Mesh() && update_geo){ /*--- Always restart with the last state ---*/ val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; - solver[MESH_0][MESH_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); + solver[MESH_0][MESH_SOL]->LoadRestart(geometry, solver, config, val_iter); } /*--- Exit if a restart was requested for a solver that is not available. ---*/ diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 5704f6c7bbd1..3874f65fd281 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -713,7 +713,7 @@ void CMeshSolver::SetDualTime_Mesh(void){ nodes->Set_Solution_time_n(); } -void CMeshSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { +void CMeshSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter) { /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ From 2f6635a0b711a8c4493cfa0c4e0597daf8e257c8 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Fri, 12 Feb 2021 17:22:23 +0100 Subject: [PATCH 244/326] Updategeo removed from hpp files also --- SU2_CFD/include/solvers/CMeshSolver.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SU2_CFD/include/solvers/CMeshSolver.hpp b/SU2_CFD/include/solvers/CMeshSolver.hpp index 55c14d7aa6f0..e1e597323b58 100644 --- a/SU2_CFD/include/solvers/CMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CMeshSolver.hpp @@ -148,13 +148,11 @@ class CMeshSolver final : public CFEASolver { * \param[in] solver - Container vector with all of the solvers. * \param[in] config - Definition of the particular problem. * \param[in] val_iter - Current external iteration number. - * \param[in] val_update_geo - Flag for updating coords and grid velocity. */ void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, - int val_iter, - bool val_update_geo) override; + int val_iter) override; /*! * \brief Load the geometries at the previous time states n and nM1. From 38e1a6c8815766fe6b5a72e690e679bc82c5a062 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 12 Feb 2021 22:15:59 +0000 Subject: [PATCH 245/326] fix #1196 --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 4 ++-- SU2_CFD/src/numerics/turbulent/turb_sources.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index ed2e03a2e5af..f8fa6bab7111 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -51,7 +51,7 @@ class CSourceBase_TurbSA : public CNumerics { su2double cw1; su2double cr1; - su2double gamma_BC; + su2double Gamma_BC = 0.0; su2double intermittency; su2double Production, Destruction, CrossProduction; @@ -105,7 +105,7 @@ class CSourceBase_TurbSA : public CNumerics { * \brief Get the intermittency for the BC trans. model. * \return Value of the intermittency. */ - inline su2double GetGammaBC(void) const final { return gamma_BC; } + inline su2double GetGammaBC(void) const final { return Gamma_BC; } /*! * \brief ______________. diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 9164ffb9edbc..7aa25cfaf276 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -94,8 +94,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig CrossProduction = 0.0; Jacobian_i[0] = 0.0; - gamma_BC = 0.0; - /*--- Evaluate Omega ---*/ Omega = sqrt(Vorticity_i[0]*Vorticity_i[0] + Vorticity_i[1]*Vorticity_i[1] + Vorticity_i[2]*Vorticity_i[2]); @@ -153,9 +151,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig su2double term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t)); su2double term2 = sqrt(max((nu_t*chi_2)/nu,0.)); su2double term_exponential = (term1 + term2); - su2double gamma_BC = 1.0 - exp(-term_exponential); - Production = gamma_BC*cb1*Shat*TurbVar_i[0]*Volume; + Gamma_BC = 1.0 - exp(-term_exponential); + + Production = Gamma_BC*cb1*Shat*TurbVar_i[0]*Volume; } else { Production = cb1*Shat*TurbVar_i[0]*Volume; @@ -192,7 +191,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig else dShat = (fv2+TurbVar_i[0]*dfv2)*inv_k2_d2; if (transition) { - Jacobian_i[0] += gamma_BC*cb1*(TurbVar_i[0]*dShat+Shat)*Volume; + Jacobian_i[0] += Gamma_BC*cb1*(TurbVar_i[0]*dShat+Shat)*Volume; } else { Jacobian_i[0] += cb1*(TurbVar_i[0]*dShat+Shat)*Volume; From 17efe3f46dd29ab8fbb536fadbd1b95027de6ade Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 12 Feb 2021 23:54:21 +0000 Subject: [PATCH 246/326] update tests --- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index db8ffc2b94ab..c7ec41d0a580 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -559,7 +559,7 @@ def main(): schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" schubauer_klebanoff_transition.test_iter = 10 - schubauer_klebanoff_transition.test_vals = [-7.994740, -14.268326, 0.000046, 0.007987] + schubauer_klebanoff_transition.test_vals = [-7.994740, -14.268433, 0.000046, 0.007987] schubauer_klebanoff_transition.su2_exec = "parallel_computation.py -f" schubauer_klebanoff_transition.timeout = 1600 schubauer_klebanoff_transition.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 3f75d2d9ab00..55ffcd722dca 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -643,7 +643,7 @@ def main(): schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" schubauer_klebanoff_transition.test_iter = 10 schubauer_klebanoff_transition.new_output = True - schubauer_klebanoff_transition.test_vals = [-8.029786, -14.268310, 0.000053, 0.007986] #last 4 columns + schubauer_klebanoff_transition.test_vals = [-8.029786, -14.268417, 0.000053, 0.007986] #last 4 columns schubauer_klebanoff_transition.su2_exec = "SU2_CFD" schubauer_klebanoff_transition.timeout = 1600 schubauer_klebanoff_transition.tol = 0.00001 From 29b9d4c480cfeb52eaf62dbdb1ccf987c96f1305 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sat, 13 Feb 2021 10:48:54 +0000 Subject: [PATCH 247/326] cleanup, try to make vertex tractions more general --- .../include/solvers/CFVMFlowSolverBase.inl | 19 +- SU2_CFD/include/solvers/CSolver.hpp | 10 +- .../src/iteration/CDiscAdjFluidIteration.cpp | 6 +- SU2_CFD/src/python_wrapper_structure.cpp | 241 +++++------------- SU2_CFD/src/solvers/CSolver.cpp | 168 +++++------- 5 files changed, 147 insertions(+), 297 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index f17b2bb21777..865b6b216a02 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -225,11 +225,20 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { } } - /*--- Only initialize when there is a Marker_Fluid_Load defined - *--- (this avoids overhead in all other cases while a more permanent structure is being developed) ---*/ - if ((config.GetnMarker_Fluid_Load() > 0) && (MGLevel == MESH_0)) { - Alloc3D(nMarker, nVertex, nDim, VertexTraction); - if (config.GetDiscrete_Adjoint()) Alloc3D(nMarker, nVertex, nDim, VertexTractionAdjoint); + if (MGLevel == MESH_0) { + VertexTraction.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config.GetSolid_Wall(iMarker)) + VertexTraction[iMarker].resize(nVertex[iMarker], nDim) = su2double(0.0); + } + + if (config.GetDiscrete_Adjoint()) { + VertexTractionAdjoint.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config.GetSolid_Wall(iMarker)) + VertexTractionAdjoint[iMarker].resize(nVertex[iMarker], nDim) = su2double(0.0); + } + } } /*--- Initialize the BGS residuals in FSI problems. ---*/ diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 062711cb47b6..021ec21956e4 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -133,8 +133,8 @@ class CSolver { bool dynamic_grid; /*!< \brief Flag that determines whether the grid is dynamic (moving or deforming + grid velocities). */ - su2double ***VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ - su2double ***VertexTractionAdjoint; /*- Also temporary -*/ + vector VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ + vector VertexTractionAdjoint; /*- Also temporary -*/ string SolverName; /*!< \brief Store the name of the solver for output purposes. */ @@ -4339,7 +4339,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void ComputeVertexTractions(CGeometry *geometry, CConfig *config); + void ComputeVertexTractions(CGeometry *geometry, const CConfig *config); /*! * \brief Set the adjoints of the vertex tractions. @@ -4356,7 +4356,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void RegisterVertexTractions(CGeometry *geometry, CConfig *config); + void RegisterVertexTractions(CGeometry *geometry, const CConfig *config); /*! * \brief Store the adjoints of the vertex tractions. @@ -4377,7 +4377,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config); + void SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *config); /*! * \brief Get minimun volume in the mesh diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 9153084ae11c..94bfab7dc34f 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -370,7 +370,6 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry*** unsigned short iZone, unsigned short iInst) { bool frozen_visc = config[iZone]->GetFrozen_Visc_Disc(); bool heat = config[iZone]->GetWeakly_Coupled_Heat(); - bool interface_boundary = (config[iZone]->GetnMarker_Fluid_Load() > 0); /*--- Initialize the adjoints the conservative variables ---*/ @@ -390,7 +389,7 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry*** solver[iZone][iInst][MESH_0][ADJRAD_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); } - if (interface_boundary) { + if (config[iZone]->GetFluidProblem()) { solver[iZone][iInst][MESH_0][FLOW_SOL]->SetVertexTractionsAdjoint(geometry[iZone][iInst][MESH_0], config[iZone]); } } @@ -510,7 +509,6 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g COutput* output, unsigned short iZone, unsigned short iInst) { bool frozen_visc = config[iZone]->GetFrozen_Visc_Disc(); bool heat = config[iZone]->GetWeakly_Coupled_Heat(); - bool interface_boundary = (config[iZone]->GetnMarker_Fluid_Load() > 0); /*--- Register conservative variables as output of the iteration ---*/ @@ -526,7 +524,7 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g if (config[iZone]->AddRadiation()) { solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); } - if (interface_boundary) { + if (config[iZone]->GetFluidProblem()) { solver[iZone][iInst][MESH_0][FLOW_SOL]->RegisterVertexTractions(geometry[iZone][iInst][MESH_0], config[iZone]); } } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index fde9093bc583..95cbf77ec6d7 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -79,19 +79,10 @@ passivedouble CDriver::Get_Drag() { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag, RefDensity, RefArea, RefVel2, factor, val_Drag; - - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); - - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); + su2double CDrag, factor, val_Drag; /*--- Calculate drag force based on drag coefficient ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); val_Drag = CDrag*factor; @@ -103,19 +94,10 @@ passivedouble CDriver::Get_Lift() { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift, RefDensity, RefArea, RefVel2, factor, val_Lift; - - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); - - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); + su2double CLift, factor, val_Lift; /*--- Calculate drag force based on drag coefficient ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); val_Lift = CLift*factor; @@ -127,100 +109,73 @@ passivedouble CDriver::Get_Mx(){ unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMx, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_Mx; + su2double CMx, RefLengthCoeff, factor, val_Mx; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMx = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMx(); val_Mx = CMx*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_Mx); - } passivedouble CDriver::Get_My(){ unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMy, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_My; + su2double CMy, RefLengthCoeff, factor, val_My; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMy = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMy(); val_My = CMy*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_My); - } passivedouble CDriver::Get_Mz() { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMz, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_Mz; + su2double CMz, RefLengthCoeff, factor, val_Mz; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around z-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMz = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMz(); val_Mz = CMz*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_Mz); - } passivedouble CDriver::Get_DragCoeff() { - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag; + unsigned short val_iZone = ZONE_0; + unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); + su2double CDrag; - CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); + CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); - return SU2_TYPE::GetValue(CDrag); + return SU2_TYPE::GetValue(CDrag); } passivedouble CDriver::Get_LiftCoeff() { - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift; + unsigned short val_iZone = ZONE_0; + unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); + su2double CLift; - CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); + CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); - return SU2_TYPE::GetValue(CLift); + return SU2_TYPE::GetValue(CLift); } unsigned short CDriver::GetMovingMarker() { @@ -305,55 +260,39 @@ passivedouble CDriver::GetUnsteady_TimeStep(){ passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned long iVertex) { - su2double* Coord; - unsigned long iPoint; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); return SU2_TYPE::GetValue(Coord[0]); - } passivedouble CDriver::GetVertexCoordY(unsigned short iMarker, unsigned long iVertex) { - su2double* Coord; - unsigned long iPoint; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); return SU2_TYPE::GetValue(Coord[1]); } passivedouble CDriver::GetVertexCoordZ(unsigned short iMarker, unsigned long iVertex) { - su2double* Coord; - unsigned long iPoint; - - if(nDim == 3) { - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[2]); - } - else { - return 0.0; - } + if(nDim == 2) return 0.0; + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + return SU2_TYPE::GetValue(Coord[2]); } bool CDriver::ComputeVertexForces(unsigned short iMarker, unsigned long iVertex) { unsigned long iPoint; - unsigned short iDim, jDim; - su2double *Normal, AreaSquare, Area; - bool halo; + unsigned short iDim; + su2double *Normal, Area; unsigned short FinestMesh = config_container[ZONE_0]->GetFinestMesh(); /*--- Check the kind of fluid problem ---*/ bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); bool incompressible = (config_container[ZONE_0]->GetKind_Regime() == INCOMPRESSIBLE); - bool viscous_flow = ((config_container[ZONE_0]->GetKind_Solver() == NAVIER_STOKES) || - (config_container[ZONE_0]->GetKind_Solver() == RANS) ); + bool viscous_flow = config_container[ZONE_0]->GetViscous(); /*--- Parameters for the calculations ---*/ // Pn: Pressure @@ -367,68 +306,50 @@ bool CDriver::ComputeVertexForces(unsigned short iMarker, unsigned long iVertex) iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); /*--- It is necessary to distinguish the halo nodes from the others, since they introduce non physical forces. ---*/ - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)) { - /*--- Get the normal at the vertex: this normal goes inside the fluid domain. ---*/ - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - AreaSquare = 0.0; - for(iDim = 0; iDim < nDim; iDim++) { - AreaSquare += Normal[iDim]*Normal[iDim]; - } - Area = sqrt(AreaSquare); + if (!geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)) + return true; - /*--- Get the values of pressure and viscosity ---*/ - Pn = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetPressure(iPoint); - if (viscous_flow) { - Viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - } + /*--- Get the normal at the vertex: this normal goes inside the fluid domain. ---*/ + Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); + Area = GeometryToolbox::Norm(nDim, Normal); - /*--- Calculate the inviscid (pressure) part of tn in the fluid nodes (force units) ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForce[iDim] = -(Pn-Pinf)*Normal[iDim]; //NB : norm(Normal) = Area - } + /*--- Get the values of pressure and viscosity ---*/ + Pn = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetPressure(iPoint); + if (viscous_flow) { + Viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); + } - /*--- Calculate the viscous (shear stress) part of tn in the fluid nodes (force units) ---*/ - if ((incompressible || compressible) && viscous_flow) { - CNumerics::ComputeStressTensor(nDim, Tau, - solver_container[ZONE_0][INST_0][FinestMesh][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint)+1, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - for (jDim = 0 ; jDim < nDim; jDim++) { - PyWrapNodalForce[iDim] += Tau[iDim][jDim]*Normal[jDim]; - } - } - } + /*--- Calculate the inviscid (pressure) part of tn in the fluid nodes (force units) ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + PyWrapNodalForce[iDim] = -(Pn-Pinf)*Normal[iDim]; //NB : norm(Normal) = Area + } - //Divide by local are in case of force density communication. - for(iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForceDensity[iDim] = PyWrapNodalForce[iDim]/Area; + /*--- Calculate the viscous (shear stress) part of tn in the fluid nodes (force units) ---*/ + if ((incompressible || compressible) && viscous_flow) { + CNumerics::ComputeStressTensor(nDim, Tau, + solver_container[ZONE_0][INST_0][FinestMesh][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint)+1, Viscosity); + for (iDim = 0; iDim < nDim; iDim++) { + PyWrapNodalForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); } - - halo = false; - } - else { - halo = true; } - return halo; + //Divide by local are in case of force density communication. + for(iDim = 0; iDim < nDim; iDim++) + PyWrapNodalForceDensity[iDim] = PyWrapNodalForce[iDim]/Area; + return false; } passivedouble CDriver::GetVertexForceX(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[0]); - } passivedouble CDriver::GetVertexForceY(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[1]); - } passivedouble CDriver::GetVertexForceZ(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[2]); - } passivedouble CDriver::GetVertexForceDensityX(unsigned short iMarker, unsigned long iVertex) { @@ -445,34 +366,24 @@ passivedouble CDriver::GetVertexForceDensityZ(unsigned short iMarker, unsigned l void CDriver::SetVertexCoordX(unsigned short iMarker, unsigned long iVertex, passivedouble newPosX) { - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); PyWrapVarCoord[0] = newPosX - Coord[0]; - } void CDriver::SetVertexCoordY(unsigned short iMarker, unsigned long iVertex, passivedouble newPosY) { - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); PyWrapVarCoord[1] = newPosY - Coord[1]; } void CDriver::SetVertexCoordZ(unsigned short iMarker, unsigned long iVertex, passivedouble newPosZ) { - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); if(nDim > 2) { PyWrapVarCoord[2] = newPosZ - Coord[2]; @@ -486,8 +397,8 @@ passivedouble CDriver::SetVertexVarCoord(unsigned short iMarker, unsigned long i su2double nodalVarCoordNorm; - geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->SetVarCoord(PyWrapVarCoord); - nodalVarCoordNorm = sqrt((PyWrapVarCoord[0])*(PyWrapVarCoord[0]) + (PyWrapVarCoord[1])*(PyWrapVarCoord[1]) + (PyWrapVarCoord[2])*(PyWrapVarCoord[2])); + geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->SetVarCoord(PyWrapVarCoord); + nodalVarCoordNorm = sqrt((PyWrapVarCoord[0])*(PyWrapVarCoord[0]) + (PyWrapVarCoord[1])*(PyWrapVarCoord[1]) + (PyWrapVarCoord[2])*(PyWrapVarCoord[2])); return SU2_TYPE::GetValue(nodalVarCoordNorm); @@ -652,8 +563,6 @@ vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsig ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); return ret_Normal_passive; - - } vector CDriver::GetAllBoundaryMarkersTag(){ @@ -957,9 +866,7 @@ void CFluidDriver::BoundaryConditionsUpdate(){ int rank = MASTER_NODE; unsigned short iZone; -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); if(rank == MASTER_NODE) cout << "Updating boundary conditions." << endl; for(iZone = 0; iZone < nZone; iZone++){ @@ -1070,11 +977,6 @@ vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned else Velocity[2] = 0.0; } - else{ - Velocity[0] = 0.0; - Velocity[1] = 0.0; - Velocity[2] = 0.0; - } Velocity_passive[0] = SU2_TYPE::GetValue(Velocity[0]); Velocity_passive[1] = SU2_TYPE::GetValue(Velocity[1]); @@ -1101,11 +1003,6 @@ vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigne else Velocity_n[2] = 0.0; } - else{ - Velocity_n[0] = 0.0; - Velocity_n[1] = 0.0; - Velocity_n[2] = 0.0; - } Velocity_n_passive[0] = SU2_TYPE::GetValue(Velocity_n[0]); Velocity_n_passive[1] = SU2_TYPE::GetValue(Velocity_n[1]); @@ -1156,11 +1053,6 @@ vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long else FlowLoad[2] = 0.0; } - else{ - FlowLoad[0] = 0.0; - FlowLoad[1] = 0.0; - FlowLoad[2] = 0.0; - } FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); @@ -1217,11 +1109,6 @@ vector CDriver::GetVertex_UndeformedCoord(unsigned short iMarker, else MeshCoord[2] = 0.0; } - else{ - MeshCoord[0] = 0.0; - MeshCoord[1] = 0.0; - MeshCoord[2] = 0.0; - } MeshCoord_passive[0] = SU2_TYPE::GetValue(MeshCoord[0]); MeshCoord_passive[1] = SU2_TYPE::GetValue(MeshCoord[1]); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index f608da291387..a29ab35b1fee 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -119,10 +119,6 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { /*--- Flags for the dynamic grid (rigid movement or unsteady deformation). ---*/ dynamic_grid = false; - /*--- Container to store the vertex tractions. ---*/ - VertexTraction = nullptr; - VertexTractionAdjoint = nullptr; - /*--- Auxiliary data needed for CFL adaption. ---*/ Old_Func = 0; @@ -137,7 +133,6 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { CSolver::~CSolver(void) { unsigned short iVar; - unsigned long iMarker, iVertex; /*--- Public variables, may be accessible outside ---*/ @@ -222,24 +217,6 @@ CSolver::~CSolver(void) { delete [] Jacobian_jj; } - if (VertexTraction != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - delete [] VertexTraction[iMarker][iVertex]; - delete [] VertexTraction[iMarker]; - } - delete [] VertexTraction; - } - - if (VertexTractionAdjoint != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - delete [] VertexTractionAdjoint[iMarker][iVertex]; - delete [] VertexTractionAdjoint[iMarker]; - } - delete [] VertexTractionAdjoint; - } - delete [] nVertex; delete [] Restart_Vars; @@ -4014,24 +3991,17 @@ void CSolver::LoadInletProfile(CGeometry **geometry, } -void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ +void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config){ /*--- Compute the constant factor to dimensionalize pressure and shear stress. ---*/ - su2double *Velocity_ND, *Velocity_Real; + const su2double *Velocity_ND, *Velocity_Real; su2double Density_ND, Density_Real, Velocity2_Real, Velocity2_ND; su2double factor; - unsigned short iDim, jDim; + unsigned short iDim; // Check whether the problem is viscous - bool viscous_flow = ((config->GetKind_Solver() == NAVIER_STOKES) || - (config->GetKind_Solver() == INC_NAVIER_STOKES) || - (config->GetKind_Solver() == RANS) || - (config->GetKind_Solver() == INC_RANS) || - (config->GetKind_Solver() == DISC_ADJ_NAVIER_STOKES) || - (config->GetKind_Solver() == DISC_ADJ_INC_NAVIER_STOKES) || - (config->GetKind_Solver() == DISC_ADJ_INC_RANS) || - (config->GetKind_Solver() == DISC_ADJ_RANS)); + bool viscous_flow = config->GetViscous(); // Parameters for the calculations su2double Pn = 0.0; @@ -4039,7 +4009,7 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ unsigned short iMarker; unsigned long iVertex, iPoint; - su2double const *iNormal; + const su2double* iNormal; su2double Pressure_Inf = config->GetPressure_FreeStreamND(); @@ -4049,59 +4019,52 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ Velocity_ND = config->GetVelocity_FreeStreamND(); Density_ND = config->GetDensity_FreeStreamND(); - Velocity2_Real = 0.0; - Velocity2_ND = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Velocity2_Real += Velocity_Real[iDim]*Velocity_Real[iDim]; - Velocity2_ND += Velocity_ND[iDim]*Velocity_ND[iDim]; - } + Velocity2_Real = GeometryToolbox::SquaredNorm(nDim, Velocity_Real); + Velocity2_ND = GeometryToolbox::SquaredNorm(nDim, Velocity_ND); factor = Density_Real * Velocity2_Real / ( Density_ND * Velocity2_ND ); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - // Loop over the vertices - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + // Loop over the vertices + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - // Recover the point index - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - // Get the normal at the vertex: this normal goes inside the fluid domain. - iNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + // Recover the point index + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + // Get the normal at the vertex: this normal goes inside the fluid domain. + iNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (geometry->nodes->GetDomain(iPoint)) { - // Retrieve the values of pressure - Pn = base_nodes->GetPressure(iPoint); + // Retrieve the values of pressure + Pn = base_nodes->GetPressure(iPoint); - // Calculate tn in the fluid nodes for the inviscid term --> Units of force (non-dimensional). - for (iDim = 0; iDim < nDim; iDim++) - auxForce[iDim] = -(Pn-Pressure_Inf)*iNormal[iDim]; + // Calculate tn in the fluid nodes for the inviscid term --> Units of force (non-dimensional). + for (iDim = 0; iDim < nDim; iDim++) + auxForce[iDim] = -(Pn-Pressure_Inf)*iNormal[iDim]; - // Calculate tn in the fluid nodes for the viscous term - if (viscous_flow) { - su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); - su2double Tau[3][3]; - CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetGradient_Primitive(iPoint)+1, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - for (jDim = 0 ; jDim < nDim; jDim++) { - auxForce[iDim] += Tau[iDim][jDim]*iNormal[jDim]; - } - } - } - - // Redimensionalize the forces + // Calculate tn in the fluid nodes for the viscous term + if (viscous_flow) { + su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); + su2double Tau[3][3]; + CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetGradient_Primitive(iPoint)+1, Viscosity); for (iDim = 0; iDim < nDim; iDim++) { - VertexTraction[iMarker][iVertex][iDim] = factor * auxForce[iDim]; + auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], iNormal); } } - else{ - for (iDim = 0; iDim < nDim; iDim++) { - VertexTraction[iMarker][iVertex][iDim] = 0.0; - } + + // Redimensionalize the forces + for (iDim = 0; iDim < nDim; iDim++) { + VertexTraction[iMarker][iVertex][iDim] = factor * auxForce[iDim]; + } + } + else{ + for (iDim = 0; iDim < nDim; iDim++) { + VertexTraction[iMarker][iVertex][iDim] = 0.0; } } } @@ -4109,7 +4072,7 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ } -void CSolver::RegisterVertexTractions(CGeometry *geometry, CConfig *config){ +void CSolver::RegisterVertexTractions(CGeometry *geometry, const CConfig *config){ unsigned short iMarker, iDim; unsigned long iVertex, iPoint; @@ -4117,31 +4080,28 @@ void CSolver::RegisterVertexTractions(CGeometry *geometry, CConfig *config){ /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - /*--- Loop over the vertices ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + /*--- Loop over the vertices ---*/ + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Recover the point index ---*/ - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + /*--- Recover the point index ---*/ + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Register the vertex traction as output ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - AD::RegisterOutput(VertexTraction[iMarker][iVertex][iDim]); - } + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - } + /*--- Register the vertex traction as output ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + AD::RegisterOutput(VertexTraction[iMarker][iVertex][iDim]); } } } } -void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config){ +void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *config){ unsigned short iMarker, iDim; unsigned long iVertex, iPoint; @@ -4149,26 +4109,22 @@ void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config){ /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { - - /*--- Loop over the vertices ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - /*--- Recover the point index ---*/ - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + /*--- Loop over the vertices ---*/ + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Set the adjoint of the vertex traction from the value received ---*/ - for (iDim = 0; iDim < nDim; iDim++) { + /*--- Recover the point index ---*/ + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - SU2_TYPE::SetDerivative(VertexTraction[iMarker][iVertex][iDim], - SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); - } + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - } + /*--- Set the adjoint of the vertex traction from the value received ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + SU2_TYPE::SetDerivative(VertexTraction[iMarker][iVertex][iDim], + SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); } } } From 0f9342fd6d81fed5557e19a806f1223f2b6dbae9 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 15:13:50 +0100 Subject: [PATCH 248/326] Several modifications to clean up the FSI interface --- SU2_PY/FSI_tools/FSIInterface.py | 280 ++++++++++++++-------------- SU2_PY/SU2_Nastran/pysu2_nastran.py | 6 +- 2 files changed, 146 insertions(+), 140 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index d3d10cc58191..62438de8388b 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -114,7 +114,9 @@ def __init__(self, FSI_config, FluidSolver, SolidSolver, have_MPI): self.localFluidInterface_array_Y_init = None self.localFluidInterface_array_Z_init = None - self.haloNodesPositionsInit = {} #initial position of the halo nodes (fluid side only) + self.localSolidInterface_array_X_init = None #initial solid interface position on each partition (used for mesh mapping) + self.localSolidInterface_array_Y_init = None + self.localSolidInterface_array_Z_init = None self.solidInterface_array_DispX = None #solid interface displacement self.solidInterface_array_DispY = None @@ -311,6 +313,7 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): # Same thing for the solid part self.nLocalSolidInterfaceHaloNode = 0 + # TODO when the solid solver will run in parallel, add here the calculation of halo nodes self.nLocalSolidInterfacePhysicalNodes = self.nLocalSolidInterfaceNodes - self.nLocalSolidInterfaceHaloNode if self.have_MPI: self.SolidHaloNodeList = self.comm.allgather(self.SolidHaloNodeList) @@ -319,36 +322,36 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): # --- Calculate the total number of nodes (with and without halo) at the fluid interface (sum over all the partitions) and broadcast the number accross all processors --- - sendBuffHalo = np.array(int(self.nLocalFluidInterfaceNodes)) + sendBuffTotal = np.array(int(self.nLocalFluidInterfaceNodes)) sendBuffPhysical = np.array(int(self.nLocalFluidInterfacePhysicalNodes)) - rcvBuffHalo = np.zeros(1, dtype=int) + rcvBuffTotal = np.zeros(1, dtype=int) rcvBuffPhysical = np.zeros(1, dtype=int) if self.have_MPI: self.comm.barrier() - self.comm.Allreduce(sendBuffHalo,rcvBuffHalo,op=self.MPI.SUM) + self.comm.Allreduce(sendBuffTotal,rcvBuffTotal,op=self.MPI.SUM) self.comm.Allreduce(sendBuffPhysical,rcvBuffPhysical,op=self.MPI.SUM) - self.nFluidInterfaceNodes = rcvBuffHalo[0] + self.nFluidInterfaceNodes = rcvBuffTotal[0] self.nFluidInterfacePhysicalNodes = rcvBuffPhysical[0] else: - self.nFluidInterfaceNodes = np.copy(sendBuffHalo) + self.nFluidInterfaceNodes = np.copy(sendBuffTotal) self.nFluidInterfacePhysicalNodes = np.copy(sendBuffPhysical) - del sendBuffHalo, rcvBuffHalo, sendBuffPhysical, rcvBuffPhysical + del sendBuffTotal, rcvBuffTotal, sendBuffPhysical, rcvBuffPhysical # Same thing for the solid part - sendBuffHalo = np.array(int(self.nLocalSolidInterfaceNodes)) + sendBuffTotal = np.array(int(self.nLocalSolidInterfaceNodes)) sendBuffPhysical = np.array(int(self.nLocalSolidInterfacePhysicalNodes)) - rcvBuffHalo = np.zeros(1, dtype=int) + rcvBuffTotal = np.zeros(1, dtype=int) rcvBuffPhysical = np.zeros(1, dtype=int) if self.have_MPI: self.comm.barrier() - self.comm.Allreduce(sendBuffHalo,rcvBuffHalo,op=self.MPI.SUM) + self.comm.Allreduce(sendBuffTotal,rcvBuffTotal,op=self.MPI.SUM) self.comm.Allreduce(sendBuffPhysical,rcvBuffPhysical,op=self.MPI.SUM) - self.nSolidInterfaceNodes = rcvBuffHalo[0] + self.nSolidInterfaceNodes = rcvBuffTotal[0] self.nSolidInterfacePhysicalNodes = rcvBuffPhysical[0] else: - self.nSolidInterfaceNodes = np.copy(sendBuffHalo) + self.nSolidInterfaceNodes = np.copy(sendBuffTotal) self.nSolidInterfacePhysicalNodes = np.copy(sendBuffPhysical) - del sendBuffHalo, rcvBuffHalo, sendBuffPhysical, rcvBuffPhysical + del sendBuffTotal, rcvBuffTotal, sendBuffPhysical, rcvBuffPhysical # --- Store the number of physical interface nodes on each processor and allgather the information --- self.fluidPhysicalInterfaceNodesDistribution = np.zeros(MPIsize, dtype=int) @@ -362,7 +365,7 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): # Same thing for the solid part self.solidPhysicalInterfaceNodesDistribution = np.zeros(MPIsize, dtype=int) if self.have_MPI: - sendBuffPhysical = np.array(int(self.nLocalSolidInterfaceNodes)) + sendBuffPhysical = np.array(int(self.nLocalSolidInterfacePhysicalNodes)) self.comm.Allgather(sendBuffPhysical,self.solidPhysicalInterfaceNodesDistribution) del sendBuffPhysical else: @@ -392,7 +395,7 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): globalIndexStart = 0 for iProc in range(myid): globalIndexStart += self.solidPhysicalInterfaceNodesDistribution[iProc] - globalIndexStop = globalIndexStart + self.nLocalSolidInterfaceNodes-1 + globalIndexStop = globalIndexStart + self.nLocalSolidInterfacePhysicalNodes-1 else: globalIndexStart = 0 globalIndexStop = 0 @@ -562,13 +565,11 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): # Note that the fluid solver is separated in more processors outside the python script # thus when, from a core, we request for the vertices on the interface, we only obtain # those in that node - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) #TODO obtain here the undeformed mesh posx = FluidSolver.GetVertexCoordX(self.fluidInterfaceIdentifier, iVertex) posy = FluidSolver.GetVertexCoordY(self.fluidInterfaceIdentifier, iVertex) posz = FluidSolver.GetVertexCoordZ(self.fluidInterfaceIdentifier, iVertex) - if GlobalIndex in self.FluidHaloNodeList[myid].keys(): - self.haloNodesPositionsInit[GlobalIndex] = (posx, posy, posz) - else: + if GlobalIndex not in self.FluidHaloNodeList[myid].keys(): fluidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('fluid', myid, localIndex) self.localFluidInterface_array_X_init[localIndex] = posx self.localFluidInterface_array_Y_init[localIndex] = posy @@ -587,19 +588,17 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): # --- Get the solid interface from solid solver on each partition --- localIndex = 0 solidIndexing_temp = {} - self.localSolidInterface_array_X = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidInterface_array_Y = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidInterface_array_Z = np.zeros(self.nLocalSolidInterfaceNodes) + self.localSolidInterface_array_X_init = np.zeros(self.nLocalSolidInterfaceNodes) + self.localSolidInterface_array_Y_init = np.zeros(self.nLocalSolidInterfaceNodes) + self.localSolidInterface_array_Z_init = np.zeros(self.nLocalSolidInterfaceNodes) for iVertex in range(self.nLocalSolidInterfaceNodes): GlobalIndex = SolidSolver.getInterfaceNodeGlobalIndex(self.solidInterfaceIdentifier, iVertex) - posx, posy, posz = SolidSolver.getInterfaceNodePos(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex in self.SolidHaloNodeList[myid].keys(): - pass - else: + posx, posy, posz = SolidSolver.getInterfaceNodePosInit(self.solidInterfaceIdentifier, iVertex) + if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): solidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('solid', myid, localIndex) - self.localSolidInterface_array_X[localIndex] = posx - self.localSolidInterface_array_Y[localIndex] = posy - self.localSolidInterface_array_Z[localIndex] = posz + self.localSolidInterface_array_X_init[localIndex] = posx + self.localSolidInterface_array_Y_init[localIndex] = posy + self.localSolidInterface_array_Z_init[localIndex] = posz localIndex += 1 if self.have_MPI: solidIndexing_temp = self.comm.allgather(solidIndexing_temp) @@ -682,17 +681,17 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): if myid == iProc: for jProc in self.solidInterfaceProcessors: if jProc != iProc: - self.comm.ssend(self.localSolidInterface_array_X, dest=jProc, tag=1) - self.comm.ssend(self.localSolidInterface_array_Y, dest=jProc, tag=2) - self.comm.ssend(self.localSolidInterface_array_Z, dest=jProc, tag=3) + self.comm.ssend(self.localSolidInterface_array_X_init, dest=jProc, tag=1) + self.comm.ssend(self.localSolidInterface_array_Y_init, dest=jProc, tag=2) + self.comm.ssend(self.localSolidInterface_array_Z_init, dest=jProc, tag=3) else: sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] solidInterfaceBuffRcv_X = np.zeros(sizeOfBuff) solidInterfaceBuffRcv_Y = np.zeros(sizeOfBuff) solidInterfaceBuffRcv_Z = np.zeros(sizeOfBuff) - solidInterfaceBuffRcv_X = self.localSolidInterface_array_X - solidInterfaceBuffRcv_Y = self.localSolidInterface_array_Y - solidInterfaceBuffRcv_Z = self.localSolidInterface_array_Z + solidInterfaceBuffRcv_X = self.localSolidInterface_array_X_init + solidInterfaceBuffRcv_Y = self.localSolidInterface_array_Y_init + solidInterfaceBuffRcv_Z = self.localSolidInterface_array_Z_init if myid in self.solidInterfaceProcessors: if myid != iProc: sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] @@ -708,9 +707,9 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): self.TPSMeshMapping_A(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc) else: if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_A(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0, self.RBF_rad) + self.RBFMeshMapping_A(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0, self.RBF_rad) else: - self.TPSMeshMapping_A(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0) + self.TPSMeshMapping_A(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) self.MappingMatrixA.assemblyBegin() self.MappingMatrixA.assemblyEnd() self.MappingMatrixA_T.assemblyBegin() @@ -724,17 +723,17 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): if myid == iProc: for jProc in self.fluidInterfaceProcessors: if jProc != iProc: - self.comm.ssend(self.localSolidInterface_array_X, dest=jProc, tag=1) - self.comm.ssend(self.localSolidInterface_array_Y, dest=jProc, tag=2) - self.comm.ssend(self.localSolidInterface_array_Z, dest=jProc, tag=3) + self.comm.ssend(self.localSolidInterface_array_X_init, dest=jProc, tag=1) + self.comm.ssend(self.localSolidInterface_array_Y_init, dest=jProc, tag=2) + self.comm.ssend(self.localSolidInterface_array_Z_init, dest=jProc, tag=3) else: sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] solidInterfaceBuffRcv_X = np.zeros(sizeOfBuff) solidInterfaceBuffRcv_Y = np.zeros(sizeOfBuff) solidInterfaceBuffRcv_Z = np.zeros(sizeOfBuff) - solidInterfaceBuffRcv_X = self.localSolidInterface_array_X - solidInterfaceBuffRcv_Y = self.localSolidInterface_array_Y - solidInterfaceBuffRcv_Z = self.localSolidInterface_array_Z + solidInterfaceBuffRcv_X = self.localSolidInterface_array_X_init + solidInterfaceBuffRcv_Y = self.localSolidInterface_array_Y_init + solidInterfaceBuffRcv_Z = self.localSolidInterface_array_Z_init if myid in self.fluidInterfaceProcessors: if myid != iProc: sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] @@ -756,13 +755,13 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): else: if FSI_config['MATCHING_MESH'] == 'NO': if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_B(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0, self.RBF_rad) + self.RBFMeshMapping_B(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0, self.RBF_rad) elif FSI_config['MESH_INTERP_METHOD'] == 'TPS' : - self.TPSMeshMapping_B(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0) + self.TPSMeshMapping_B(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) else: - self.NearestNeighboorMeshMapping(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0) + self.NearestNeighboorMeshMapping(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) else: - self.matchingMeshMapping(self.localSolidInterface_array_X, self.localSolidInterface_array_Y, self.localSolidInterface_array_Z, 0) + self.matchingMeshMapping(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): self.MappingMatrixB.assemblyBegin() @@ -779,9 +778,9 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): self.MPIBarrier() - del self.localSolidInterface_array_X - del self.localSolidInterface_array_Y - del self.localSolidInterface_array_Z + del self.localSolidInterface_array_X_init + del self.localSolidInterface_array_Y_init + del self.localSolidInterface_array_Z_init del self.localFluidInterface_array_X_init del self.localFluidInterface_array_Y_init del self.localFluidInterface_array_Z_init @@ -906,10 +905,10 @@ def RBFMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol else : SolidSpatialTree.add(jVertex, (posX, posY, posZ)) - for iVertexSolid in range(self.nLocalSolidInterfaceNodes): - posX = self.localSolidInterface_array_X[iVertexSolid] - posY = self.localSolidInterface_array_Y[iVertexSolid] - posZ = self.localSolidInterface_array_Z[iVertexSolid] + for iVertexSolid in range(self.nLocalSolidInterfacePhysicalNodes): + posX = self.localSolidInterface_array_X_init[iVertexSolid] + posY = self.localSolidInterface_array_Y_init[iVertexSolid] + posZ = self.localSolidInterface_array_Z_init[iVertexSolid] NodeA = np.array([posX, posY, posZ]) iGlobalVertexSolid = self.__getGlobalIndex('solid', myid, iVertexSolid) if self.nDim == 2: @@ -1003,10 +1002,10 @@ def TPSMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol nSolidNodes = solidInterfaceBuffRcv_X.shape[0] - for iVertexSolid in range(self.nLocalSolidInterfaceNodes): - posX = self.localSolidInterface_array_X[iVertexSolid] - posY = self.localSolidInterface_array_Y[iVertexSolid] - posZ = self.localSolidInterface_array_Z[iVertexSolid] + for iVertexSolid in range(self.nLocalSolidInterfacePhysicalNodes): + posX = self.localSolidInterface_array_X_init[iVertexSolid] + posY = self.localSolidInterface_array_Y_init[iVertexSolid] + posZ = self.localSolidInterface_array_Z_init[iVertexSolid] NodeA = np.array([posX, posY, posZ]) iGlobalVertexSolid = self.__getGlobalIndex('solid', myid, iVertexSolid) for jVertexSolid in range(nSolidNodes): @@ -1135,9 +1134,7 @@ def interpolateSolidPositionOnFluidMesh(self, FSI_config): KSP_solver.getPC().setType('jacobi') KSP_solver.setOperators(self.MappingMatrixA) KSP_solver.setFromOptions() - #print(KSP_solver.getInitialGuessNonzero()) KSP_solver.setInitialGuessNonzero(True) - #print(KSP_solver.getInitialGuessNonzero()) KSP_solver.solve(self.solidInterface_array_DispX, gamma_array_DispX) KSP_solver.solve(self.solidInterface_array_DispY, gamma_array_DispY) if self.nDim==3: @@ -1204,9 +1201,6 @@ def interpolateSolidPositionOnFluidMesh(self, FSI_config): del sendBuffNumber, rcvBuffNumber - #print("DEBUG MESSAGE From proc {}, counts = {}".format(myid, counts)) - #print("DEBUG MESSAGE From proc {}, displ = {}".format(myid, displ)) - self.comm.Gatherv(self.fluidInterface_array_DispX.getArray(), [self.fluidInterface_array_DispX_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) self.comm.Gatherv(self.fluidInterface_array_DispY.getArray(), [self.fluidInterface_array_DispY_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) self.comm.Gatherv(self.fluidInterface_array_DispZ.getArray(), [self.fluidInterface_array_DispZ_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) @@ -1227,7 +1221,7 @@ def interpolateSolidPositionOnFluidMesh(self, FSI_config): self.localFluidInterface_array_DispX = np.copy(sendBuff_X) self.localFluidInterface_array_DispY = np.copy(sendBuff_Y) self.localFluidInterface_array_DispZ = np.copy(sendBuff_Z) - if iProc != self.rootProcess: + else: self.comm.ssend(sendBuff_X, dest=iProc, tag = 1) self.comm.ssend(sendBuff_Y, dest=iProc, tag = 2) self.comm.ssend(sendBuff_Z, dest=iProc, tag = 3) @@ -1383,17 +1377,17 @@ def interpolateFluidLoadsOnSolidMesh(self, FSI_config): self.comm.ssend(sendBuff_Y, dest=iProc, tag = 2) self.comm.ssend(sendBuff_Z, dest=iProc, tag = 3) else: - self.localSolidLoads_array_X = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidLoads_array_Y = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidLoads_array_Z = np.zeros(self.nLocalSolidInterfaceNodes) + self.localSolidLoads_array_X = np.zeros(self.nLocalSolidInterfacePhysicalNodes) + self.localSolidLoads_array_Y = np.zeros(self.nLocalSolidInterfacePhysicalNodes) + self.localSolidLoads_array_Z = np.zeros(self.nLocalSolidInterfacePhysicalNodes) self.localSolidLoads_array_X = sendBuff_X self.localSolidLoads_array_Y = sendBuff_Y self.localSolidLoads_array_Z = sendBuff_Z if myid in self.solidInterfaceProcessors: if myid != self.rootProcess: - self.localSolidLoads_array_X = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidLoads_array_Y = np.zeros(self.nLocalSolidInterfaceNodes) - self.localSolidLoads_array_Z = np.zeros(self.nLocalSolidInterfaceNodes) + self.localSolidLoads_array_X = np.zeros(self.nLocalSolidInterfacePhysicalNodes) + self.localSolidLoads_array_Y = np.zeros(self.nLocalSolidInterfacePhysicalNodes) + self.localSolidLoads_array_Z = np.zeros(self.nLocalSolidInterfacePhysicalNodes) self.localSolidLoads_array_X = self.comm.recv(source=self.rootProcess, tag = 1) self.localSolidLoads_array_Y = self.comm.recv(source=self.rootProcess, tag = 2) self.localSolidLoads_array_Z = self.comm.recv(source=self.rootProcess, tag = 3) @@ -1408,8 +1402,31 @@ def interpolateFluidLoadsOnSolidMesh(self, FSI_config): self.localSolidLoads_array_Y = self.solidLoads_array_Y.getArray().copy() self.localSolidLoads_array_Z = self.solidLoads_array_Z.getArray().copy() - # Special treatment for the halo nodes on the fluid interface - # TODO when we will use parallel solid solver !! + # Special treatment for the halo nodes on the solid interface + self.haloNodesLoads = {} + sendBuff = {} + if self.have_MPI: + if myid == self.rootProcess: + for iProc in self.solidInterfaceProcessors: + sendBuff = {} + for key in self.SolidHaloNodeList[iProc].keys(): + globalIndex = self.solidIndexing[key] + DispX = self.solidLoads_array_X_recon[globalIndex] + DispY = self.solidLoads_array_Y_recon[globalIndex] + DispZ = self.solidLoads_array_Z_recon[globalIndex] + sendBuff[key] = (DispX, DispY, DispZ) + if iProc == self.rootProcess: + self.haloNodesLoads = sendBuff + else: + self.comm.ssend(sendBuff, dest = iProc, tag=4) + if myid in self.solidInterfaceProcessors: + if myid != self.rootProcess: + self.haloNodesLoads = self.comm.recv(source = self.rootProcess, tag = 4) + self.comm.barrier() + del self.solidLoads_array_X_recon + del self.solidLoads_array_Y_recon + del self.solidLoads_array_Z_recon + del sendBuff def getSolidInterfaceDisplacement(self, SolidSolver): """ @@ -1425,9 +1442,7 @@ def getSolidInterfaceDisplacement(self, SolidSolver): localIndex = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): GlobalIndex = SolidSolver.getInterfaceNodeGlobalIndex(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex in self.SolidHaloNodeList[myid].keys(): - pass - else: + if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): newDispx, newDispy, newDispz = SolidSolver.getInterfaceNodeDisp(self.solidInterfaceIdentifier, iVertex) iGlobalVertex = self.__getGlobalIndex('solid', myid, localIndex) self.solidInterface_array_DispX.setValues([iGlobalVertex],newDispx) @@ -1451,10 +1466,8 @@ def getFluidInterfaceNodalForce(self, FSI_config, FluidSolver): else: myid = 0 + GlobalIndex = int() localIndex = 0 - FX = 0.0 - FY = 0.0 - FZ = 0.0 # --- Get the fluid interface loads from the fluid solver and directly fill the corresponding PETSc vector --- for iVertex in range(self.nLocalFluidInterfaceNodes): @@ -1465,16 +1478,8 @@ def getFluidInterfaceNodalForce(self, FSI_config, FluidSolver): self.fluidLoads_array_X.setValues([iGlobalVertex], loadX) self.fluidLoads_array_Y.setValues([iGlobalVertex], loadY) self.fluidLoads_array_Z.setValues([iGlobalVertex], loadZ) - FX += loadX - FY += loadY - FZ += loadZ localIndex += 1 - if self.have_MPI: - FX = self.comm.allreduce(FX) - FY = self.comm.allreduce(FY) - FZ = self.comm.allreduce(FZ) - self.fluidLoads_array_X.assemblyBegin() self.fluidLoads_array_X.assemblyEnd() self.fluidLoads_array_Y.assemblyBegin() @@ -1482,10 +1487,6 @@ def getFluidInterfaceNodalForce(self, FSI_config, FluidSolver): self.fluidLoads_array_Z.assemblyBegin() self.fluidLoads_array_Z.assemblyEnd() - FX_b = self.fluidLoads_array_X.sum() - FY_b = self.fluidLoads_array_Y.sum() - FZ_b = self.fluidLoads_array_Z.sum() - def setFluidInterfaceVarCoord(self, FluidSolver): """ @@ -1515,7 +1516,7 @@ def setFluidInterfaceVarCoord(self, FluidSolver): def setSolidInterfaceLoads(self, SolidSolver, FSI_config): """ Communicates the new solid interface loads to the solid solver. - In case of rigid body motion, calculates the new resultant forces (lift, drag, ...). + Calculates the new resultant forces (lift, drag, ...). """ if self.have_MPI: myid = self.comm.Get_rank() @@ -1534,7 +1535,7 @@ def setSolidInterfaceLoads(self, SolidSolver, FSI_config): FFY = self.fluidLoads_array_Y.sum() FFZ = self.fluidLoads_array_Z.sum() - for iVertex in range(self.nLocalSolidInterfaceNodes): + for iVertex in range(self.nLocalSolidInterfacePhysicalNodes): FX += self.localSolidLoads_array_X[iVertex] FY += self.localSolidLoads_array_Y[iVertex] FZ += self.localSolidLoads_array_Z[iVertex] @@ -1551,17 +1552,16 @@ def setSolidInterfaceLoads(self, SolidSolver, FSI_config): # --- Send the new solid interface loads to the solid solver (on each partition, halo nodes included) --- GlobalIndex = int() localIndex = 0 - if myid in self.solidInterfaceProcessors: - for iVertex in range(self.nLocalSolidInterfaceNodes): - GlobalIndex = SolidSolver.getInterfaceNodeGlobalIndex(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex in self.SolidHaloNodeList[myid].keys(): - pass - else: - Fx = self.localSolidLoads_array_X[localIndex] - Fy = self.localSolidLoads_array_Y[localIndex] - Fz = self.localSolidLoads_array_Z[localIndex] - SolidSolver.applyload(iVertex, Fx, Fy, Fz) - localIndex += 1 + for iVertex in range(self.nLocalSolidInterfaceNodes): + GlobalIndex = SolidSolver.getInterfaceNodeGlobalIndex(self.solidInterfaceIdentifier, iVertex) + if GlobalIndex in self.SolidHaloNodeList[myid].keys(): + pass #TODO here, when the solid solver will run in parallel, we will need to pass the halo loads + else: + Fx = self.localSolidLoads_array_X[localIndex] + Fy = self.localSolidLoads_array_Y[localIndex] + Fz = self.localSolidLoads_array_Z[localIndex] + SolidSolver.applyload(iVertex, Fx, Fy, Fz) + localIndex += 1 def computeSolidInterfaceResidual(self, SolidSolver): """ @@ -1593,14 +1593,16 @@ def computeSolidInterfaceResidual(self, SolidSolver): predDisp_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) predDisp_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) predDisp_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + predDisp_array_X.set(0.0) + predDisp_array_Y.set(0.0) + predDisp_array_Z.set(0.0) - if myid in self.solidSolverProcessors: - for iVertex in range(self.nLocalSolidInterfaceNodes): - predDispx, predDispy, predDispz = SolidSolver.getInterfaceNodeDisp(self.solidInterfaceIdentifier, iVertex) - iGlobalVertex = self.__getGlobalIndex('solid', myid, iVertex) - predDisp_array_X.setValues([iGlobalVertex], predDispx) - predDisp_array_Y.setValues([iGlobalVertex], predDispy) - predDisp_array_Z.setValues([iGlobalVertex], predDispz) + for iVertex in range(self.nLocalSolidInterfaceNodes): + predDispx, predDispy, predDispz = SolidSolver.getInterfaceNodeDisp(self.solidInterfaceIdentifier, iVertex) + iGlobalVertex = self.__getGlobalIndex('solid', myid, iVertex) + predDisp_array_X.setValues([iGlobalVertex], predDispx) + predDisp_array_Y.setValues([iGlobalVertex], predDispy) + predDisp_array_Z.setValues([iGlobalVertex], predDispz) predDisp_array_X.assemblyBegin() predDisp_array_X.assemblyEnd() @@ -1680,7 +1682,7 @@ def setAitkenCoefficient(self, FSI_config): deltaResx_array_Y.setType('seq') deltaResx_array_Z = PETSc.Vec().create() deltaResx_array_Z.setType('seq') - deltaResx_array_X.setSizes(self.nSolidInterfacePhysicalNodes) + deltaResx_array_X.setSizes(self.nSolidInterfacePhysicalNodes) #TODO I think here we should add self.d_RBF, check the sizes deltaResx_array_X.set(0.0) deltaResx_array_Y.setSizes(self.nSolidInterfacePhysicalNodes) deltaResx_array_Y.set(0.0) @@ -1788,9 +1790,7 @@ def displacementPredictor(self, FSI_config , SolidSolver, deltaT): localIndex = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): GlobalIndex = SolidSolver.getInterfaceNodeGlobalIndex(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex in self.SolidHaloNodeList[myid].keys(): - pass - else: + if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): iGlobalVertex = self.__getGlobalIndex('solid', myid, localIndex) velx, vely, velz = SolidSolver.getInterfaceNodeVel(self.solidInterfaceIdentifier, iVertex) velxNm1, velyNm1, velzNm1 = SolidSolver.getInterfaceNodeVelNm1(self.solidInterfaceIdentifier, iVertex) @@ -1931,7 +1931,8 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): # then to push it back once more to compute the solution at the next time level # Also this is required because in the fluid iteration preprocessor, if we do not update # and step to the next time level, there is a flag "fsi" that will initialise the flow - FluidSolver.Update() + if myid in self.fluidSolverProcessors: + FluidSolver.Update() if myid in self.solidSolverProcessors: SolidSolver.updateSolution() #If no restart @@ -1943,7 +1944,8 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): self.interpolateSolidPositionOnFluidMesh(FSI_config) self.setFluidInterfaceVarCoord(FluidSolver) self.MPIPrint('\nPerforming static mesh deformation (ALE) of initial mesh...\n') - FluidSolver.SetInitialMesh() # if there is an initial deformation in the solid, it has to be communicated to the fluid solver + if myid in self.fluidSolverProcessors: + FluidSolver.SetInitialMesh() # if there is an initial deformation in the solid, it has to be communicated to the fluid solver self.MPIPrint('\nFSI initial conditions are set') self.MPIPrint('Beginning time integration\n') @@ -1969,18 +1971,20 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): self.interpolateSolidPositionOnFluidMesh(FSI_config) self.MPIPrint('\nPerforming dynamic mesh deformation (ALE)...\n') self.setFluidInterfaceVarCoord(FluidSolver) - if self.FSIIter == 0: - FluidSolver.Preprocess(TimeIter) # set some parameters before temporal fluid iteration and dynamic mesh update - else: - FluidSolver.DynamicMeshUpdate(TimeIter) + if myid in self.fluidSolverProcessors: + if self.FSIIter == 0: + FluidSolver.Preprocess(TimeIter) # set some parameters before temporal fluid iteration and dynamic mesh update + else: + FluidSolver.DynamicMeshUpdate(TimeIter) # --- Fluid solver call for FSI subiteration --- # self.MPIPrint('\nLaunching fluid solver for one single dual-time iteration...') self.MPIBarrier() - FluidSolver.ResetConvergence() - FluidSolver.Run() - self.MPIBarrier() - FluidSolver.Postprocess() - self.MPIBarrier() + if myid in self.fluidSolverProcessors: + FluidSolver.ResetConvergence() + FluidSolver.Run() + self.MPIBarrier() + FluidSolver.Postprocess() + self.MPIBarrier() # --- Surface fluid loads interpolation and communication --- # if not self.ImposedMotion: @@ -2020,9 +2024,10 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): self.writeFSIHistory(TimeIter, time, varCoordNorm, FSIConv) # --- Update, monitor and output the fluid solution before the next time step ---# - FluidSolver.Update() - FluidSolver.Monitor(TimeIter) - FluidSolver.Output(TimeIter) + if myid in self.fluidSolverProcessors: + FluidSolver.Update() + FluidSolver.Monitor(TimeIter) + FluidSolver.Output(TimeIter) if TimeIter >= TimeIterTreshold: if myid in self.solidSolverProcessors: @@ -2084,15 +2089,16 @@ def SteadyFSI(self, FSI_config,FluidSolver, SolidSolver): self.MPIPrint('\nLaunching fluid solver for a steady computation...') # --- Fluid solver call for FSI subiteration ---# - 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') - FluidSolver.Preprocess(0)# This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it - FluidSolver.Run() - FluidSolver.Postprocess() - FluidSolver.Monitor(0) #This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations - FluidSolver.Output(0) + 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') + FluidSolver.Preprocess(0)# This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it + FluidSolver.Run() #TODO check how the preprocess work if fsi is false + FluidSolver.Postprocess() + FluidSolver.Monitor(0) #This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations + FluidSolver.Output(0) # --- Surface fluid loads interpolation and communication ---# if not self.ImposedMotion: diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 28a88c3f32eb..cf28f42a5ebb 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -948,11 +948,11 @@ def getInterfaceNodeGlobalIndex(self, markerID, iVertex): return self.markers[markerID][iVertex] - def getInterfaceNodePos(self, markerID, iVertex): + def getInterfaceNodePosInit(self, markerID, iVertex): iPoint = self.markers[markerID][iVertex] - Coord = self.node[iPoint].GetCoord() - return Coord + Coord0 = self.node[iPoint].GetCoord0() + return Coord0 def getInterfaceNodeDisp(self, markerID, iVertex): From d8c1778e79938017f363e947b83087d7ec8baa3b Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 15:16:48 +0100 Subject: [PATCH 249/326] Revert "Update geo in the mesh deformation was not used" This reverts commit 0dd42ad22c6bb5bec0c8f0dca6d27739071f82cf. --- SU2_CFD/src/drivers/CDriver.cpp | 2 +- SU2_CFD/src/solvers/CMeshSolver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index e68f59b2ae44..7ee5c3571587 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1334,7 +1334,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, if ((restart || restart_flow) && config->GetDeform_Mesh() && update_geo){ /*--- Always restart with the last state ---*/ val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; - solver[MESH_0][MESH_SOL]->LoadRestart(geometry, solver, config, val_iter); + solver[MESH_0][MESH_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } /*--- Exit if a restart was requested for a solver that is not available. ---*/ diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 3874f65fd281..5704f6c7bbd1 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -713,7 +713,7 @@ void CMeshSolver::SetDualTime_Mesh(void){ nodes->Set_Solution_time_n(); } -void CMeshSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter) { +void CMeshSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ From 4b9b8e625ae6de8c939ef4e8d8e0ff60764e6d5e Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 15:17:04 +0100 Subject: [PATCH 250/326] Revert "Updategeo removed from hpp files also" This reverts commit 2f6635a0b711a8c4493cfa0c4e0597daf8e257c8. --- SU2_CFD/include/solvers/CMeshSolver.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CMeshSolver.hpp b/SU2_CFD/include/solvers/CMeshSolver.hpp index e1e597323b58..55c14d7aa6f0 100644 --- a/SU2_CFD/include/solvers/CMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CMeshSolver.hpp @@ -148,11 +148,13 @@ class CMeshSolver final : public CFEASolver { * \param[in] solver - Container vector with all of the solvers. * \param[in] config - Definition of the particular problem. * \param[in] val_iter - Current external iteration number. + * \param[in] val_update_geo - Flag for updating coords and grid velocity. */ void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, - int val_iter) override; + int val_iter, + bool val_update_geo) override; /*! * \brief Load the geometries at the previous time states n and nM1. From 25ee985941bedfa657cf7fe56b5f75348958fa26 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 15:36:32 +0100 Subject: [PATCH 251/326] Only extract forces when required --- SU2_PY/FSI_tools/FSIInterface.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 62438de8388b..3bb224c8c3e0 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1987,13 +1987,12 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): self.MPIBarrier() # --- Surface fluid loads interpolation and communication --- # - if not self.ImposedMotion: - self.MPIPrint('\nProcessing interface fluid loads...\n') - self.MPIBarrier() - self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) - self.MPIBarrier() if TimeIter > TimeIterTreshold: if not self.ImposedMotion: + self.MPIPrint('\nProcessing interface fluid loads...\n') + self.MPIBarrier() + self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) + self.MPIBarrier() self.interpolateFluidLoadsOnSolidMesh(FSI_config) self.setSolidInterfaceLoads(SolidSolver, FSI_config) From c0c42abe9d409b836601dadb77d03bfc37e95e8d Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 15:59:23 +0100 Subject: [PATCH 252/326] Fixed size --- SU2_PY/FSI_tools/FSIInterface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 3bb224c8c3e0..aa5423980143 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1682,11 +1682,11 @@ def setAitkenCoefficient(self, FSI_config): deltaResx_array_Y.setType('seq') deltaResx_array_Z = PETSc.Vec().create() deltaResx_array_Z.setType('seq') - deltaResx_array_X.setSizes(self.nSolidInterfacePhysicalNodes) #TODO I think here we should add self.d_RBF, check the sizes + deltaResx_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) deltaResx_array_X.set(0.0) - deltaResx_array_Y.setSizes(self.nSolidInterfacePhysicalNodes) + deltaResx_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) deltaResx_array_Y.set(0.0) - deltaResx_array_Z.setSizes(self.nSolidInterfacePhysicalNodes) + deltaResx_array_Z.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) deltaResx_array_Z.set(0.0) # --- Compute the dynamic Aitken coefficient --- From d9ab5923760f752d602cfeb442ca95fc44e0e74d Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 19:53:11 +0100 Subject: [PATCH 253/326] Removing old setInitialMesh --- SU2_CFD/include/drivers/CDriver.hpp | 15 ---------- SU2_CFD/src/python_wrapper_structure.cpp | 38 ------------------------ 2 files changed, 53 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 82bedff1ddc9..ff0570e4c9b6 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -360,11 +360,6 @@ class CDriver { */ virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) { } - /*! - * \brief Perform a static mesh deformation, without considering grid velocity. - */ - virtual void StaticMeshUpdate() { } - /*! * \brief Perform a mesh deformation as initial condition. */ @@ -962,16 +957,6 @@ class CFluidDriver : public CDriver { */ void DynamicMeshUpdate(unsigned long TimeIter) override; - /*! - * \brief Perform a static mesh deformation, without considering grid velocity (multiple zone). - */ - void StaticMeshUpdate() override; - - /*! - * \brief Perform a mesh deformation as initial condition (multiple zone). - */ - void SetInitialMesh() override; - /*! * \brief Process the boundary conditions and update the multigrid structure. */ diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 95cbf77ec6d7..770b961899e1 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -759,44 +759,6 @@ void CDriver::ResetConvergence() { } -void CFluidDriver::StaticMeshUpdate() { - - int rank = MASTER_NODE; - -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif - - for(iZone = 0; iZone < nZone; iZone++) { - if(rank == MASTER_NODE) cout << " Deforming the volume grid." << endl; - grid_movement[iZone][INST_0]->SetVolume_Deformation(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], true); - - if(rank == MASTER_NODE) cout << "No grid velocity to be computde : static grid deformation." << endl; - - if(rank == MASTER_NODE) cout << " Updating multigrid structure." << endl; - grid_movement[iZone][INST_0]->UpdateMultiGrid(geometry_container[iZone][INST_0], config_container[iZone]); - } -} - -void CFluidDriver::SetInitialMesh() { - - StaticMeshUpdate(); - - /*--- Propagate the initial deformation to the past ---*/ - //if (!restart) { - for(iZone = 0; iZone < nZone; iZone++) { - for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) { - //solver_container[iZone][iMesh][FLOW_SOL]->nodes->Set_Solution_time_n(iPoint); - //solver_container[iZone][iMesh][FLOW_SOL]->nodes->Set_Solution_time_n1(iPoint); - geometry_container[iZone][INST_0][iMesh]->nodes->SetVolume_n(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetVolume_nM1(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetCoord_n(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetCoord_n1(); - } - } - //} -} - void CSinglezoneDriver::SetInitialMesh() { DynamicMeshUpdate(0); From ccd7ac479c5b926635f52d75676d515b0874360b Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 22:57:51 +0100 Subject: [PATCH 254/326] Compute the interface mapping starting from the undeformed mesh --- SU2_CFD/include/drivers/CDriver.hpp | 8 ++++++++ SU2_CFD/src/python_wrapper_structure.cpp | 10 ++++++++++ SU2_PY/FSI_tools/FSIInterface.py | 8 +++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index ff0570e4c9b6..5177f12eb9c7 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -466,6 +466,14 @@ class CDriver { */ unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex); + /*! + * \brief Get undeformed coordinates from the mesh solver. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \return x,y,z coordinates of the vertex. + */ + vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex); + /*! * \brief Get the x coordinate of a vertex on a specified marker. * \param[in] iMarker - Marker identifier. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 770b961899e1..022c5353adbc 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -258,6 +258,16 @@ passivedouble CDriver::GetUnsteady_TimeStep(){ return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } +vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) { + + su2double coord[3] = {0.0}; + + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + for (auto iDim = 0 ; iDim < nDim ; iDim++){ + coord[iDim] = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord(iPoint,iDim); + } +} + passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned long iVertex) { auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index aa5423980143..702ad4d78b0a 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -565,10 +565,8 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): # Note that the fluid solver is separated in more processors outside the python script # thus when, from a core, we request for the vertices on the interface, we only obtain # those in that node - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) #TODO obtain here the undeformed mesh - posx = FluidSolver.GetVertexCoordX(self.fluidInterfaceIdentifier, iVertex) - posy = FluidSolver.GetVertexCoordY(self.fluidInterfaceIdentifier, iVertex) - posz = FluidSolver.GetVertexCoordZ(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) + posx, posy, posz = FluidSolver.GetInitialMeshCoord(self.fluidInterfaceIdentifier, iVertex) if GlobalIndex not in self.FluidHaloNodeList[myid].keys(): fluidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('fluid', myid, localIndex) self.localFluidInterface_array_X_init[localIndex] = posx @@ -2094,7 +2092,7 @@ def SteadyFSI(self, FSI_config,FluidSolver, SolidSolver): # mesh pushing back the solution to avoid spurious velocities, as the velocity is not computed at all self.MPIPrint('\nPerforming static mesh deformation...\n') FluidSolver.Preprocess(0)# This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it - FluidSolver.Run() #TODO check how the preprocess work if fsi is false + FluidSolver.Run() FluidSolver.Postprocess() FluidSolver.Monitor(0) #This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations FluidSolver.Output(0) From a0089c0c6ca258331095fe7dbe4f172186f8ea4f Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 13 Feb 2021 23:06:16 +0100 Subject: [PATCH 255/326] Loads computed for all the solid markers --- SU2_CFD/include/drivers/CDriver.hpp | 2 +- SU2_CFD/src/python_wrapper_structure.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 5177f12eb9c7..a6665799ae57 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -472,7 +472,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return x,y,z coordinates of the vertex. */ - vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex); + vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex); /*! * \brief Get the x coordinate of a vertex on a specified marker. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 022c5353adbc..4382d020c2e6 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -258,14 +258,21 @@ passivedouble CDriver::GetUnsteady_TimeStep(){ return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } -vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) { - su2double coord[3] = {0.0}; + vector coord(3,0.0); + vector coord_passive(3, 0.0); auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); for (auto iDim = 0 ; iDim < nDim ; iDim++){ coord[iDim] = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord(iPoint,iDim); } + + coord_passive[0] = SU2_TYPE::GetValue(coord[0]); + coord_passive[1] = SU2_TYPE::GetValue(coord[1]); + coord_passive[2] = SU2_TYPE::GetValue(coord[2]); + + return coord_passive; } passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned long iVertex) { @@ -1017,7 +1024,7 @@ vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - if (config_container[ZONE_0]->GetMarker_All_Fluid_Load(iMarker) == YES) { + if (config_container[ZONE_0]->GetSolid_Wall(iMarker)) { FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); if (geometry->GetnDim() == 3) From 8ac2b873d5835a528a70ceccea49c8929556f10c Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 14 Feb 2021 11:07:02 +0000 Subject: [PATCH 256/326] krylov the multizone adjoint inner iterations --- Common/include/linear_algebra/CSysSolve.hpp | 22 ++- Common/src/linear_algebra/CSysSolve.cpp | 78 +++++----- .../drivers/CDiscAdjMultizoneDriver.hpp | 69 ++++++++- .../integration/CNewtonIntegration.hpp | 3 +- .../include/solvers/CFVMFlowSolverBase.inl | 3 + SU2_CFD/include/variables/CVariable.hpp | 1 + .../src/drivers/CDiscAdjMultizoneDriver.cpp | 134 ++++++++++++------ .../src/integration/CNewtonIntegration.cpp | 4 +- SU2_CFD/src/solvers/CTurbSASolver.cpp | 1 + SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 + 10 files changed, 230 insertions(+), 86 deletions(-) diff --git a/Common/include/linear_algebra/CSysSolve.hpp b/Common/include/linear_algebra/CSysSolve.hpp index 31040e67d5f2..bf13a200abe5 100644 --- a/Common/include/linear_algebra/CSysSolve.hpp +++ b/Common/include/linear_algebra/CSysSolve.hpp @@ -100,6 +100,9 @@ class CSysSolve { const VectorType* LinSysRes_ptr; /*!< \brief Pointer to appropriate LinSysRes (set to original or temporary in call to Solve). */ LinearToleranceType tol_type = LinearToleranceType::RELATIVE; /*!< \brief How the linear solvers interpret the tolerance. */ + bool xIsZero = false; /*!< \brief If true assume the initial solution is always 0. */ + bool recomputeRes = false; /*!< \brief Recompute the residual after inner iterations, if monitoring. */ + unsigned long monitorFreq = 10; /*!< \brief Monitoring frequency. */ /*! * \brief sign transfer function @@ -311,12 +314,10 @@ class CSysSolve { * \param[out] residual - final normalized residual * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. - * \param[in] xIsZero - If true assume x = 0. */ unsigned long FGMRES_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config, - bool xIsZero = false) const; + ScalarType & residual, bool monitoring, const CConfig *config) const; /*! * \brief Biconjugate Gradient Stabilized Method (BCGSTAB) @@ -389,4 +390,19 @@ class CSysSolve { */ inline void SetToleranceType(LinearToleranceType type) {tol_type = type;} + /*! + * \brief Assume the initial solution is 0 to save one product, or don't. + */ + inline void SetxIsZero(bool isZero) {xIsZero = isZero;} + + /*! + * \brief Set whether to recompute residuals at the end (while monitoring only). + */ + inline void SetRecomputeResidual(bool recompRes) {recomputeRes = recompRes;} + + /*! + * \brief Set the screen output frequency during monitoring. + */ + inline void SetMonitoringFrequency(bool frequency) {monitorFreq = frequency;} + }; diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index 5673ca14622e..2f4907f00cda 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -235,8 +235,12 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & /*--- Calculate the initial residual, compute norm, and check if system is already solved ---*/ - mat_vec(x, A_x); - r = b - A_x; + if (!xIsZero) { + mat_vec(x, A_x); + r = b - A_x; + } else { + r = b; + } /*--- Only compute the residuals in full communication mode. ---*/ @@ -292,7 +296,7 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & norm_r = r.norm(); if (norm_r < tol*norm0) break; - if (((monitoring) && (master)) && ((i+1) % 10 == 0)) + if (((monitoring) && (master)) && ((i+1) % monitorFreq == 0)) WriteHistory(i+1, norm_r/norm0); } @@ -317,16 +321,17 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & if (master) WriteFinalResidual("CG", i, norm_r/norm0); - mat_vec(x, A_x); - r = b - A_x; - ScalarType true_res = r.norm(); + if (recomputeRes) { + mat_vec(x, A_x); + r = b - A_x; + ScalarType true_res = r.norm(); - if (fabs(true_res - norm_r) > tol*10.0) { - if (master) { - WriteWarning(norm_r, true_res, tol); + if (fabs(true_res - norm_r) > tol*10.0) { + if (master) { + WriteWarning(norm_r, true_res, tol); + } } } - } residual = norm_r/norm0; @@ -337,8 +342,7 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & template unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector & b, CSysVector & x, const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, - const CConfig *config, bool xIsZero) const { + ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); @@ -460,7 +464,7 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector::FGMRES_LinSolver(const CSysVector tol*10) { - if (master) { - WriteWarning(beta, res, tol); + if (fabs(res - beta) > tol*10) { + if (master) { + WriteWarning(beta, res, tol); + } } } - } residual = beta/norm0; @@ -533,8 +538,12 @@ unsigned long CSysSolve::BCGSTAB_LinSolver(const CSysVector::BCGSTAB_LinSolver(const CSysVector::BCGSTAB_LinSolver(const CSysVector tol*10.0) && (master)) { - WriteWarning(norm_r, true_res, tol); + if ((fabs(true_res - norm_r) > tol*10.0) && (master)) { + WriteWarning(norm_r, true_res, tol); + } } - } residual = norm_r/norm0; @@ -690,8 +700,12 @@ unsigned long CSysSolve::Smoother_LinSolver(const CSysVector::Smoother_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL) { norm_r = r.norm(); if (norm_r < tol*norm0) break; - if (((monitoring) && (master)) && ((i+1) % 5 == 0)) + if (((monitoring) && (master)) && ((i+1) % monitorFreq == 0)) WriteHistory(i+1, norm_r/norm0); } } diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index 4d8e461e404c..97e79c2fab9e 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -27,10 +27,41 @@ #pragma once #include "CMultizoneDriver.hpp" +#include "../../../Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp" +#include "../../../Common/include/linear_algebra/CPreconditioner.hpp" +#include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp" +#include "../../../Common/include/linear_algebra/CSysSolve.hpp" class CDiscAdjMultizoneDriver : public CMultizoneDriver { protected: +#ifdef CODI_FORWARD_TYPE + using Scalar = su2double; +#else + using Scalar = passivedouble; +#endif + + class AdjointProduct : public CMatrixVectorProduct { + public: + CDiscAdjMultizoneDriver* const driver; + const unsigned short iZone = 0; + mutable unsigned long iInnerIter = 0; + + AdjointProduct(CDiscAdjMultizoneDriver* d, unsigned short i) : driver(d), iZone(i) {} + + inline void operator()(const CSysVector & u, CSysVector & v) const override { + driver->SetAllSolutions(iZone, true, u); + driver->Iterate(iZone, iInnerIter, true); + driver->GetAllSolutions(iZone, true, v); + v -= u; + ++iInnerIter; + } + }; + + class Identity : public CPreconditioner { + public: + inline void operator()(const CSysVector & u, CSysVector & v) const override { v = u; } + }; /*! * \brief Kinds of recordings (three different ones). @@ -58,6 +89,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { int RecordingState = NONE; /*!< \brief The kind of recording that the tape currently holds. */ + bool eval_transfer = false; /*!< \brief Evaluate the transfer section of the tape. */ su2double ObjFunc; /*!< \brief Value of the objective function. */ int ObjFunc_Index; /*!< \brief Index of the value of the objective function. */ @@ -74,6 +106,12 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { for jZone, we need to store all terms to have BGS-type updates with relaxation. */ vector > > Cross_Terms; + vector > fixPtCorrector; + + static constexpr unsigned long KrylovMinIters = 5; + vector > LinSolver; + vector > AdjRHS, AdjSol; + public: /*! @@ -82,9 +120,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { * \param[in] val_nZone - Total number of zones. * \param[in] MPICommunicator - MPI communicator for SU2. */ - CDiscAdjMultizoneDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); + CDiscAdjMultizoneDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); /*! * \brief Destructor of the class. @@ -103,6 +139,12 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { */ void Run() override; + /*! + * \brief Run one inner iteration for a given zone. + * \return The result of "monitor". + */ + bool Iterate(unsigned short iZone, unsigned long iInnerIter, bool KrylovMode = false); + /*! * \brief Evaluate sensitivites for the current adjoint solution and output files. * \param[in] iOuterIter - Current outer iteration. @@ -200,6 +242,25 @@ 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. + * \param[in] iZone - Index of the zone. + * \param[out] rhs - Object with interface (iPoint,iVar), set to -external. + */ + template + void GetAdjointRHS(unsigned short iZone, Container& rhs) const { + const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); + for (auto iSol = 0u, offset = 0u; iSol < MAX_SOLS; ++iSol) { + auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; + if (!(solver && solver->GetAdjoint())) continue; + const auto& ext = solver->GetNodes()->Get_External(); + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < solver->GetnVar(); ++iVar) + rhs(iPoint,offset+iVar) = -SU2_TYPE::GetValue(ext(iPoint,iVar)); + offset += solver->GetnVar(); + } + } }; diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index 61ad020f6d41..c25e47e701de 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -148,8 +148,7 @@ class CNewtonIntegration final : public CIntegration { auto product = CSysMatrixVectorProduct(solvers[FLOW_SOL]->Jacobian, geometry, config); v = MixedScalar(0.0); MixedScalar eps_t = eps; - iters = solvers[FLOW_SOL]->System.FGMRES_LinSolver(u, v, product, *preconditioner, - eps, iters, eps_t, false, config, true); + iters = solvers[FLOW_SOL]->System.FGMRES_LinSolver(u, v, product, *preconditioner, eps, iters, eps_t, false, config); eps = eps_t; return iters; } diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 7d35d6eb9380..53f2205ff7d3 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -114,6 +114,9 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { LinSysSol.Initialize(nPoint, nPointDomain, nVar, 0.0); LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); + /*--- LinSysSol will always be init to 0. ---*/ + System.SetxIsZero(true); + /*--- Allocates a 2D array with variable "outer" sizes and init to 0. ---*/ auto Alloc2D = [](unsigned long M, const unsigned long* N, su2double**& X) { diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index e904d76912e9..99ed9955b995 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -452,6 +452,7 @@ class CVariable { * \return Pointer to the External row for iPoint. */ inline const su2double *Get_External(unsigned long iPoint) const { return External[iPoint]; } + inline const MatrixType& Get_External() const { return External; } /*! * \brief Get the solution at time n. diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 9c5b29be9deb..7c0543779f99 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -31,7 +31,6 @@ #include "../../include/output/COutputLegacy.hpp" #include "../../include/output/COutput.hpp" #include "../../include/iteration/CIterationFactory.hpp" -#include "../../../Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp" CDiscAdjMultizoneDriver::CDiscAdjMultizoneDriver(char* confFile, unsigned short val_nZone, @@ -47,6 +46,11 @@ CDiscAdjMultizoneDriver::CDiscAdjMultizoneDriver(char* confFile, Has_Deformation.resize(nZone) = false; + fixPtCorrector.resize(nZone); + LinSolver.resize(nZone); + AdjRHS.resize(nZone); + AdjSol.resize(nZone); + direct_iteration = new CIteration**[nZone]; direct_output = new COutput*[nZone]; @@ -156,11 +160,51 @@ void CDiscAdjMultizoneDriver::StartSolver() { } +bool CDiscAdjMultizoneDriver::Iterate(unsigned short iZone, unsigned long iInnerIter, bool KrylovMode) { + + config_container[iZone]->SetInnerIter(iInnerIter); + + /*--- Evaluate the tape section belonging to solvers in iZone. + * Only evaluate TRANSFER terms on the last iteration or after convergence. ---*/ + + eval_transfer = (eval_transfer || (iInnerIter == nInnerIter[iZone]-1)) && !KrylovMode; + + ComputeAdjoints(iZone, eval_transfer); + + /*--- Extracting adjoints for solvers in iZone w.r.t. to outputs in iZone (diagonal part). ---*/ + + iteration_container[iZone][INST_0]->Iterate(output_container[iZone], integration_container, geometry_container, + solver_container, numerics_container, config_container, + surface_movement, grid_movement, FFDBox, iZone, INST_0); + + /*--- Use QN driver to improve the solution. ---*/ + + if (fixPtCorrector[iZone].size()) { + GetAllSolutions(iZone, true, fixPtCorrector[iZone].FPresult()); + fixPtCorrector[iZone].compute(); + if(iInnerIter) SetAllSolutions(iZone, true, fixPtCorrector[iZone]); + } + + /*--- Residuals during GMRES iterations have no meaning ---*/ + + if (KrylovMode && iInnerIter) return false; + + /*--- This is done explicitly here for multizone cases, only in inner iterations and not when + * extracting cross terms so that the adjoint residuals in each zone still make sense. ---*/ + + Set_SolutionOld_To_Solution(iZone); + + /*--- Print out the convergence data to screen and history file. ---*/ + + return iteration_container[iZone][INST_0]->Monitor(output_container[iZone], integration_container, geometry_container, + solver_container, numerics_container, config_container, + surface_movement, grid_movement, FFDBox, iZone, INST_0); +} + void CDiscAdjMultizoneDriver::Run() { unsigned long wrt_sol_freq = 9999; unsigned long nOuterIter = driver_config->GetnOuter_Iter(); - vector > fixPtCorrector(nZone); for (iZone = 0; iZone < nZone; iZone++) { @@ -175,13 +219,20 @@ void CDiscAdjMultizoneDriver::Run() { Set_BGSSolution_k_To_Solution(iZone); - /*--- Prepare quasi-Newton drivers. ---*/ + /*--- Prepare Krylov or quasi-Newton methods. ---*/ + + const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); + const auto nPointDomain = geometry_container[iZone][INST_0][MESH_0]->GetnPointDomain(); + const auto nVar = GetTotalNumberOfVariables(iZone, true); - if (config_container[iZone]->GetnQuasiNewtonSamples() > 1) { - fixPtCorrector[iZone].resize(config_container[iZone]->GetnQuasiNewtonSamples(), - geometry_container[iZone][INST_0][MESH_0]->GetnPoint(), - GetTotalNumberOfVariables(iZone, true), - geometry_container[iZone][INST_0][MESH_0]->GetnPointDomain()); + if (config_container[iZone]->GetNewtonKrylov() && nInnerIter[iZone] >= KrylovMinIters) { + AdjRHS[iZone].Initialize(nPoint, nPointDomain, nVar, nullptr); + AdjSol[iZone].Initialize(nPoint, nPointDomain, nVar, nullptr); + LinSolver[iZone].SetRecomputeResidual(false); + LinSolver[iZone].SetMonitoringFrequency(config_container[iZone]->GetScreen_Wrt_Freq(2)); + } + else if (config_container[iZone]->GetnQuasiNewtonSamples() > 1) { + fixPtCorrector[iZone].resize(config_container[iZone]->GetnQuasiNewtonSamples(), nPoint, nVar, nPointDomain); } } @@ -269,9 +320,9 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Inner loop to allow for multiple adjoint updates with respect to solvers in iZone. ---*/ - bool eval_transfer = false; const bool restart = config_container[iZone]->GetRestart(); const bool no_restart = (iOuterIter > 0) || !restart; + eval_transfer = false; /*--- Reset QN driver for new inner iterations. ---*/ @@ -280,55 +331,50 @@ void CDiscAdjMultizoneDriver::Run() { if(restart && (iOuterIter==1)) GetAllSolutions(iZone, true, fixPtCorrector[iZone]); } - for (unsigned long iInnerIter = 0; iInnerIter < nInnerIter[iZone]; iInnerIter++) { + if (!config_container[iZone]->GetNewtonKrylov() || !no_restart || nInnerIter[iZone]SetInnerIter(iInnerIter); + /*--- Regular fixed-point, possibly with quasi-Newton method. ---*/ - /*--- Add off-diagonal contribution (including the OF gradient) to Solution. ---*/ + for (unsigned long iInnerIter = 0; iInnerIter < nInnerIter[iZone]; iInnerIter++) { - if (no_restart || (iInnerIter > 0)) { - Add_External_To_Solution(iZone); - } - else { - /*--- If we restarted, Solution already has all contributions, - * we run only one inner iter to compute the cross terms. ---*/ - eval_transfer = true; - } - - /*--- Evaluate the tape section belonging to solvers in iZone. - * Only evaluate TRANSFER terms on the last iteration or after convergence. ---*/ + /*--- Add off-diagonal contribution (including the OF gradient) to Solution. ---*/ - eval_transfer = eval_transfer || (iInnerIter == nInnerIter[iZone]-1); + if (no_restart || (iInnerIter > 0)) { + Add_External_To_Solution(iZone); + } + else { + /*--- If we restarted, Solution already has all contributions, + * we run only one inner iter to compute the cross terms. ---*/ + eval_transfer = true; + } - ComputeAdjoints(iZone, eval_transfer); + const bool converged = Iterate(iZone, iInnerIter); - /*--- Extracting adjoints for solvers in iZone w.r.t. to outputs in iZone (diagonal part). ---*/ + if (eval_transfer) break; - iteration_container[iZone][INST_0]->Iterate(output_container[iZone], integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, iZone, INST_0); + eval_transfer = converged; + } + } + else { + /*--- Use FGMRES to solve the adjoint system, the RHS is -External, + * the solution are the iZone adjoint variables + External, + * Recall that External also contains the OF gradient. ---*/ - /*--- Use QN driver to improve the solution. ---*/ + GetAdjointRHS(iZone, AdjRHS[iZone]); - if (fixPtCorrector[iZone].size()) { - GetAllSolutions(iZone, true, fixPtCorrector[iZone].FPresult()); - fixPtCorrector[iZone].compute(); - if(iInnerIter) SetAllSolutions(iZone, true, fixPtCorrector[iZone]); - } + Add_External_To_Solution(iZone); - /*--- This is done explicitly here for multizone cases, only in inner iterations and not when - * extracting cross terms so that the adjoint residuals in each zone still make sense. ---*/ + GetAllSolutions(iZone, true, AdjSol[iZone]); - Set_SolutionOld_To_Solution(iZone); + const bool monitor = config_container[iZone]->GetWrt_ZoneConv(); - /*--- Print out the convergence data to screen and history file. ---*/ + Scalar eps = 0.0; + LinSolver[iZone].FGMRES_LinSolver(AdjRHS[iZone], AdjSol[iZone], AdjointProduct(this,iZone), Identity(), + Scalar(1e-9), nInnerIter[iZone]-2, eps, monitor, config_container[iZone]); - bool converged = iteration_container[iZone][INST_0]->Monitor(output_container[iZone], integration_container, - geometry_container, solver_container, numerics_container, - config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); - if (eval_transfer) break; - eval_transfer = converged; + SetAllSolutions(iZone, true, AdjSol[iZone]); + Iterate(iZone, nInnerIter[iZone]-1); } /*--- Off-diagonal (coupling term) BGS update. ---*/ diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index af22c01ded42..19be8c303c95 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -80,6 +80,8 @@ void CNewtonIntegration::Setup() { omp_chunk_size = computeStaticChunkSize(nPoint, omp_get_max_threads(), 1024); + LinSolver.SetxIsZero(true); + LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); if (!std::is_same::value) { @@ -254,7 +256,7 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** eps *= toleranceFactor; iter = LinSolver.FGMRES_LinSolver(LinSysRes, linSysSol, CMatrixFreeProductWrapper(this), - CPreconditionerWrapper(this), eps, iter, eps, false, config, true); + CPreconditionerWrapper(this), eps, iter, eps, false, config); /*--- Scale back the residual to trick the CFL adaptation. ---*/ eps /= toleranceFactor; } diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index e374c2fa9874..ec68057efc9d 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -89,6 +89,7 @@ CTurbSASolver::CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned shor LinSysSol.Initialize(nPoint, nPointDomain, nVar, 0.0); LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); + System.SetxIsZero(true); if (ReducerStrategy) EdgeFluxes.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index aab63b71d2dd..2821290b8d8f 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -91,6 +91,7 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh LinSysSol.Initialize(nPoint, nPointDomain, nVar, 0.0); LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); + System.SetxIsZero(true); if (ReducerStrategy) EdgeFluxes.Initialize(geometry->GetnEdge(), geometry->GetnEdge(), nVar, nullptr); From a54f6b6037d703519518157eb99f2ea87b3a5516 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sun, 14 Feb 2021 16:08:47 +0100 Subject: [PATCH 257/326] Tentative modification of test case --- SU2_CFD/include/drivers/CDriver.hpp | 6 - SU2_CFD/src/python_wrapper_structure.cpp | 24 --- .../flatPlate_rigidMotion_Conf.cfg | 186 +----------------- .../launch_flatPlate_rigidMotion.py | 59 +----- 4 files changed, 17 insertions(+), 258 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index a6665799ae57..c698a85a14ee 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -412,12 +412,6 @@ class CDriver { */ passivedouble Get_LiftCoeff(); - /*! - * \brief Get the moving marker identifier. - * \return Moving marker identifier. - */ - unsigned short GetMovingMarker(); - /*! * \brief Get the number of vertices (halo nodes included) from a specified marker. * \param[in] iMarker - Marker identifier. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 4382d020c2e6..ff61589d1704 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -178,30 +178,6 @@ passivedouble CDriver::Get_LiftCoeff() { return SU2_TYPE::GetValue(CLift); } -unsigned short CDriver::GetMovingMarker() { - - unsigned short IDtoSend,iMarker, jMarker, Moving; - string Marker_Tag, Moving_Tag; - - IDtoSend = 0; - for (iMarker = 0; iMarker < config_container[ZONE_0]->GetnMarker_All(); iMarker++) { - Moving = config_container[ZONE_0]->GetMarker_All_Moving(iMarker); - if (Moving == YES) { - for (jMarker = 0; jMarkerGetnMarker_Moving(); jMarker++) { - Moving_Tag = config_container[ZONE_0]->GetMarker_Moving_TagBound(jMarker); - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - if (Marker_Tag == Moving_Tag) { - IDtoSend = iMarker; - break; - } - } - } - } - - return IDtoSend; - -} - unsigned long CDriver::GetNumberVertices(unsigned short iMarker){ return geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index 0ebe07328e12..d90e636e19da 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -22,10 +22,6 @@ KIND_TURB_MODEL= SST % Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) MATH_PROBLEM= DIRECT % -% -% Axisymmetric simulation, only compressible flows (NO, YES) -AXISYMMETRIC= NO -% % Restart solution (NO, YES) RESTART_SOL= NO % @@ -37,11 +33,11 @@ DISCARD_INFILES= NO % % System of measurements (SI, US) % International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, +% Newtons = kg m/s^2, Pascals = N/m^2, % Density = kg/m^3, Speed = m/s, % Equiv. Area = m^2 ) -% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, -% psf = lbf/ft^2, Density = slug/ft^3, +% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, +% psf = lbf/ft^2, Density = slug/ft^3, % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= SI @@ -179,42 +175,12 @@ RESTART_ITER= 0 TIME_ITER=9999 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% -% Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, STEADY_TRANSLATION, FLUID_STRUCTURE, -% AEROELASTIC, ELASTICITY, EXTERNAL, -% AEROELASTIC_RIGID_MOTION, GUST) -SURFACE_MOVEMENT= FLUID_STRUCTURE -% -% Motion mach number (non-dimensional). Used for initializing a viscous flow -% with the Reynolds number and for computing force coeffs. with dynamic meshes. -MACH_MOTION= 0.03059 -% -% Moving wall boundary marker(s) (NONE = no marker, ignored for RIGID_MOTION) -MARKER_MOVING= ( plate ) -% -% Coordinates of the motion origin -SURFACE_MOTION_ORIGIN= -0.0028 0.0 0.0 -% -% Move Motion Origin for marker moving (1 or 0) -MOVE_MOTION_ORIGIN = 1 - -% ----------------------- BODY FORCE DEFINITION -------------------------------% % -% Apply a body force as a source term (NO, YES) -BODY_FORCE= NO +DEFORM_MESH = YES +MARKER_DEFORM_MESH = (plate) % -% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) -BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Euler wall boundary marker(s) (NONE = no marker) -MARKER_EULER= ( NONE ) -% -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -%MARKER_HEATFLUX= ( plate, 1000.0 ) -% % Navier-Stokes (no-slip), isothermal wall marker(s) (NONE = no marker) % Format: ( marker name, constant wall temperature (K), ... ) MARKER_ISOTHERMAL= ( plate, 293 ) @@ -230,22 +196,6 @@ MARKER_PLOTTING = ( plate ) % Marker(s) of the surface where the non-dimensional coefficients are evaluated. MARKER_MONITORING = ( plate ) % -% Viscous wall markers for which wall functions must be applied. (NONE = no marker) -% Format: ( marker name, wall function type, ... ) -MARKER_WALL_FUNCTIONS= ( plate, NO_WALL_FUNCTION ) -% -% Marker(s) of the surface where custom thermal BC's are defined. -MARKER_PYTHON_CUSTOM = (NONE) -% -% Marker(s) of the surface where obj. func. (design problem) will be evaluated -MARKER_DESIGNING = ( NONE ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) -MARKER_ANALYZE = ( NONE ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). -MARKER_ANALYZE_AVERAGE = MASSFLUX - % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % % Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) @@ -254,39 +204,6 @@ NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES % CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 7.0 % -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% -% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, -% CFL max value ) -CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.25, 50.0 ) -% -% Maximum Delta Time in local time stepping simulations -MAX_DELTA_TIME= 1E6 -% -% Runge-Kutta alpha coefficients -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -% -% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, -% MOMENT_Y, MOMENT_Z, EFFICIENCY, -% EQUIVALENT_AREA, NEARFIELD_PRESSURE, -% FORCE_X, FORCE_Y, FORCE_Z, THRUST, -% TORQUE, TOTAL_HEATFLUX, -% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, -% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) -% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. -OBJECTIVE_FUNCTION= DRAG -% -% List of weighting values when using more than one OBJECTIVE_FUNCTION. Separate by commas and match with MARKER_MONITORING. -OBJECTIVE_WEIGHT = 1.0 -% -% Reference coefficient (sensitivity) for detecting sharp edges. -REF_SHARP_EDGES= 3.0 -% -% Remove sharp edges from the sensitivity evaluation (NO, YES) -SENS_REMOVE_SHARP= NO - % ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. @@ -301,52 +218,6 @@ SLOPE_LIMITER_FLOW= VENKATAKRISHNAN % Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO % -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the adjoint flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_ADJFLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE, -% SHARP_EDGES, WALL_DISTANCE) -SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence adjoint equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_ADJTURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN -% -% Coefficient for the Venkat's limiter (upwind scheme). A larger values decrease -% the extent of limiting, values approaching zero cause -% lower-order approximation to the solution (0.05 by default) -VENKAT_LIMITER_COEFF= 0.05 -% -% Coefficient for the adjoint sharp edges limiter (3.0 by default). -ADJ_SHARP_LIMITER_COEFF= 3.0 -% -% Freeze the value of the limiter after a number of iterations -LIMITER_ITER= 999999 -% -% 1st order artificial dissipation coefficients for -% the Lax–Friedrichs method ( 0.15 by default ) -LAX_SENSOR_COEFF= 0.15 -% -% 2nd and 4th order artificial dissipation coefficients for -% the JST method ( 0.5, 0.02 by default ) -JST_SENSOR_COEFF= ( 0.5, 0.02 ) -% -% 1st order artificial dissipation coefficients for -% the adjoint Lax–Friedrichs method ( 0.15 by default ) -ADJ_LAX_SENSOR_COEFF= 0.15 -% -% 2nd, and 4th order artificial dissipation coefficients for -% the adjoint JST method ( 0.5, 0.02 by default ) -ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) - % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % % Linear solver or smoother for implicit formulations (BCGSTAB, FGMRES, SMOOTHER) @@ -407,9 +278,6 @@ CONV_NUM_METHOD_TURB= SCALAR_UPWIND % Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % -% Reduction factor of the CFL coefficient in the turbulence problem -CFL_REDUCTION_TURB= 1.0 -% % Relaxation coefficient % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% @@ -432,17 +300,10 @@ DEFORM_CONSOLE_OUTPUT= YES % Minimum residual criteria for the linear solver convergence of grid deformation DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % -% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger -% value is also possible) -DEFORM_COEFF = 1E6 % % Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % --------------------------- CONVERGENCE PARAMETERS --------------------------% % Convergence criteria (CAUCHY, RESIDUAL) @@ -472,55 +333,22 @@ MESH_FILENAME= 2D_FlatPlate_Rounded.su2 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= restart_flow.dat -% -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -TABULAR_FORMAT= CSV +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % -% Output file with the forces breakdown -BREAKDOWN_FILENAME= forces_breakdown.dat -% -% Output file restart flow -RESTART_FILENAME= restart_flow.dat -% -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat -% % Output file flow (w/o extension) variables VOLUME_FILENAME= flow % -% Output file adjoint (w/o extension) variables -VOLUME_ADJ_FILENAME= adjoint -% -% Output Objective function -VALUE_OBJFUNC_FILENAME= of_eval.dat -% -% Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad.dat -% % Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow % -% Output file surface adjoint coefficient (w/o extension) -SURFACE_ADJ_FILENAME= surface_adjoint -% % Writing solution file frequency for physical time steps (dual time) OUTPUT_WRT_FREQ= 3 % -% -% Read binary restart files (YES, NO) -READ_BINARY_RESTART= YES -% % Screen output SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index 6c6a97a8f1f9..f8280f3caaed 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -46,7 +46,7 @@ import numpy as np # ------------------------------------------------------------------- -# Main +# Main # ------------------------------------------------------------------- def main(): @@ -54,38 +54,12 @@ def main(): # Command line options parser=OptionParser() parser.add_option("-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE") - parser.add_option("--nDim", dest="nDim", default=2, help="Define the number of DIMENSIONS", - metavar="DIMENSIONS") - parser.add_option("--nZone", dest="nZone", default=1, help="Define the number of ZONES", - metavar="ZONES") parser.add_option("--parallel", action="store_true", help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - parser.add_option("--fsi", dest="fsi", default="False", help="Launch the FSI driver", metavar="FSI") - - parser.add_option("--fem", dest="fem", default="False", help="Launch the FEM driver (General driver)", metavar="FEM") - - parser.add_option("--harmonic_balance", dest="harmonic_balance", default="False", - help="Launch the Harmonic Balance (HB) driver", metavar="HB") - - parser.add_option("--poisson_equation", dest="poisson_equation", default="False", - help="Launch the poisson equation driver (General driver)", metavar="POIS_EQ") - - parser.add_option("--wave_equation", dest="wave_equation", default="False", - help="Launch the wave equation driver (General driver)", metavar="WAVE_EQ") - - parser.add_option("--heat_equation", dest="heat_equation", default="False", - help="Launch the heat equation driver (General driver)", metavar="HEAT_EQ") - (options, args) = parser.parse_args() - options.nDim = int( options.nDim ) - options.nZone = int( options.nZone ) - options.fsi = options.fsi.upper() == 'TRUE' - options.fem = options.fem.upper() == 'TRUE' - options.harmonic_balance = options.harmonic_balance.upper() == 'TRUE' - options.poisson_equation = options.poisson_equation.upper() == 'TRUE' - options.wave_equation = options.wave_equation.upper() == 'TRUE' - options.heat_equation = options.heat_equation.upper() == 'TRUE' + options.nDim = int(2) + options.nZone = int(1) # Import mpi4py for parallel run if options.with_MPI == True: @@ -98,13 +72,6 @@ def main(): # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - if (options.nZone == 1) and ( options.fem or options.poisson_equation or options.wave_equation or options.heat_equation ): - SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); - elif options.harmonic_balance: - SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone == 2) and (options.fsi): - SU2Driver = pysu2.CFSIDriver(options.filename, options.nZone, comm); - else: SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) @@ -119,7 +86,7 @@ def main(): MovingMarker = 'plate' #specified by the user # Get all the tags with the moving option - MovingMarkerList = SU2Driver.GetAllMovingMarkersTag() + MovingMarkerList = SU2Driver.GetAllDeformMeshMarkersTag() # Get all the markers defined on this rank and their associated indices. allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() @@ -147,9 +114,9 @@ def main(): # Extract the initial position of each node on the moving marker CoordX = np.zeros(nVertex_MovingMarker) CoordY = np.zeros(nVertex_MovingMarker) + CoordZ = np.zeros(nVertex_MovingMarker) for iVertex in range(nVertex_MovingMarker): - CoordX[iVertex] = SU2Driver.GetVertexCoordX(MovingMarkerID, iVertex) - CoordY[iVertex] = SU2Driver.GetVertexCoordY(MovingMarkerID, iVertex) + CoordX[iVertex], CoordY[iVertex], CoordZ[iVertex] = SU2Driver.GetInitialMeshCoord(MovingMarkerID, iVertex) # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step if rank == 0: @@ -162,18 +129,15 @@ def main(): # Define the rigid body displacement and set the new coords of each node on the marker d_y = 0.0175*sin(2*pi*time) for iVertex in range(nVertex_MovingMarker): - newCoordX = CoordX[iVertex] - newCoordY = CoordY[iVertex] + d_y - SU2Driver.SetVertexCoordX(MovingMarkerID, iVertex, newCoordX) - SU2Driver.SetVertexCoordY(MovingMarkerID, iVertex, newCoordY) - SU2Driver.SetVertexCoordZ(MovingMarkerID, iVertex, 0.0) - SU2Driver.SetVertexVarCoord(MovingMarkerID, iVertex) + SU2Driver.SetMeshDisplacement(MovingMarkerID, int(iVertex), 0.0, d_y, 0.0) # Time iteration preprocessing SU2Driver.Preprocess(TimeIter) # Run one time iteration (e.g. dual-time) SU2Driver.Run() # Update the solver for the next time iteration SU2Driver.Update() + # Postprocess the solver + SU2Driver.Postprocess() # Monitor the solver and output solution to file if required stopCalc = SU2Driver.Monitor(TimeIter) SU2Driver.Output(TimeIter) @@ -183,9 +147,6 @@ def main(): TimeIter += 1 time += deltaT - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() - if SU2Driver != None: del SU2Driver @@ -195,4 +156,4 @@ def main(): # this is only accessed if running from command prompt if __name__ == '__main__': - main() + main() From 52a2a69390c3ee2804b2b9ba7969ceba9b0280e7 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sun, 14 Feb 2021 17:14:48 +0100 Subject: [PATCH 258/326] Introduced start time for forced motion --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index cf28f42a5ebb..6f6144c4bc28 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -50,12 +50,14 @@ def __init__(self,time0,tipo,parameters): self.bias = parameters[0] self.amplitude = parameters[1] self.frequency = parameters[2] + self.timeStart = parameters[3] elif self.tipo == "BLENDED_STEP": self.kmax = parameters[0] self.vinf = parameters[1] self.lref = parameters[2] self.amplitude = parameters[3] + self.timeStart = parameters[4] self.tmax = 2*pi/self.kmax*self.lref/self.vinf self.omega0 = 1/2*self.kmax @@ -64,35 +66,41 @@ def __init__(self,time0,tipo,parameters): def GetDispl(self,time): - time = time - self.time0 + time = time - self.time0 - self.timeStart if self.tipo == "SINUSOIDAL": return self.bias+self.amplitude*sin(2*pi*self.frequency*time) if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) return self.amplitude def GetVel(self,time): - time = time - self.time0 + time = time - self.time0 - self.timeStart if self.tipo == "SINUSOIDAL": return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) return 0.0 def GetAcc(self,time): - time = time - self.time0 + time = time - self.time0 - self.timeStart if self.tipo == "SINUSOIDAL": return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 return 0.0 From 727c129bf276dd276244d8b7798c714890efffe1 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 09:35:15 +0100 Subject: [PATCH 259/326] Final version of new test case --- .../flatPlate_rigidMotion_Conf.cfg | 128 +----------------- .../launch_flatPlate_rigidMotion.py | 7 +- 2 files changed, 11 insertions(+), 124 deletions(-) diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index d90e636e19da..8d28b9561710 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -25,22 +25,6 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % -% Discard the data storaged in the solution and geometry files -% e.g. AOA, dCL/dAoA, dCD/dCL, iter, etc. -% Note that AoA in the solution and geometry files is critical -% to aero design using AoA as a variable. (NO, YES) -DISCARD_INFILES= NO -% -% System of measurements (SI, US) -% International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, -% Density = kg/m^3, Speed = m/s, -% Equiv. Area = m^2 ) -% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, -% psf = lbf/ft^2, Density = slug/ft^3, -% Speed = ft/s, Equiv. Area = ft^2 ) -SYSTEM_MEASUREMENTS= SI - % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -49,9 +33,6 @@ MACH_NUMBER= 0.03059 % Angle of attack (degrees, only for compressible flows) AOA= 0.0 % -% Side-slip angle (degrees, only for compressible flows) -SIDESLIP_ANGLE= 0.0 -% % Init option to choose between Reynolds (default) or thermodynamics quantities % for initializing the solution (REYNOLDS, TD_CONDITIONS) INIT_OPTION= REYNOLDS @@ -60,9 +41,6 @@ INIT_OPTION= REYNOLDS % initializing the solution (TEMPERATURE_FS, DENSITY_FS) FREESTREAM_OPTION= TEMPERATURE_FS % -% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default) -FREESTREAM_PRESSURE= 101325.0 -% % Free-stream temperature (288.15 K, 518.67 R by default) FREESTREAM_TEMPERATURE= 293.15 % @@ -71,18 +49,7 @@ REYNOLDS_NUMBER= 24407.25244 % % Reynolds length (1 m, 1 inch by default) REYNOLDS_LENGTH= 0.035 - -% -------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION ------------------% -% -% Free-stream density (1.2886 Kg/m^3, 0.0025 slug/ft^3 by default) -FREESTREAM_DENSITY= 1.204 -% -% Free-stream velocity (1.0 m/s, 1.0 ft/s by default) -FREESTREAM_VELOCITY= ( 1.0, 0.00, 0.00 ) % -% Free-stream viscosity (1.853E-5 N s/m^2, 3.87E-7 lbf s/ft^2 by default) -FREESTREAM_VISCOSITY= 1.82E-5 - % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -97,60 +64,25 @@ REF_LENGTH= 0.035 % calculation) (m^2 or in^2) REF_AREA= 0.035 % -% Aircraft semi-span (0 implies automatic calculation) (m or in) -SEMI_SPAN= 0.0 -% % Flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, % FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) REF_DIMENSIONALIZATION= DIMENSIONAL - +% % ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % % Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) FLUID_MODEL= STANDARD_AIR % -% Ratio of specific heats (1.4 default and the value is hardcoded -% for the model STANDARD_AIR) -GAMMA_VALUE= 1.4 -% -% Specific gas constant (287.058 J/kg*K default and this value is hardcoded -% for the model STANDARD_AIR) -GAS_CONSTANT= 287.058 -% -% Critical Temperature (131.00 K by default) -CRITICAL_TEMPERATURE= 131.00 -% -% Critical Pressure (3588550.0 N/m^2 by default) -CRITICAL_PRESSURE= 3588550.0 -% -% Acentri factor (0.035 (air)) -ACENTRIC_FACTOR= 0.035 - % --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= SUTHERLAND % -% Molecular Viscosity that would be constant (1.716E-5 by default) -MU_CONSTANT= 1.716E-5 -% -% Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) -MU_REF= 1.716E-5 -% -% Sutherland Temperature Ref (273.15 K default value for AIR SI) -MU_T_REF= 273.15 -% -% Sutherland constant (110.4 default value for AIR SI) -SUTHERLAND_CONSTANT= 110.4 - % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% % % Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % -% Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 - % ------------------------- UNSTEADY SIMULATION -------------------------------% % TIME_DOMAIN=YES @@ -163,17 +95,13 @@ TIME_STEP= 0.003 % % Total Physical Time for dual time stepping simulations (s) MAX_TIME= 1.0 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 +TIME_ITER = 9999 % % Number of internal iterations (dual time method) INNER_ITER= 10 % % Iteration number to begin unsteady restarts RESTART_ITER= 0 - -TIME_ITER=9999 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % DEFORM_MESH = YES @@ -208,11 +136,7 @@ CFL_NUMBER= 7.0 % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. % Required for 2nd order upwind schemes (NO, YES) -MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +MUSCL_FLOW= NO % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. % Required for 2nd order upwind schemes (NO, YES) @@ -238,26 +162,8 @@ LINEAR_SOLVER_ITER= 10 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % % Multi-grid levels (0 = no multi-grid) -MGLEVEL= 3 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= W_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MGLEVEL= 0 % -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) -% -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 - % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % % Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, @@ -268,8 +174,7 @@ CONV_NUM_METHOD_FLOW= JST % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % -% Relaxation coefficient - +% % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % % Convective numerical method (SCALAR_UPWIND) @@ -278,8 +183,6 @@ CONV_NUM_METHOD_TURB= SCALAR_UPWIND % Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % -% Relaxation coefficient - % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % % Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) @@ -304,27 +207,7 @@ DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) DEFORM_STIFFNESS_TYPE= WALL_DISTANCE - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% Convergence criteria (CAUCHY, RESIDUAL) -% -CONV_CRITERIA= CAUCHY -% -% -% Min value of the residual (log10 of the residual) -CONV_RESIDUAL_MINVAL= -10 % -% Start convergence criteria at iteration number -CONV_STARTITER= 4 -% -% Number of elements to apply the criteria -CONV_CAUCHY_ELEMS= 10 -% -% Epsilon to control the series convergence -CONV_CAUCHY_EPS= 1E-6 -% -% - % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file @@ -352,3 +235,4 @@ OUTPUT_WRT_FREQ= 3 % % Screen output SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) +HISTORY_OUTPUT=(ITER,RMS_RES,AERO_COEFF) diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index f8280f3caaed..a611e6554d79 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -134,10 +134,10 @@ def main(): SU2Driver.Preprocess(TimeIter) # Run one time iteration (e.g. dual-time) SU2Driver.Run() - # Update the solver for the next time iteration - SU2Driver.Update() # Postprocess the solver SU2Driver.Postprocess() + # Update the solver for the next time iteration + SU2Driver.Update() # Monitor the solver and output solution to file if required stopCalc = SU2Driver.Monitor(TimeIter) SU2Driver.Output(TimeIter) @@ -147,6 +147,9 @@ def main(): TimeIter += 1 time += deltaT + # Postprocess the solver and exit cleanly + SU2Driver.Postprocessing() + if SU2Driver != None: del SU2Driver From 905ef8d6664525b1eff21d8aa83b2239747eefc7 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 10:50:56 +0100 Subject: [PATCH 260/326] Updated values in regression --- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c7ec41d0a580..98d91e311d3d 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1298,7 +1298,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614165, 2.242641, -0.038307, 0.173866] + pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350050, 0.093137] pywrapper_rigidMotion.su2_exec = "mpirun -np 2 python launch_flatPlate_rigidMotion.py --parallel -f" pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 55ffcd722dca..77dccd00fe71 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -86,8 +86,8 @@ def main(): viscwedge.timeout = 1600 viscwedge.new_output = True viscwedge.tol = 0.00001 - test_list.append(viscwedge) - + test_list.append(viscwedge) + ######################### ## Compressible Euler ### ######################### @@ -1877,7 +1877,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614167, 2.242632, -0.037871, 0.173912] + pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350050, 0.093137] pywrapper_rigidMotion.su2_exec = "python launch_flatPlate_rigidMotion.py -f" pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 From 6aca633731d46634b98e234c82e44456dfa2a994 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 10:51:20 +0100 Subject: [PATCH 261/326] Complete reorganisation of the interface --- SU2_CFD/include/drivers/CDriver.hpp | 205 +------ SU2_CFD/src/python_wrapper_structure.cpp | 534 +++++------------- .../launch_unsteady_CHT_FlatPlate.py | 48 +- 3 files changed, 162 insertions(+), 625 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index c698a85a14ee..617c23d7316c 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -97,10 +97,6 @@ class CDriver { vector > > interpolator_container; /*!< \brief Definition of the interpolation method between non-matching discretizations of the interface. */ CInterface ***interface_container; /*!< \brief Definition of the interface of information and physics. */ - su2double PyWrapVarCoord[3], /*!< \brief This is used to store the VarCoord of each vertex. */ - PyWrapNodalForce[3], /*!< \brief This is used to store the force at each vertex. */ - PyWrapNodalForceDensity[3], /*!< \brief This is used to store the force density at each vertex. */ - PyWrapNodalHeatFlux[3]; /*!< \brief This is used to store the heat flux at each vertex. */ bool dry_run; /*!< \brief Flag if SU2_CFD was started as dry-run via "SU2_CFD -d .cfg" */ public: @@ -368,7 +364,7 @@ class CDriver { /*! * \brief Process the boundary conditions and update the multigrid structure. */ - virtual void BoundaryConditionsUpdate() { } + void BoundaryConditionsUpdate(); /*! * \brief Get the total drag. @@ -468,118 +464,6 @@ class CDriver { */ vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex); - /*! - * \brief Get the x coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x coordinate of the vertex. - */ - passivedouble GetVertexCoordX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y coordinate of the vertex. - */ - passivedouble GetVertexCoordY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z coordinate of the vertex. - */ - passivedouble GetVertexCoordZ(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Compute the total force (pressure and shear stress) at a vertex on a specified marker (3 components). - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return True if the vertex is a halo node (non physical force). - */ - bool ComputeVertexForces(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the force at the vertex. - */ - passivedouble GetVertexForceX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the force at the vertex. - */ - passivedouble GetVertexForceY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the force at the vertex. - */ - passivedouble GetVertexForceZ(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityZ(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Set the x coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] newPosX - New x coordinate of the vertex. - */ - void SetVertexCoordX(unsigned short iMarker, unsigned long iVertex, passivedouble newPosX); - - /*! - * \brief Set the y coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] newPosY - New y coordinate of the vertex. - */ - void SetVertexCoordY(unsigned short iMarker, unsigned long iVertex, passivedouble newPosY); - - /*! - * \brief Set the z coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] newPosZ - New z coordinate of the vertex. - */ - void SetVertexCoordZ(unsigned short iMarker, unsigned long iVertex, passivedouble newPosZ); - - /*! - * \brief Set the VarCoord of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Norm of the VarCoord. - */ - passivedouble SetVertexVarCoord(unsigned short iMarker, unsigned long iVertex); - /*! * \brief Get the temperature at a vertex on a specified marker. * \param[in] iMarker - Marker identifier. @@ -597,36 +481,12 @@ class CDriver { void SetVertexTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallTemp); /*! - * \brief Compute the heat flux at a vertex on a specified marker (3 components). + * \brief Get the heat flux at a vertex on a specified marker (3 components). * \param[in] iMarker - Marker identifier. * \param[in] iVertex - Vertex identifier. * \return True if the vertex is a halo node. */ - bool ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxZ(unsigned short iMarker, unsigned long iVertex); + vector GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex); /*! * \brief Get the wall normal component of the heat flux at a vertex on a specified marker. @@ -675,24 +535,12 @@ class CDriver { */ vector GetAllBoundaryMarkersTag(); - /*! - * \brief Get all the moving boundary markers tags. - * \return List of moving boundary markers tags. - */ - vector GetAllMovingMarkersTag(); - /*! * \brief Get all the deformable boundary marker tags. * \return List of deformable boundary markers tags. */ vector GetAllDeformMeshMarkersTag(); - /*! - * \brief Get all the fluid load boundary marker tags. - * \return List of fluid load boundary markers tags. - */ - vector GetAllFluidLoadMarkersTag(); - /*! * \brief Get all the heat transfer boundary markers tags. * \return List of heat transfer boundary markers tags. @@ -816,14 +664,6 @@ class CDriver { void SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, passivedouble val_AdjointY, passivedouble val_AdjointZ); - /*! - * \brief Get the undeformed mesh coordinates - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Undeformed Vertex Coordinates - */ - vector GetVertex_UndeformedCoord(unsigned short iMarker, unsigned long iVertex); - /*! * \brief Set the position of the heat source. * \param[in] alpha - Angle of rotation respect to Z axis. @@ -959,50 +799,11 @@ class CFluidDriver : public CDriver { */ void DynamicMeshUpdate(unsigned long TimeIter) override; - /*! - * \brief Process the boundary conditions and update the multigrid structure. - */ - void BoundaryConditionsUpdate() override; - /*! * \brief Transfer data among different zones (multiple zone). */ void Transfer_Data(unsigned short donorZone, unsigned short targetZone); - /*! - * \brief Set the total temperature of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_Ttotal - Value of the total (stagnation) temperature. - */ - void SetVertexTtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ttotal); - - /*! - * \brief Set the total pressure of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_Ptotal - Value of the total (stagnation) pressure. - */ - void SetVertexPtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ptotal); - - /*! - * \brief Set the flow direction of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the flow direction unit vector - * \param[in] val_FlowDir - Component of a unit vector representing the flow direction - */ - void SetVertexFlowDir(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_FlowDir); - - /*! - * \brief Set a turbulence variable on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the turbulence variable (i.e. k is 0 in SST) - * \param[in] val_turb_var - Value of the turbulence variable to be used. - */ - void SetVertexTurbVar(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_tub_var); - }; diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index ff61589d1704..383ddc2eec9d 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -59,22 +59,13 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geom } } } - /*--- Initialize some variables used for external communications trough the Py wrapper. ---*/ - PyWrapVarCoord[0] = 0.0; - PyWrapVarCoord[1] = 0.0; - PyWrapVarCoord[2] = 0.0; - PyWrapNodalForce[0] = 0.0; - PyWrapNodalForce[1] = 0.0; - PyWrapNodalForce[2] = 0.0; - PyWrapNodalForceDensity[0] = 0.0; - PyWrapNodalForceDensity[1] = 0.0; - PyWrapNodalForceDensity[2] = 0.0; - PyWrapNodalHeatFlux[0] = 0.0; - PyWrapNodalHeatFlux[1] = 0.0; - PyWrapNodalHeatFlux[2] = 0.0; } +///////////////////////////////////////////////////////////////////////////// +/* Functions related to the global performance indices (Lift, Drag, ecc..) */ +///////////////////////////////////////////////////////////////////////////// + passivedouble CDriver::Get_Drag() { unsigned short val_iZone = ZONE_0; @@ -178,6 +169,10 @@ passivedouble CDriver::Get_LiftCoeff() { return SU2_TYPE::GetValue(CLift); } +///////////////////////////////////////////////////////////////////////////// +/* Functions to obtain information from the geometry/mesh */ +///////////////////////////////////////////////////////////////////////////// + unsigned long CDriver::GetNumberVertices(unsigned short iMarker){ return geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; @@ -219,21 +214,6 @@ bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) { } -unsigned long CDriver::GetnTimeIter() { - - return config_container[ZONE_0]->GetnTime_Iter(); -} - -unsigned long CDriver::GetTime_Iter() const{ - - return TimeIter; -} - -passivedouble CDriver::GetUnsteady_TimeStep(){ - - return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); -} - vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) { vector coord(3,0.0); @@ -251,151 +231,50 @@ vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsig return coord_passive; } -passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned long iVertex) { - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[0]); -} - -passivedouble CDriver::GetVertexCoordY(unsigned short iMarker, unsigned long iVertex) { - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[1]); -} - -passivedouble CDriver::GetVertexCoordZ(unsigned short iMarker, unsigned long iVertex) { - - if(nDim == 2) return 0.0; - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[2]); -} - -bool CDriver::ComputeVertexForces(unsigned short iMarker, unsigned long iVertex) { - - unsigned long iPoint; - unsigned short iDim; - su2double *Normal, Area; - - unsigned short FinestMesh = config_container[ZONE_0]->GetFinestMesh(); - - /*--- Check the kind of fluid problem ---*/ - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); - bool incompressible = (config_container[ZONE_0]->GetKind_Regime() == INCOMPRESSIBLE); - bool viscous_flow = config_container[ZONE_0]->GetViscous(); - - /*--- Parameters for the calculations ---*/ - // Pn: Pressure - // Pinf: Pressure_infinite - su2double Pn = 0.0; - su2double Viscosity = 0.0; - su2double Tau[3][3] = {{0.0}}; - - su2double Pinf = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetPressure_Inf(); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); +vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex){ - /*--- It is necessary to distinguish the halo nodes from the others, since they introduce non physical forces. ---*/ - if (!geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)) - return true; + su2double *Normal; + su2double Area; + vector ret_Normal(3, 0.0); + vector ret_Normal_passive(3, 0.0); - /*--- Get the normal at the vertex: this normal goes inside the fluid domain. ---*/ Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); - - /*--- Get the values of pressure and viscosity ---*/ - Pn = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetPressure(iPoint); - if (viscous_flow) { - Viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - } - - /*--- Calculate the inviscid (pressure) part of tn in the fluid nodes (force units) ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForce[iDim] = -(Pn-Pinf)*Normal[iDim]; //NB : norm(Normal) = Area - } - - /*--- Calculate the viscous (shear stress) part of tn in the fluid nodes (force units) ---*/ - if ((incompressible || compressible) && viscous_flow) { - CNumerics::ComputeStressTensor(nDim, Tau, - solver_container[ZONE_0][INST_0][FinestMesh][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint)+1, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); - } - } - - //Divide by local are in case of force density communication. - for(iDim = 0; iDim < nDim; iDim++) - PyWrapNodalForceDensity[iDim] = PyWrapNodalForce[iDim]/Area; - return false; -} - -passivedouble CDriver::GetVertexForceX(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[0]); -} - -passivedouble CDriver::GetVertexForceY(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[1]); -} - -passivedouble CDriver::GetVertexForceZ(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForce[2]); -} + Area = GeometryToolbox::Norm(nDim, Normal); -passivedouble CDriver::GetVertexForceDensityX(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[0]); -} + ret_Normal[0] = Normal[0]/Area; + ret_Normal[1] = Normal[1]/Area; + if(nDim>2) ret_Normal[2] = Normal[2]/Area; -passivedouble CDriver::GetVertexForceDensityY(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[1]); -} + ret_Normal_passive[0] = SU2_TYPE::GetValue(ret_Normal[0]); + ret_Normal_passive[1] = SU2_TYPE::GetValue(ret_Normal[1]); + ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); -passivedouble CDriver::GetVertexForceDensityZ(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[2]); + return ret_Normal_passive; } -void CDriver::SetVertexCoordX(unsigned short iMarker, unsigned long iVertex, passivedouble newPosX) { +////////////////////////////////////////////////////////////////////////////////// +/* Functions to obtain global parameters from SU2 (time steps, delta t, ecc...) */ +////////////////////////////////////////////////////////////////////////////////// - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); +unsigned long CDriver::GetnTimeIter() { - PyWrapVarCoord[0] = newPosX - Coord[0]; + return config_container[ZONE_0]->GetnTime_Iter(); } -void CDriver::SetVertexCoordY(unsigned short iMarker, unsigned long iVertex, passivedouble newPosY) { - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); +unsigned long CDriver::GetTime_Iter() const{ - PyWrapVarCoord[1] = newPosY - Coord[1]; + return TimeIter; } -void CDriver::SetVertexCoordZ(unsigned short iMarker, unsigned long iVertex, passivedouble newPosZ) { - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - auto Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); +passivedouble CDriver::GetUnsteady_TimeStep(){ - if(nDim > 2) { - PyWrapVarCoord[2] = newPosZ - Coord[2]; - } - else { - PyWrapVarCoord[2] = 0.0; - } + return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } -passivedouble CDriver::SetVertexVarCoord(unsigned short iMarker, unsigned long iVertex) { - - su2double nodalVarCoordNorm; - - geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->SetVarCoord(PyWrapVarCoord); - nodalVarCoordNorm = sqrt((PyWrapVarCoord[0])*(PyWrapVarCoord[0]) + (PyWrapVarCoord[1])*(PyWrapVarCoord[1]) + (PyWrapVarCoord[2])*(PyWrapVarCoord[2])); - - return SU2_TYPE::GetValue(nodalVarCoordNorm); - -} +/////////////////////////////////////////////////////////////////////////////// +/* Functions related to CHT solver */ +/////////////////////////////////////////////////////////////////////////////// passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex){ @@ -419,7 +298,7 @@ void CDriver::SetVertexTemperature(unsigned short iMarker, unsigned long iVertex geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryTemperature(iMarker, iVertex, val_WallTemp); } -bool CDriver::ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex){ +vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex){ unsigned long iPoint; unsigned short iDim; @@ -429,45 +308,29 @@ bool CDriver::ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVer su2double Gamma_Minus_One = Gamma - 1.0; su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; su2double laminar_viscosity, thermal_conductivity; - su2double GradT[3] = {0.0,0.0,0.0}; + vector GradT (3,0.0); + vector HeatFlux (3,0.0); + vector HeatFluxPassive (3,0.0); bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); bool halo; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)){ - halo = false; - } - else{ - halo = true; - } - - if(!halo && compressible){ + if(compressible){ laminar_viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); thermal_conductivity = Cp * (laminar_viscosity/Prandtl_Lam); for(iDim=0; iDim < nDim; iDim++){ GradT[iDim] = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint, 0, iDim); - PyWrapNodalHeatFlux[iDim] = -thermal_conductivity*GradT[iDim]; + HeatFlux[iDim] = -thermal_conductivity*GradT[iDim]; } } - return halo; -} + HeatFluxPassive[0] = SU2_TYPE::GetValue(HeatFlux[0]); + HeatFluxPassive[1] = SU2_TYPE::GetValue(HeatFlux[1]); + HeatFluxPassive[2] = SU2_TYPE::GetValue(HeatFlux[2]); -passivedouble CDriver::GetVertexHeatFluxX(unsigned short iMarker, unsigned long iVertex){ - - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[0]); -} - -passivedouble CDriver::GetVertexHeatFluxY(unsigned short iMarker, unsigned long iVertex){ - - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[1]); -} - -passivedouble CDriver::GetVertexHeatFluxZ(unsigned short iMarker, unsigned long iVertex){ - - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[2]); + return HeatFluxPassive; } passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex){ @@ -536,27 +399,9 @@ passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned l } -vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex){ - - su2double *Normal; - su2double Area; - vector ret_Normal(3, 0.0); - vector ret_Normal_passive(3, 0.0); - - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - - Area = GeometryToolbox::Norm(nDim, Normal); - - ret_Normal[0] = Normal[0]/Area; - ret_Normal[1] = Normal[1]/Area; - if(nDim>2) ret_Normal[2] = Normal[2]/Area; - - ret_Normal_passive[0] = SU2_TYPE::GetValue(ret_Normal[0]); - ret_Normal_passive[1] = SU2_TYPE::GetValue(ret_Normal[1]); - ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); - - return ret_Normal_passive; -} +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to the management of markers */ +//////////////////////////////////////////////////////////////////////////////// vector CDriver::GetAllBoundaryMarkersTag(){ @@ -575,23 +420,6 @@ vector CDriver::GetAllBoundaryMarkersTag(){ return boundariesTagList; } -vector CDriver::GetAllMovingMarkersTag(){ - - vector movingBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_Moving(); - movingBoundariesTagList.resize(nBoundariesMarker); - - for(iMarker=0; iMarker < nBoundariesMarker; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_Moving_TagBound(iMarker); - movingBoundariesTagList[iMarker] = Marker_Tag; - } - - return movingBoundariesTagList; -} - vector CDriver::GetAllDeformMeshMarkersTag(){ vector interfaceBoundariesTagList; @@ -609,23 +437,6 @@ vector CDriver::GetAllDeformMeshMarkersTag(){ return interfaceBoundariesTagList; } -vector CDriver::GetAllFluidLoadMarkersTag(){ - - vector interfaceBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_Fluid_Load(); - interfaceBoundariesTagList.resize(nBoundariesMarker); - - for(iMarker=0; iMarker < nBoundariesMarker; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_Fluid_Load_TagBound(iMarker); - interfaceBoundariesTagList[iMarker] = Marker_Tag; - } - - return interfaceBoundariesTagList; -} - vector CDriver::GetAllCHTMarkersTag(){ vector CHTBoundariesTagList; @@ -633,7 +444,6 @@ vector CDriver::GetAllCHTMarkersTag(){ string Marker_Tag; nBoundariesMarker = config_container[ZONE_0]->GetnMarker_All(); - //CHTBoundariesTagList.resize(nBoundariesMarker); //The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. for(iMarker=0; iMarker CDriver::GetAllBoundaryMarkersType(){ return allBoundariesTypeMap; } +void CDriver::SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z){ + + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][RAD_SOL]; + + config_container[ZONE_0]->SetHeatSource_Rot_Z(alpha); + config_container[ZONE_0]->SetHeatSource_Center(pos_x, pos_y, pos_z); + + solver->SetVolumetricHeatSource(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0]); + +} + +void CDriver::SetInlet_Angle(unsigned short iMarker, passivedouble alpha){ + + su2double alpha_rad = alpha * PI_NUMBER/180.0; + + unsigned long iVertex; + + for (iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); + } + +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* Functions related to simulation control, high level functions (reset convergence, set initial mesh, ecc...) */ +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CDriver::ResetConvergence() { for(iZone = 0; iZone < nZone; iZone++) { @@ -778,45 +616,7 @@ void CSinglezoneDriver::SetInitialMesh() { } } -void CFluidDriver::SetVertexTtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ttotal_passive){ - - su2double val_Ttotal = val_Ttotal_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_Ttotal(iMarker, iVertex, val_Ttotal); - -} - -void CFluidDriver::SetVertexPtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ptotal_passive){ - - su2double val_Ptotal = val_Ptotal_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_Ptotal(iMarker, iVertex, val_Ptotal); - -} - -void CFluidDriver::SetVertexFlowDir(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_FlowDir_passive){ - - su2double val_FlowDir = val_FlowDir_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, iDim, val_FlowDir); - -} - -void CFluidDriver::SetVertexTurbVar(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_turb_var_passive){ - - su2double val_turb_var = val_turb_var_passive; - - if (solver_container[ZONE_0][INST_0] == nullptr || - solver_container[ZONE_0][INST_0][MESH_0] == nullptr) { - SU2_MPI::Error("Could not find an appropriate solver.", CURRENT_FUNCTION); - } else if (solver_container[ZONE_0][INST_0][MESH_0][TURB_SOL] == nullptr) { - SU2_MPI::Error("Tried to set turbulence variables without a turbulence solver.", CURRENT_FUNCTION); - } - solver_container[ZONE_0][INST_0][MESH_0][TURB_SOL]->SetInlet_TurbVar(iMarker, iVertex, iDim, val_turb_var); - -} - -void CFluidDriver::BoundaryConditionsUpdate(){ +void CDriver::BoundaryConditionsUpdate(){ int rank = MASTER_NODE; unsigned short iZone; @@ -829,63 +629,21 @@ void CFluidDriver::BoundaryConditionsUpdate(){ } } -void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { - - unsigned long iPoint; - PyWrapVarCoord[0] = DispX; - PyWrapVarCoord[1] = DispY; - PyWrapVarCoord[2] = DispZ; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,PyWrapVarCoord); - -} - -void CDriver::CommunicateMeshDisplacement(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); - -} - -vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) { - - unsigned long iPoint; - vector Disp_Sens(3, 0.0); - vector Disp_Sens_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJMESH_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - Disp_Sens[0] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 0); - Disp_Sens[1] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 1); - if (geometry->GetnDim() == 3) - Disp_Sens[2] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 2); - else - Disp_Sens[2] = 0.0; - - Disp_Sens_passive[0] = SU2_TYPE::GetValue(Disp_Sens[0]); - Disp_Sens_passive[1] = SU2_TYPE::GetValue(Disp_Sens[1]); - Disp_Sens_passive[2] = SU2_TYPE::GetValue(Disp_Sens[2]); - - return Disp_Sens_passive; - -} +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to finite elements */ +//////////////////////////////////////////////////////////////////////////////// void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passivedouble LoadX, passivedouble LoadY, passivedouble LoadZ) { unsigned long iPoint; - PyWrapNodalForce[0] = LoadX; - PyWrapNodalForce[1] = LoadY; - PyWrapNodalForce[2] = LoadZ; + vector NodalForce (3,0.0); + NodalForce[0] = LoadX; + NodalForce[1] = LoadY; + NodalForce[2] = LoadZ; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,PyWrapNodalForce); + solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce); } @@ -967,6 +725,37 @@ vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigne } +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to adjoint simulations */ +//////////////////////////////////////////////////////////////////////////////// + +vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) { + + unsigned long iPoint; + vector Disp_Sens(3, 0.0); + vector Disp_Sens_passive(3, 0.0); + + iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJMESH_SOL]; + CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; + + Disp_Sens[0] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 0); + Disp_Sens[1] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 1); + if (geometry->GetnDim() == 3) + Disp_Sens[2] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 2); + else + Disp_Sens[2] = 0.0; + + Disp_Sens_passive[0] = SU2_TYPE::GetValue(Disp_Sens[0]); + Disp_Sens_passive[1] = SU2_TYPE::GetValue(Disp_Sens[1]); + Disp_Sens_passive[2] = SU2_TYPE::GetValue(Disp_Sens[2]); + + return Disp_Sens_passive; + +} + + + vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) { unsigned long iPoint; @@ -992,31 +781,6 @@ vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, u } -vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) { - - vector FlowLoad(3, 0.0); - vector FlowLoad_passive(3, 0.0); - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - if (config_container[ZONE_0]->GetSolid_Wall(iMarker)) { - FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); - FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); - if (geometry->GetnDim() == 3) - FlowLoad[2] = solver->GetVertexTractions(iMarker, iVertex, 2); - else - FlowLoad[2] = 0.0; - } - - FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); - FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); - FlowLoad_passive[2] = SU2_TYPE::GetValue(FlowLoad[2]); - - return FlowLoad_passive; - -} - void CDriver::SetFlowLoad_Adjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, passivedouble val_AdjointY, passivedouble val_AdjointZ) { @@ -1046,53 +810,59 @@ void CDriver::SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iV } -vector CDriver::GetVertex_UndeformedCoord(unsigned short iMarker, unsigned long iVertex) { +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to mesh deformation */ +//////////////////////////////////////////////////////////////////////////////// - unsigned long iPoint; - vector MeshCoord(3, 0.0); - vector MeshCoord_passive(3, 0.0); +void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + unsigned long iPoint; + vector MeshDispl (3,0.0); - if (solver != nullptr) { - MeshCoord[0] = solver->GetNodes()->GetMesh_Coord(iPoint,0); - MeshCoord[1] = solver->GetNodes()->GetMesh_Coord(iPoint,1); - if (geometry->GetnDim() == 3) - MeshCoord[2] = solver->GetNodes()->GetMesh_Coord(iPoint,2); - else - MeshCoord[2] = 0.0; - } + MeshDispl[0] = DispX; + MeshDispl[1] = DispY; + MeshDispl[2] = DispZ; - MeshCoord_passive[0] = SU2_TYPE::GetValue(MeshCoord[0]); - MeshCoord_passive[1] = SU2_TYPE::GetValue(MeshCoord[1]); - MeshCoord_passive[2] = SU2_TYPE::GetValue(MeshCoord[2]); + iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - return MeshCoord_passive; + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl); } -void CDriver::SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z){ - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][RAD_SOL]; - - config_container[ZONE_0]->SetHeatSource_Rot_Z(alpha); - config_container[ZONE_0]->SetHeatSource_Center(pos_x, pos_y, pos_z); +void CDriver::CommunicateMeshDisplacement(void) { - solver->SetVolumetricHeatSource(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0]); + 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); } -void CDriver::SetInlet_Angle(unsigned short iMarker, passivedouble alpha){ +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to flow loads */ +//////////////////////////////////////////////////////////////////////////////// - su2double alpha_rad = alpha * PI_NUMBER/180.0; +vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) { - unsigned long iVertex; + vector FlowLoad(3, 0.0); + vector FlowLoad_passive(3, 0.0); - for (iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; + CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; + + if (config_container[ZONE_0]->GetSolid_Wall(iMarker)) { + FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); + FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); + if (geometry->GetnDim() == 3) + FlowLoad[2] = solver->GetVertexTractions(iMarker, iVertex, 2); + else + FlowLoad[2] = 0.0; } + FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); + FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); + FlowLoad_passive[2] = SU2_TYPE::GetValue(FlowLoad[2]); + + return FlowLoad_passive; + } diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py index 1ed717dd6974..06a3edd2b7eb 100755 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py @@ -45,7 +45,7 @@ from math import * # ------------------------------------------------------------------- -# Main +# Main # ------------------------------------------------------------------- def main(): @@ -53,38 +53,12 @@ def main(): # Command line options parser=OptionParser() parser.add_option("-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE") - parser.add_option("--nDim", dest="nDim", default=2, help="Define the number of DIMENSIONS", - metavar="DIMENSIONS") - parser.add_option("--nZone", dest="nZone", default=1, help="Define the number of ZONES", - metavar="ZONES") parser.add_option("--parallel", action="store_true", help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - parser.add_option("--fsi", dest="fsi", default="False", help="Launch the FSI driver", metavar="FSI") - - parser.add_option("--fem", dest="fem", default="False", help="Launch the FEM driver (General driver)", metavar="FEM") - - parser.add_option("--harmonic_balance", dest="harmonic_balance", default="False", - help="Launch the Harmonic Balance (HB) driver", metavar="HB") - - parser.add_option("--poisson_equation", dest="poisson_equation", default="False", - help="Launch the poisson equation driver (General driver)", metavar="POIS_EQ") - - parser.add_option("--wave_equation", dest="wave_equation", default="False", - help="Launch the wave equation driver (General driver)", metavar="WAVE_EQ") - - parser.add_option("--heat_equation", dest="heat_equation", default="False", - help="Launch the heat equation driver (General driver)", metavar="HEAT_EQ") - (options, args) = parser.parse_args() - options.nDim = int( options.nDim ) - options.nZone = int( options.nZone ) - options.fsi = options.fsi.upper() == 'TRUE' - options.fem = options.fem.upper() == 'TRUE' - options.harmonic_balance = options.harmonic_balance.upper() == 'TRUE' - options.poisson_equation = options.poisson_equation.upper() == 'TRUE' - options.wave_equation = options.wave_equation.upper() == 'TRUE' - options.heat_equation = options.heat_equation.upper() == 'TRUE' + options.nDim = int(2) + options.nZone = int(1) # Import mpi4py for parallel run if options.with_MPI == True: @@ -92,18 +66,11 @@ def main(): comm = MPI.COMM_WORLD rank = comm.Get_rank() else: - comm = 0 + comm = 0 rank = 0 # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - if (options.nZone == 1) and ( options.fem or options.poisson_equation or options.wave_equation or options.heat_equation ): - SU2Driver = pysu2.CGeneralDriver(options.filename, options.nZone, comm); - elif options.harmonic_balance: - SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone == 2) and (options.fsi): - SU2Driver = pysu2.CFSIDriver(options.filename, options.nZone, comm); - else: SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) @@ -162,6 +129,8 @@ def main(): SU2Driver.BoundaryConditionsUpdate() # Run one time iteration (e.g. dual-time) SU2Driver.Run() + # Postprocess the solver and exit cleanly + SU2Driver.Postprocess() # Update the solver for the next time iteration SU2Driver.Update() # Monitor the solver and output solution to file if required @@ -173,9 +142,6 @@ def main(): TimeIter += 1 time += deltaT - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() - if SU2Driver != None: del SU2Driver @@ -185,4 +151,4 @@ def main(): # this is only accessed if running from command prompt if __name__ == '__main__': - main() + main() From 96e23ea2a9a29046344c924ec10b469fe7ef404f Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 11:06:13 +0100 Subject: [PATCH 262/326] Fixes to vector data --- SU2_CFD/src/python_wrapper_structure.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 383ddc2eec9d..14d9b5bc362e 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -643,7 +643,7 @@ void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passiv NodalForce[2] = LoadZ; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce); + solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce.data()); } @@ -825,7 +825,7 @@ void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl); + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl.data()); } From 4c1fdcff3a803b4909a18eae847144bdc6182388 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Mon, 15 Feb 2021 11:24:27 +0100 Subject: [PATCH 263/326] minor changes and correction --- .../numerics/turbulent/turb_sources.hpp | 52 +++++++++---------- .../src/numerics/turbulent/turb_sources.cpp | 9 ++-- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 52bb1c46cd47..ccc7428c4714 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -307,8 +307,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { beta_2, sigma_k_1, sigma_k_2, - sigma_omega_1, - sigma_omega_2, + sigma_w_1, + sigma_w_2, beta_star, a1; @@ -335,44 +335,40 @@ class CSourcePieceWise_TurbSST final : public CNumerics { */ inline void ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ - if (Coord_i[1] < EPS) { - return; - } + if (Coord_i[1] < EPS) return; - su2double yinv, rhov; - su2double sigma_k_i, sigma_omega_i; - su2double pk_axi, pw_axi, ck_axi, cw_axi, dk_axi, dw_axi; + su2double yinv, rhov, k, w; + su2double sigma_k_i, sigma_w_i; + su2double pk_axi, pw_axi, cdk_axi, cdw_axi; AD::SetPreaccIn(Coord_i[1]); + yinv = 1.0/Coord_i[1]; rhov = Density_i*V_i[2]; + k = TurbVar_i[0]; + w = TurbVar_i[1]; /*--- Compute blended constants ---*/ - sigma_k_i = F1_i*sigma_k_1 + (1.0 - F1_i)*sigma_k_2; - sigma_omega_i = F1_i*sigma_omega_1 + (1.0 - F1_i)*sigma_omega_2; + sigma_k_i = F1_i*sigma_k_1+(1.0-F1_i)*sigma_k_2; + sigma_w_i = F1_i*sigma_w_1+(1.0-F1_i)*sigma_w_2; /*--- Production ---*/ - pk_axi = max(0.0,2.0/3.0*rhov*TurbVar_i[0]*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1] - -PrimVar_Grad_i[1][0]) -1.0)); - pw_axi = alfa_blended*zeta/TurbVar_i[0]*pk_axi; - - /*--- Convection ---*/ - ck_axi = rhov*TurbVar_i[0]; - cw_axi = rhov*TurbVar_i[1]; + pk_axi = max(0.0,2.0/3.0*rhov*k*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1]-PrimVar_Grad_i[1][0])-1.0)); + pw_axi = alfa_blended*zeta/k*pk_axi; - /*--- Diffusion ---*/ - dk_axi = (Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; - dw_axi = (Laminar_Viscosity_i+sigma_omega_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + /*--- Convection-Diffusion ---*/ + cdk_axi = rhov*k-(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + cdw_axi = rhov*w-(Laminar_Viscosity_i+sigma_w_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; - /*--- Add all terms to the residuals ---*/ - Residual[0] += yinv*Volume*(pk_axi-ck_axi+dk_axi); - Residual[1] += yinv*Volume*(pw_axi-cw_axi+dw_axi); + /*--- Add terms to the residuals ---*/ + Residual[0] += yinv*Volume*(pk_axi-cdk_axi); + Residual[1] += yinv*Volume*(pw_axi-cdw_axi); - /*--- Add contribution to the jacobian for implicit time integration---*/ - Jacobian_i[0][0] += yinv*Volume*(sigma_k_i/zeta*TurbVar_Grad_i[0][1]-V_i[2]); - Jacobian_i[0][1] -= yinv*Volume*sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[0][1]/(zeta*zeta); - Jacobian_i[1][0] += yinv*Volume*sigma_k_i/zeta*TurbVar_Grad_i[1][1]; - Jacobian_i[1][1] -= yinv*Volume*(sigma_k_i*TurbVar_i[0]*TurbVar_Grad_i[1][1]/(zeta*zeta)+V_i[2]); + /*--- Add contribution to the jacobian for implicit time integration--- */ + Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); + Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); + Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); + Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); } diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 2bda748ccb1c..f9aa7f64fafc 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -764,16 +764,16 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, axisymmetric = config->GetAxisymmetric(); /*--- Closure constants ---*/ - beta_star = constants[6]; sigma_k_1 = constants[0]; sigma_k_2 = constants[1]; - sigma_omega_1 = constants[2]; - sigma_omega_2 = constants[3]; + sigma_w_1 = constants[2]; + sigma_w_2 = constants[3]; beta_1 = constants[4]; beta_2 = constants[5]; + beta_star = constants[6]; + a1 = constants[7]; alfa_1 = constants[8]; alfa_2 = constants[9]; - a1 = constants[7]; /*--- Set the ambient values of k and omega to the free stream values. ---*/ kAmb = val_kine_Inf; @@ -849,7 +849,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; } - pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); pk = max(pk,0.0); From fbcca5870e04284026bddb1ad2010e27755738b9 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 11:29:22 +0100 Subject: [PATCH 264/326] Better initialisation of variables --- SU2_CFD/src/python_wrapper_structure.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 14d9b5bc362e..80b4d9aa98e2 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -637,13 +637,13 @@ void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passiv passivedouble LoadY, passivedouble LoadZ) { unsigned long iPoint; - vector NodalForce (3,0.0); + su2double NodalForce[3] = {0.0,0.0,0.0}; NodalForce[0] = LoadX; NodalForce[1] = LoadY; NodalForce[2] = LoadZ; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce.data()); + solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce); } @@ -817,7 +817,7 @@ void CDriver::SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iV void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { unsigned long iPoint; - vector MeshDispl (3,0.0); + su2double MeshDispl[3] = {0.0,0.0,0.0}; MeshDispl[0] = DispX; MeshDispl[1] = DispY; @@ -825,7 +825,7 @@ void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl.data()); + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl); } From 8a14d4df0a386944d06ec498494179b0e52501a7 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 11:37:39 +0100 Subject: [PATCH 265/326] Small typo in parallel regression --- TestCases/parallel_regression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 98d91e311d3d..ab0f720073f2 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -59,7 +59,7 @@ def main(): thermalbath_frozen.cfg_dir = "nonequilibrium/thermalbath/frozen" thermalbath_frozen.cfg_file = "thermalbath_frozen.cfg" thermalbath_frozen.test_iter = 10 - thermalbath_frozen.test_vals = [ -32.000000, -32.000000, -11.92359, -11.962329, -32.000000, 10.813864] + thermalbath_frozen.test_vals = [ -32.000000, -32.000000, -11.92359, -11.962329, -32.000000, 10.813864] thermalbath_frozen.su2_exec = "mpirun -n 2 SU2_CFD" thermalbath_frozen.timeout = 1600 thermalbath_frozen.new_output = True @@ -1298,7 +1298,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350050, 0.093137] + pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350036, 0.093137] pywrapper_rigidMotion.su2_exec = "mpirun -np 2 python launch_flatPlate_rigidMotion.py --parallel -f" pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 From dd1b1b39e0ea33a85dc06d8e415d2e242d4ce410 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Mon, 15 Feb 2021 11:58:28 +0100 Subject: [PATCH 266/326] comment out jacobian to conserve diagonal dominance --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index ccc7428c4714..0f69bb5a4fcb 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -364,11 +364,11 @@ class CSourcePieceWise_TurbSST final : public CNumerics { Residual[0] += yinv*Volume*(pk_axi-cdk_axi); Residual[1] += yinv*Volume*(pw_axi-cdw_axi); - /*--- Add contribution to the jacobian for implicit time integration--- */ - Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); - Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); - Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); - Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); + /*--- Add contribution to the jacobian for implicit time integration--- (ignore to conserve diagonal dominance)*/ + //Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); + //Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); + //Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); + //Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); } From 4767adb677f7006224a9ea152c497388ef70750d Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Mon, 15 Feb 2021 12:14:21 +0100 Subject: [PATCH 267/326] spaces and comments --- .../numerics/turbulent/turb_sources.hpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 0f69bb5a4fcb..f936e5996a3e 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -336,18 +336,18 @@ class CSourcePieceWise_TurbSST final : public CNumerics { inline void ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ if (Coord_i[1] < EPS) return; - + su2double yinv, rhov, k, w; su2double sigma_k_i, sigma_w_i; su2double pk_axi, pw_axi, cdk_axi, cdw_axi; AD::SetPreaccIn(Coord_i[1]); - + yinv = 1.0/Coord_i[1]; rhov = Density_i*V_i[2]; k = TurbVar_i[0]; w = TurbVar_i[1]; - + /*--- Compute blended constants ---*/ sigma_k_i = F1_i*sigma_k_1+(1.0-F1_i)*sigma_k_2; sigma_w_i = F1_i*sigma_w_1+(1.0-F1_i)*sigma_w_2; @@ -355,20 +355,20 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Production ---*/ pk_axi = max(0.0,2.0/3.0*rhov*k*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1]-PrimVar_Grad_i[1][0])-1.0)); pw_axi = alfa_blended*zeta/k*pk_axi; - + /*--- Convection-Diffusion ---*/ cdk_axi = rhov*k-(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; cdw_axi = rhov*w-(Laminar_Viscosity_i+sigma_w_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; - + /*--- Add terms to the residuals ---*/ Residual[0] += yinv*Volume*(pk_axi-cdk_axi); Residual[1] += yinv*Volume*(pw_axi-cdw_axi); - /*--- Add contribution to the jacobian for implicit time integration--- (ignore to conserve diagonal dominance)*/ - //Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); - //Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); - //Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); - //Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); + /*--- Add contribution to the jacobian for implicit time integration (ignore to conserve diagonal dominance) ---*/ + Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); + Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); + Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); + Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); } From 8a31347a8293bc5591a49debc8b1b560a566f379 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Mon, 15 Feb 2021 12:16:12 +0100 Subject: [PATCH 268/326] error --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f936e5996a3e..cd44fdabe59d 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -365,10 +365,10 @@ class CSourcePieceWise_TurbSST final : public CNumerics { Residual[1] += yinv*Volume*(pw_axi-cdw_axi); /*--- Add contribution to the jacobian for implicit time integration (ignore to conserve diagonal dominance) ---*/ - Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); - Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); - Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); - Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); + //Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); + //Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); + //Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); + //Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); } From 25be22d230f36a3c95500af0bd61763942e6255d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 15 Feb 2021 11:50:33 +0000 Subject: [PATCH 269/326] geometry was modified twice for RANS problems in SetDualTime_Solver --- SU2_CFD/include/integration/CIntegration.hpp | 12 +- .../integration/CStructuralIntegration.hpp | 8 ++ SU2_CFD/include/iteration/CFluidIteration.hpp | 10 ++ SU2_CFD/include/solvers/CFEASolver.hpp | 18 +-- SU2_CFD/include/solvers/CSolver.hpp | 26 ++-- SU2_CFD/src/integration/CIntegration.cpp | 128 ++---------------- .../integration/CStructuralIntegration.cpp | 36 +++++ SU2_CFD/src/iteration/CAdjFluidIteration.cpp | 5 + SU2_CFD/src/iteration/CFEAIteration.cpp | 5 +- SU2_CFD/src/iteration/CFluidIteration.cpp | 81 ++++++++++- SU2_CFD/src/iteration/CHeatIteration.cpp | 5 + SU2_CFD/src/solvers/CFEASolver.cpp | 18 +-- 12 files changed, 196 insertions(+), 156 deletions(-) diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 0c88a5d05596..2062713e718a 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -125,20 +125,20 @@ class CIntegration { inline bool GetConvergence_FullMG(void) const { return Convergence_FullMG; } /*! - * \brief Save the solution, and volume at different time steps. + * \brief Save the geometry at different time steps. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solution - Flow solution. + * \param[in] solver - Mesh solver. * \param[in] config - Definition of the particular problem. */ - void SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh); + void SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh); /*! - * \brief Save the structural solution at different time steps. + * \brief Save the solution at different time steps, and reset certain fields for the next timestep. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Structural solution. + * \param[in] solver - Some solver. * \param[in] config - Definition of the particular problem. */ - void SetStructural_Solver(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh); + virtual void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh); /*! * \brief A virtual member. diff --git a/SU2_CFD/include/integration/CStructuralIntegration.hpp b/SU2_CFD/include/integration/CStructuralIntegration.hpp index 845167a3d4b2..bcd446935803 100644 --- a/SU2_CFD/include/integration/CStructuralIntegration.hpp +++ b/SU2_CFD/include/integration/CStructuralIntegration.hpp @@ -51,6 +51,14 @@ class CStructuralIntegration final : public CIntegration { CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) override; + /*! + * \brief Save the solution at different time steps, and reset certain fields for the next timestep. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Structural solver. + * \param[in] config - Definition of the problem. + */ + void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) override; + private: /*! * \brief Do the space integration of the numerical system on a FEM framework. diff --git a/SU2_CFD/include/iteration/CFluidIteration.hpp b/SU2_CFD/include/iteration/CFluidIteration.hpp index 82cd95628be0..7a1ee9040606 100644 --- a/SU2_CFD/include/iteration/CFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFluidIteration.hpp @@ -115,6 +115,8 @@ class CFluidIteration : public CIteration { CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) override; + private: + /*! * \brief Imposes a gust via the grid velocities. * \author S. Padron @@ -146,4 +148,12 @@ class CFluidIteration : public CIteration { * \return Boolean indicating weather calculation should be stopped */ bool MonitorFixed_CL(COutput* output, CGeometry* geometry, CSolver** solver, CConfig* config); + + /*! + * \brief Store old aeroelastic solutions + * \param[in,out] config - Definition of the particular problem. + * \param[in] iMesh - Grid level + */ + void SetDualTime_Aeroelastic(CConfig* config, unsigned short iMesh) const; + }; diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index d845127be60d..2e3cee9e5e09 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -314,7 +314,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - void Compute_MassMatrix(CGeometry *geometry, + void Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -324,7 +324,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - void Compute_MassRes(CGeometry *geometry, + void Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -472,7 +472,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Iteration(CGeometry *geometry, + void ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -481,14 +481,14 @@ class CFEASolver : public CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) final; + void ImplicitNewmark_Update(const CGeometry *geometry, const CConfig *config) final; /*! * \brief A virtual member. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config) final; + void ImplicitNewmark_Relaxation(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Iterate using an implicit Generalized Alpha solver. @@ -496,7 +496,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_Iteration(CGeometry *geometry, + void GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -505,21 +505,21 @@ class CFEASolver : public CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *config) final; + void GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Update the solution using an implicit Generalized Alpha solver. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *config) final; + void GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Update the solution using an implicit Generalized Alpha solver. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig *config) final; + void GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Postprocessing. diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 062711cb47b6..5b11ab8b4208 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -1557,7 +1557,7 @@ class CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Iteration(CGeometry *geometry, + inline virtual void ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -1567,8 +1567,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Update(CGeometry *geometry, - CConfig *config) { } + inline virtual void ImplicitNewmark_Update(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1576,8 +1576,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Relaxation(CGeometry *geometry, - CConfig *config) { } + inline virtual void ImplicitNewmark_Relaxation(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1585,7 +1585,7 @@ class CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_Iteration(CGeometry *geometry, + inline virtual void GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -1595,8 +1595,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateDisp(CGeometry *geometry, - CConfig *config) { } + inline virtual void GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1604,8 +1604,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateSolution(CGeometry *geometry, - CConfig *config) { } + inline virtual void GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1613,7 +1613,7 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateLoads(CGeometry *geometry, + inline virtual void GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) { } /*! @@ -3770,7 +3770,7 @@ class CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - inline virtual void Compute_MassMatrix(CGeometry *geometry, + inline virtual void Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -3780,7 +3780,7 @@ class CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - inline virtual void Compute_MassRes(CGeometry *geometry, + inline virtual void Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 811b1b5608cd..6ee3c9ceddab 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -208,14 +208,10 @@ void CIntegration::Time_Integration(CGeometry *geometry, CSolver **solver_contai } -void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh) { +void CIntegration::SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh) { SU2_OMP_PARALLEL { - /*--- Store old solution, volumes and coordinates (in case there is grid movement). ---*/ - - solver->GetNodes()->Set_Solution_time_n1(); - solver->GetNodes()->Set_Solution_time_n(); geometry->nodes->SetVolume_nM1(); geometry->nodes->SetVolume_n(); @@ -225,6 +221,20 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon geometry->nodes->SetCoord_n(); } + if ((iMesh==MESH_0) && config->GetDeform_Mesh()) mesh_solver->SetDualTime_Mesh(); + + } // end SU2_OMP_PARALLEL +} + +void CIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) { + + SU2_OMP_PARALLEL + { + /*--- Store old solution, volumes and coordinates (in case there is grid movement). ---*/ + + solver->GetNodes()->Set_Solution_time_n1(); + solver->GetNodes()->Set_Solution_time_n(); + SU2_OMP_MASTER solver->ResetCFLAdapt(); SU2_OMP_BARRIER @@ -239,113 +249,5 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon solver->GetNodes()->SetLocalCFL(iPoint, config->GetCFL(iMesh)); } - /*--- Store old aeroelastic solutions ---*/ - SU2_OMP_MASTER - if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation() && (iMesh == MESH_0)) { - - config->SetAeroelastic_n1(); - config->SetAeroelastic_n(); - - /*--- Also communicate plunge and pitch to the master node. Needed for output in case of parallel run ---*/ - -#ifdef HAVE_MPI - su2double plunge, pitch, *plunge_all = NULL, *pitch_all = NULL; - unsigned short iMarker, iMarker_Monitoring; - unsigned long iProcessor, owner, *owner_all = NULL; - - string Marker_Tag, Monitoring_Tag; - int nProcessor = size; - - /*--- Only if master node allocate memory ---*/ - - if (rank == MASTER_NODE) { - plunge_all = new su2double[nProcessor]; - pitch_all = new su2double[nProcessor]; - owner_all = new unsigned long[nProcessor]; - } - - /*--- Find marker and give it's plunge and pitch coordinate to the master node ---*/ - - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); - Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if (Marker_Tag == Monitoring_Tag) { owner = 1; break; - } else { - owner = 0; - } - - } - plunge = config->GetAeroelastic_plunge(iMarker_Monitoring); - pitch = config->GetAeroelastic_pitch(iMarker_Monitoring); - - /*--- Gather the data on the master node. ---*/ - - SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); - - /*--- Set plunge and pitch on the master node ---*/ - - if (rank == MASTER_NODE) { - for (iProcessor = 0; iProcessor < (unsigned long)nProcessor; iProcessor++) { - if (owner_all[iProcessor] == 1) { - config->SetAeroelastic_plunge(iMarker_Monitoring, plunge_all[iProcessor]); - config->SetAeroelastic_pitch(iMarker_Monitoring, pitch_all[iProcessor]); - break; - } - } - } - - } - - if (rank == MASTER_NODE) { - delete [] plunge_all; - delete [] pitch_all; - delete [] owner_all; - } -#endif - } - SU2_OMP_BARRIER - } // end SU2_OMP_PARALLEL - -} - -void CIntegration::SetStructural_Solver(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh) { - - bool fsi = config->GetFSI_Simulation(); - - /*--- Update the solution according to the integration scheme used ---*/ - - switch (config->GetKind_TimeIntScheme_FEA()) { - case (CD_EXPLICIT): - break; - case (NEWMARK_IMPLICIT): - if (fsi) solver_container[FEA_SOL]->ImplicitNewmark_Relaxation(geometry, config); - break; - case (GENERALIZED_ALPHA): - solver_container[FEA_SOL]->GeneralizedAlpha_UpdateSolution(geometry, config); - solver_container[FEA_SOL]->GeneralizedAlpha_UpdateLoads(geometry, config); - break; - } - - /*--- Store the solution at t+1 as solution at t, both for the local points and for the halo points ---*/ - - solver_container[FEA_SOL]->GetNodes()->Set_Solution_time_n(); - solver_container[FEA_SOL]->GetNodes()->SetSolution_Vel_time_n(); - solver_container[FEA_SOL]->GetNodes()->SetSolution_Accel_time_n(); - - /*--- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/ - - if (fsi) { - - su2double WAitk=0.0; - - WAitk = solver_container[FEA_SOL]->GetWAitken_Dyn(); - solver_container[FEA_SOL]->SetWAitken_Dyn_tn1(WAitk); - - } } diff --git a/SU2_CFD/src/integration/CStructuralIntegration.cpp b/SU2_CFD/src/integration/CStructuralIntegration.cpp index 3667eba307a4..52fb4177ceb8 100644 --- a/SU2_CFD/src/integration/CStructuralIntegration.cpp +++ b/SU2_CFD/src/integration/CStructuralIntegration.cpp @@ -190,3 +190,39 @@ void CStructuralIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver * } } + +void CStructuralIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) { + + bool fsi = config->GetFSI_Simulation(); + + /*--- Update the solution according to the integration scheme used ---*/ + + switch (config->GetKind_TimeIntScheme_FEA()) { + case (CD_EXPLICIT): + break; + case (NEWMARK_IMPLICIT): + if (fsi) solver->ImplicitNewmark_Relaxation(geometry, config); + break; + case (GENERALIZED_ALPHA): + solver->GeneralizedAlpha_UpdateSolution(geometry, config); + solver->GeneralizedAlpha_UpdateLoads(geometry, config); + break; + } + + /*--- Store the solution at t+1 as solution at t, both for the local points and for the halo points ---*/ + + solver->GetNodes()->Set_Solution_time_n(); + solver->GetNodes()->SetSolution_Vel_time_n(); + solver->GetNodes()->SetSolution_Accel_time_n(); + + /*--- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/ + + if (fsi) { + + su2double WAitk=0.0; + + WAitk = solver->GetWAitken_Dyn(); + solver->SetWAitken_Dyn_tn1(WAitk); + + } +} diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index 315b0d40be6c..870d6b00d2d8 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -181,6 +181,11 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C 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); + + 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); } diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 11b553134d61..1263c41b36e2 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -196,8 +196,9 @@ void CFEAIteration::Update(COutput* output, CIntegration**** integration, CGeome /*----------------- Update structural solver ----------------------*/ if (dynamic) { - integration[val_iZone][val_iInst][FEA_SOL]->SetStructural_Solver( - geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], config[val_iZone], MESH_0); + 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) ---*/ diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 47a6f2625bb9..452bec5dccf4 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -172,13 +172,15 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][FLOW_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][FLOW_SOL], config[val_iZone], iMesh); + + 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); } - /*--- Update dual time solver for the dynamic mesh solver ---*/ - if (config[val_iZone]->GetDeform_Mesh()) { - solver[val_iZone][val_iInst][MESH_0][MESH_SOL]->SetDualTime_Mesh(); - } + SetDualTime_Aeroelastic(config[val_iZone], iMesh); /*--- Update dual time solver for the turbulence model ---*/ @@ -557,3 +559,74 @@ bool CFluidIteration::MonitorFixed_CL(COutput *output, CGeometry *geometry, CSol /* --- Set convergence based on fixed CL convergence --- */ return fixed_cl_convergence; } + +void CFluidIteration::SetDualTime_Aeroelastic(CConfig* config, unsigned short iMesh) const { + + /*--- Store old aeroelastic solutions ---*/ + + if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation() && (iMesh == MESH_0)) { + + config->SetAeroelastic_n1(); + config->SetAeroelastic_n(); + + /*--- Also communicate plunge and pitch to the master node. Needed for output in case of parallel run ---*/ + +#ifdef HAVE_MPI + su2double plunge, pitch, *plunge_all = nullptr, *pitch_all = nullptr; + unsigned short iMarker, iMarker_Monitoring; + unsigned long iProcessor, owner, *owner_all = nullptr; + + string Marker_Tag, Monitoring_Tag; + int nProcessor = size; + + /*--- Only if master node allocate memory ---*/ + + if (rank == MASTER_NODE) { + plunge_all = new su2double[nProcessor]; + pitch_all = new su2double[nProcessor]; + owner_all = new unsigned long[nProcessor]; + } + + /*--- Find marker and give it's plunge and pitch coordinate to the master node ---*/ + + for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); + Marker_Tag = config->GetMarker_All_TagBound(iMarker); + if (Marker_Tag == Monitoring_Tag) { owner = 1; break; + } else { + owner = 0; + } + + } + plunge = config->GetAeroelastic_plunge(iMarker_Monitoring); + pitch = config->GetAeroelastic_pitch(iMarker_Monitoring); + + /*--- Gather the data on the master node. ---*/ + + SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + + /*--- Set plunge and pitch on the master node ---*/ + + if (rank == MASTER_NODE) { + for (iProcessor = 0; iProcessor < (unsigned long)nProcessor; iProcessor++) { + if (owner_all[iProcessor] == 1) { + config->SetAeroelastic_plunge(iMarker_Monitoring, plunge_all[iProcessor]); + config->SetAeroelastic_pitch(iMarker_Monitoring, pitch_all[iProcessor]); + break; + } + } + } + } + + delete [] plunge_all; + delete [] pitch_all; + delete [] owner_all; +#endif + } + +} diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index dbdd69ce22d3..adf02634aa18 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -56,6 +56,11 @@ void CHeatIteration::Update(COutput* output, CIntegration**** integration, CGeom integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][HEAT_SOL], config[val_iZone], iMesh); + + 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/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index c54b3bb9706d..66fe4d41ba58 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -936,7 +936,7 @@ void CFEASolver::Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumeri } -void CFEASolver::Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool topology_mode = config->GetTopology_Optimization(); const su2double simp_minstiff = config->GetSIMP_MinStiffness(); @@ -1021,7 +1021,7 @@ void CFEASolver::Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, c } -void CFEASolver::Compute_MassRes(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool topology_mode = config->GetTopology_Optimization(); const su2double simp_minstiff = config->GetSIMP_MinStiffness(); @@ -2183,7 +2183,7 @@ su2double CFEASolver::Compute_LoadCoefficient(su2double CurrentTime, su2double R } -void CFEASolver::ImplicitNewmark_Iteration(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool first_iter = (config->GetInnerIter() == 0); const bool dynamic = (config->GetTime_Domain()); @@ -2267,7 +2267,7 @@ void CFEASolver::ImplicitNewmark_Iteration(CGeometry *geometry, CNumerics **nume } -void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { +void CFEASolver::ImplicitNewmark_Update(const CGeometry *geometry, const CConfig *config) { const bool dynamic = (config->GetTime_Domain()); @@ -2314,7 +2314,7 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { } // end SU2_OMP_PARALLEL } -void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config) { +void CFEASolver::ImplicitNewmark_Relaxation(const CGeometry *geometry, const CConfig *config) { const bool dynamic = (config->GetTime_Domain()); @@ -2362,7 +2362,7 @@ void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config } -void CFEASolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool first_iter = (config->GetInnerIter() == 0); const bool dynamic = (config->GetTime_Domain()); @@ -2470,7 +2470,7 @@ void CFEASolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CNumerics **num } -void CFEASolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, const CConfig *config) { /*--- Update displacement components of the solution. ---*/ @@ -2481,7 +2481,7 @@ void CFEASolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *confi } -void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, const CConfig *config) { const su2double alpha_f = config->Get_Int_Coeffs(2); const su2double alpha_m = config->Get_Int_Coeffs(3); @@ -2535,7 +2535,7 @@ void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *c } -void CFEASolver::GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) { /*--- Set the load conditions of the time step n+1 as the load conditions for time step n ---*/ nodes->Set_SurfaceLoad_Res_n(); From c047306d1a60c00eaeeb18cc2bf99d06953110d0 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 15 Feb 2021 11:57:52 +0000 Subject: [PATCH 270/326] update dual time weakly coupled heat --- SU2_CFD/src/iteration/CFluidIteration.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 452bec5dccf4..098122db5dec 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -201,6 +201,15 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo config[val_iZone], MESH_0); integration[val_iZone][val_iInst][TRANS_SOL]->SetConvergence(false); } + + /*--- Update dual time solver for the weakly coupled energy equation ---*/ + + if (config[val_iZone]->GetWeakly_Coupled_Heat()) { + 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); + } } } From 3e75f508ffc1d66c02c249d84610b3f359675bc9 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 15 Feb 2021 14:51:54 +0000 Subject: [PATCH 271/326] small fix for aeroelastic, update rigid motion regressions --- SU2_CFD/include/iteration/CFluidIteration.hpp | 3 +-- SU2_CFD/src/integration/CIntegration.cpp | 3 +-- SU2_CFD/src/iteration/CFluidIteration.cpp | 4 ++-- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/SU2_CFD/include/iteration/CFluidIteration.hpp b/SU2_CFD/include/iteration/CFluidIteration.hpp index 7a1ee9040606..9271ef475a16 100644 --- a/SU2_CFD/include/iteration/CFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFluidIteration.hpp @@ -152,8 +152,7 @@ class CFluidIteration : public CIteration { /*! * \brief Store old aeroelastic solutions * \param[in,out] config - Definition of the particular problem. - * \param[in] iMesh - Grid level */ - void SetDualTime_Aeroelastic(CConfig* config, unsigned short iMesh) const; + void SetDualTime_Aeroelastic(CConfig* config) const; }; diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 6ee3c9ceddab..c2699c9eb560 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -230,8 +230,7 @@ void CIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver SU2_OMP_PARALLEL { - /*--- Store old solution, volumes and coordinates (in case there is grid movement). ---*/ - + /*--- Store old solution ---*/ solver->GetNodes()->Set_Solution_time_n1(); solver->GetNodes()->Set_Solution_time_n(); diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 098122db5dec..27080340ad23 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -569,11 +569,11 @@ bool CFluidIteration::MonitorFixed_CL(COutput *output, CGeometry *geometry, CSol return fixed_cl_convergence; } -void CFluidIteration::SetDualTime_Aeroelastic(CConfig* config, unsigned short iMesh) const { +void CFluidIteration::SetDualTime_Aeroelastic(CConfig* config) const { /*--- Store old aeroelastic solutions ---*/ - if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation() && (iMesh == MESH_0)) { + if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation()) { config->SetAeroelastic_n1(); config->SetAeroelastic_n(); diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c7ec41d0a580..e62262dbda8b 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1298,7 +1298,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614165, 2.242641, -0.038307, 0.173866] + pywrapper_rigidMotion.test_vals = [-1.614164, 2.242568, -0.028488, 0.173947] pywrapper_rigidMotion.su2_exec = "mpirun -np 2 python launch_flatPlate_rigidMotion.py --parallel -f" pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 55ffcd722dca..3571dda0fc0d 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1877,7 +1877,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614167, 2.242632, -0.037871, 0.173912] + pywrapper_rigidMotion.test_vals = [-1.614167, 2.242558, -0.027574, 0.173990] pywrapper_rigidMotion.su2_exec = "python launch_flatPlate_rigidMotion.py -f" pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 From d9db4a0d4f09e24c90e60fc16656c89d51c7c46d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 15 Feb 2021 15:09:21 +0000 Subject: [PATCH 272/326] forgot to save --- SU2_CFD/src/iteration/CFluidIteration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 27080340ad23..539252c76712 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -180,7 +180,7 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][FLOW_SOL]->SetConvergence(false); } - SetDualTime_Aeroelastic(config[val_iZone], iMesh); + SetDualTime_Aeroelastic(config[val_iZone]); /*--- Update dual time solver for the turbulence model ---*/ From 3aaf175504ab56489dcb0a10d60c9c2937128fb4 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 15 Feb 2021 17:06:28 +0100 Subject: [PATCH 273/326] Fixed regression values after PR#1199 --- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index ab0f720073f2..b5c198277f5d 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1298,7 +1298,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350036, 0.093137] + pywrapper_rigidMotion.test_vals = [-1.551335, 2.295594, 0.350036, 0.093081] pywrapper_rigidMotion.su2_exec = "mpirun -np 2 python launch_flatPlate_rigidMotion.py --parallel -f" pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 77dccd00fe71..daeb8e95cb51 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1877,7 +1877,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350050, 0.093137] + pywrapper_rigidMotion.test_vals = [-1.551335, 2.295594, 0.350050, 0.093081] pywrapper_rigidMotion.su2_exec = "python launch_flatPlate_rigidMotion.py -f" pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 From 52ba9900bad912fe4590f30748feafd1c5779d1e Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 16 Feb 2021 09:35:35 +0100 Subject: [PATCH 274/326] array deleted twice --- SU2_PY/FSI_tools/FSIInterface.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 702ad4d78b0a..9fe034d1e1fa 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1392,9 +1392,7 @@ def interpolateFluidLoadsOnSolidMesh(self, FSI_config): del sendBuff_X del sendBuff_Y del sendBuff_Z - del self.solidLoads_array_X_recon - del self.solidLoads_array_Y_recon - del self.solidLoads_array_Z_recon + self.comm.barrier() else: self.localSolidLoads_array_X = self.solidLoads_array_X.getArray().copy() self.localSolidLoads_array_Y = self.solidLoads_array_Y.getArray().copy() From 2f1e61dfbd45e320082b4d4c8969e92a6ef76e4b Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 16 Feb 2021 14:10:01 +0100 Subject: [PATCH 275/326] Multiple superposed forced motions --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 74 +++++++++++++++++------------ 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 6f6144c4bc28..437453fb136a 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -43,21 +43,24 @@ class ImposedMotionFunction: - def __init__(self,time0,tipo,parameters): + def __init__(self,time0,typeOfMotion,parameters,mode): + self.time0 = time0 - self.tipo = tipo - if self.tipo == "SINUSOIDAL": - self.bias = parameters[0] - self.amplitude = parameters[1] - self.frequency = parameters[2] - self.timeStart = parameters[3] - - elif self.tipo == "BLENDED_STEP": - self.kmax = parameters[0] - self.vinf = parameters[1] - self.lref = parameters[2] - self.amplitude = parameters[3] - self.timeStart = parameters[4] + self.typeOfMotion = typeOfMotion + self.mode = mode + + if self.typeOfMotion == "SINUSOIDAL": + self.bias = parameters["BIAS"] + self.amplitude = parameters["AMPLITUDE"] + self.frequency = parameters["FREQUENCY"] + self.timeStart = parameters["TIME_0"] + + elif self.typeOfMotion == "BLENDED_STEP": + self.kmax = parameters["K_MAX"] + self.vinf = parameters["V_INF"] + self.lref = parameters["L_REF"] + self.amplitude = parameters["AMPLITUDE"] + self.timeStart = parameters["TIME_0"] self.tmax = 2*pi/self.kmax*self.lref/self.vinf self.omega0 = 1/2*self.kmax @@ -67,10 +70,10 @@ def __init__(self,time0,tipo,parameters): def GetDispl(self,time): time = time - self.time0 - self.timeStart - if self.tipo == "SINUSOIDAL": + if self.typeOfMotion == "SINUSOIDAL": return self.bias+self.amplitude*sin(2*pi*self.frequency*time) - if self.tipo == "BLENDED_STEP": + if self.typeOfMotion == "BLENDED_STEP": if time < 0: return 0.0 elif time < self.tmax: @@ -81,10 +84,10 @@ def GetDispl(self,time): def GetVel(self,time): time = time - self.time0 - self.timeStart - if self.tipo == "SINUSOIDAL": + if self.typeOfMotion == "SINUSOIDAL": return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency - if self.tipo == "BLENDED_STEP": + if self.typeOfMotion == "BLENDED_STEP": if time < 0: return 0.0 elif time < self.tmax: @@ -94,10 +97,10 @@ def GetVel(self,time): def GetAcc(self,time): time = time - self.time0 - self.timeStart - if self.tipo == "SINUSOIDAL": + if self.typeOfMotion == "SINUSOIDAL": return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 - if self.tipo == "BLENDED_STEP": + if self.typeOfMotion == "BLENDED_STEP": if time < 0: return 0.0 elif time < self.tmax: @@ -289,7 +292,7 @@ def __init__(self, config_fileName, ImposedMotion): self.markers = {} self.refsystems = [] self.ImposedMotionToSet = True - self.ImposedMotionFunction = {} + self.ImposedMotionFunction = [] print("\n") print(" Reading the mesh ".center(80,"-")) @@ -733,14 +736,17 @@ def __temporalIteration(self,time): This method integrates in time the solution. """ + self.__reset(self.q) + self.__reset(self.qdot) + self.__reset(self.qddot) + self.__reset(self.a) + if not self.ImposedMotion: eps = 1e-6 self.__SetLoads() # Prediction step - self.__reset(self.qddot) - self.__reset(self.a) self.a += (self.alpha_f)/(1-self.alpha_m)*self.qddot_n self.a -= (self.alpha_m)/(1-self.alpha_m)*self.a_n @@ -768,14 +774,20 @@ def __temporalIteration(self,time): self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot else: if self.ImposedMotionToSet: - for imode in self.Config["IMPOSED_MODES"].keys(): - self.ImposedMotionFunction[imode] = ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode]) - self.ImposedMotionToSet = False - for imode in self.Config["IMPOSED_MODES"].keys(): - self.q[imode] = self.ImposedMotionFunction[imode].GetDispl(time) - self.qdot[imode] = self.ImposedMotionFunction[imode].GetVel(time) - self.qddot[imode] = self.ImposedMotionFunction[imode].GetAcc(time) - self.a = np.copy(self.qddot) + iImposedFunc = 0 + for imode in self.Config["IMPOSED_MODES"].keys(): + for isuperposed in range(len(self.Config["IMPOSED_MODES"][imode])): + typeOfMotion = self.Config["IMPOSED_MODES"][imode][isuperposed] + parameters = self.Config["IMPOSED_PARAMETERS"][imode][isuperposed] + self.ImposedMotionFunction[iImposedFunc] = ImposedMotionFunction(time, typeOfMotion, parameters, imode) + iImposedFunc += 1 + self.ImposedMotionToSet = False + for iImposedFunc in range(len(self.ImposedMotionFunction)): + imode = self.ImposedMotionFunction[iImposedFunc].mode + self.q[imode] += self.ImposedMotionFunction[iImposedFunc].GetDispl(time) + self.qdot[imode] += self.ImposedMotionFunction[iImposedFunc].GetVel(time) + self.qddot[imode] += self.ImposedMotionFunction[iImposedFunc].GetAcc(time) + self.a = np.copy(self.qddot) def __SetLoads(self): From ae338089ba31a2118c6535f629eadaa52fd79607 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Tue, 16 Feb 2021 14:45:19 +0100 Subject: [PATCH 276/326] Error with array dimension --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 437453fb136a..aa83f44c5dd2 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -41,7 +41,7 @@ # Config class # ---------------------------------------------------------------------- -class ImposedMotionFunction: +class ImposedMotionClass: def __init__(self,time0,typeOfMotion,parameters,mode): @@ -779,7 +779,7 @@ def __temporalIteration(self,time): for isuperposed in range(len(self.Config["IMPOSED_MODES"][imode])): typeOfMotion = self.Config["IMPOSED_MODES"][imode][isuperposed] parameters = self.Config["IMPOSED_PARAMETERS"][imode][isuperposed] - self.ImposedMotionFunction[iImposedFunc] = ImposedMotionFunction(time, typeOfMotion, parameters, imode) + self.ImposedMotionFunction.append(ImposedMotionClass(time, typeOfMotion, parameters, imode)) iImposedFunc += 1 self.ImposedMotionToSet = False for iImposedFunc in range(len(self.ImposedMotionFunction)): From 0025253c895454890de6ca17ce4f5ee7244f3859 Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 16 Feb 2021 15:23:41 +0100 Subject: [PATCH 277/326] add test case and regression list entry --- .../air_nozzle/air_nozzle.cfg | 256 ++++++++++++++++++ TestCases/hybrid_regression.py | 12 + TestCases/parallel_regression.py | 15 + TestCases/serial_regression.py | 15 + 4 files changed, 298 insertions(+) create mode 100644 TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg new file mode 100644 index 000000000000..74a09019f9ef --- /dev/null +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg @@ -0,0 +1,256 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Axisymmetric supersonic converging-diverging air nozzle % +% Author: Florian Dittmann % +% Date: 2021.12.02 % +% File Version 7.10 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP) +KIND_TURB_MODEL= SST +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= YES +% +% System of measurements (SI, US) +% International system of units (SI): ( meters, kilograms, Kelvins, +% Newtons = kg m/s^2, Pascals = N/m^2, +% Density = kg/m^3, Speed = m/s, +% Equiv. Area = m^2 ) +% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, +% psf = lbf/ft^2, Density = slug/ft^3, +% Speed = ft/s, Equiv. Area = ft^2 ) +SYSTEM_MEASUREMENTS= SI +% +AXISYMMETRIC= YES +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 1E-9 +% +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% +% Side-slip angle (degrees, only for compressible flows) +SIDESLIP_ANGLE= 0.0 +% +% Init option to choose between Reynolds (default) or thermodynamics quantities +% for initializing the solution (REYNOLDS, TD_CONDITIONS) +INIT_OPTION= TD_CONDITIONS +% +% Free-stream option to choose between density and temperature (default) for +% initializing the solution (TEMPERATURE_FS, DENSITY_FS) +FREESTREAM_OPTION= TEMPERATURE_FS +% +% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default) +FREESTREAM_PRESSURE= 1400000 +% +% Free-stream temperature (288.15 K, 518.67 R by default) +FREESTREAM_TEMPERATURE= 373.15 +% +% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, +% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) +REF_DIMENSIONALIZATION= DIMENSIONAL + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) +FLUID_MODEL= STANDARD_AIR + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.716E-5 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% POLYNOMIAL_CONDUCTIVITY). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 0.72 +% +% Turbulent Prandtl number (0.9 (air) by default) +PRANDTL_TURB= 0.90 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= ( WALL, 0.0 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +MARKER_SYM= ( SYMMETRY ) +% +% Riemann boundary marker(s) (NONE = no marker) +% Format: (marker, data kind flag, list of data) +MARKER_RIEMANN= ( INFLOW, TOTAL_CONDITIONS_PT, 1400000.0, 373.15, 1.0, 0.0, 0.0, OUTFLOW, STATIC_PRESSURE, 100000.0, 0.0, 0.0, 0.0, 0.0 ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1000.0 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1000.0 ) +% +% Maximum Delta Time in local time stepping simulations +MAX_DELTA_TIME= 1E6 + +% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= NONE +% +%Coefficient for the Venkat's limiter (upwind scheme). A larger values decrease +% the extent of limiting, values approaching zero cause +% lower-order approximation to the solution (0.05 by default) +VENKAT_LIMITER_COEFF= 0.05 +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations (BCGSTAB, FGMRES, SMOOTHER_JACOBI, +% SMOOTHER_ILU, SMOOTHER_LUSGS, +% SMOOTHER_LINELET) +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Linael solver ILU preconditioner fill-in level (0 by default) +LINEAR_SOLVER_ILU_FILL_IN= 0 +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 0.01 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 +% +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE +% +% Multi-grid pre-smoothing level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +% +% Multi-grid post-smoothing level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +% +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +% +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 0.75 +% +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 0.75 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, AUSMPLUSUP2, HLLC, +% TURKEL_PREC, MSW, FDS) +CONV_NUM_METHOD_FLOW= ROE +% +% Entropy fix coefficient (0.0 implies no entropy fixing, 1.0 implies scalar +% artificial dissipation) +ENTROPY_FIX_COEFF= 0.1 +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% Reduction factor of the CFL coefficient in the turbulence problem +CFL_REDUCTION_TURB= 1.0 + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Number of total iterations +ITER= 1000 +% +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -12 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= nozzle.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FILENAME= solution_flow.dat +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FILENAME= restart_flow.dat +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 1000 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index f1ea011f4f50..d69473c646ff 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -210,6 +210,18 @@ def main(): propeller.test_vals = [-3.389576, -8.409529, 0.000048, 0.056329] test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [-12.094937, -6.622043, -8.814412, -2.393288] + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c7ec41d0a580..e14d554ca9e0 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -347,6 +347,21 @@ def main(): propeller.tol = 0.00001 test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [ -12.096569, -6.625843, -8.807541, -2.393279] + axi_rans_air_nozzle.su2_exec = "mpirun -n 2 SU2_CFD" + axi_rans_air_nozzle.timeout = 1600 + axi_rans_air_nozzle.tol = 0.0001 + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 55ffcd722dca..b99d15288ebf 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -375,6 +375,21 @@ def main(): propeller.tol = 0.00001 test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [ -12.093130, -6.619801, -8.806060, -2.393278] + axi_rans_air_nozzle.su2_exec = "SU2_CFD" + axi_rans_air_nozzle.timeout = 1600 + axi_rans_air_nozzle.tol = 0.0001 + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# From 2b173272ee014b5556f0d8a1aa5893134f788cfd Mon Sep 17 00:00:00 2001 From: FlorianDm Date: Tue, 16 Feb 2021 16:48:14 +0100 Subject: [PATCH 278/326] remove jacobian contribution and test case config file options --- .../numerics/turbulent/turb_sources.hpp | 6 --- .../air_nozzle/air_nozzle.cfg | 42 ------------------- 2 files changed, 48 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 5c7280122ef2..55f5ba658425 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -363,12 +363,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Add terms to the residuals ---*/ Residual[0] += yinv*Volume*(pk_axi-cdk_axi); Residual[1] += yinv*Volume*(pw_axi-cdw_axi); - - /*--- Add contribution to the jacobian for implicit time integration (ignore to conserve diagonal dominance) ---*/ - //Jacobian_i[0][0] += yinv*Volume*(sigma_k_i*TurbVar_Grad_i[0][1]/zeta-V_i[2]); - //Jacobian_i[0][1] += yinv*Volume*(-sigma_k_i*k*TurbVar_Grad_i[0][1]/(zeta*zeta)); - //Jacobian_i[1][0] += yinv*Volume*(sigma_w_i*TurbVar_Grad_i[1][1]/zeta); - //Jacobian_i[1][1] += yinv*Volume*(-sigma_w_i*k*TurbVar_Grad_i[1][1]/(zeta*zeta)-V_i[2]); } diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg index 74a09019f9ef..93180d8936e1 100644 --- a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg @@ -132,15 +132,6 @@ MUSCL_FLOW= YES % Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, % BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_FLOW= NONE -% -%Coefficient for the Venkat's limiter (upwind scheme). A larger values decrease -% the extent of limiting, values approaching zero cause -% lower-order approximation to the solution (0.05 by default) -VENKAT_LIMITER_COEFF= 0.05 -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_TURB= NO % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -165,24 +156,6 @@ LINEAR_SOLVER_ITER= 10 % % Multi-grid levels (0 = no multi-grid) MGLEVEL= 0 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= V_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) -% -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) -% -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % @@ -231,24 +204,9 @@ MESH_FILENAME= nozzle.su2 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% % Restart flow input file SOLUTION_FILENAME= solution_flow.dat % -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Output file restart flow -RESTART_FILENAME= restart_flow.dat -% -% Output file flow (w/o extension) variables -VOLUME_FILENAME= flow -% -% Output file surface flow coefficient (w/o extension) -SURFACE_FILENAME= surface_flow -% % Writing solution file frequency OUTPUT_WRT_FREQ= 1000 % From 3d455e0ef4063b8ac4dfba2a6fc687f61b544a35 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 16 Feb 2021 22:48:52 +0000 Subject: [PATCH 279/326] allocate UR in nemo variable, output min/avg/max cfl --- SU2_CFD/src/output/CNEMOCompOutput.cpp | 8 +++- SU2_CFD/src/variables/CNEMOEulerVariable.cpp | 47 ++++++++++---------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 917823fa4fd4..4108ddf9af0d 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -246,7 +246,9 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAXIMUM_HEATFLUX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximum heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); /// END_GROUP - AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + AddHistoryOutput("MIN_CFL", "Min CFL", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current minimum of the local CFL numbers"); + AddHistoryOutput("MAX_CFL", "Max CFL", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current maximum of the local CFL numbers"); + AddHistoryOutput("AVG_CFL", "Avg CFL", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current average of the local CFL numbers"); /// /// BEGIN_GROUP: FIXED_CL, DESCRIPTION: Relevant outputs for the Fixed CL mode if (config->GetFixed_CL_Mode()){ @@ -654,7 +656,9 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("TOTAL_HEATFLUX", NEMO_solver->GetTotal_HeatFlux()); SetHistoryOutputValue("MAXIMUM_HEATFLUX", NEMO_solver->GetTotal_MaxHeatFlux()); - SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + SetHistoryOutputValue("MIN_CFL", NEMO_solver->GetMin_CFL_Local()); + SetHistoryOutputValue("MAX_CFL", NEMO_solver->GetMax_CFL_Local()); + SetHistoryOutputValue("AVG_CFL", NEMO_solver->GetAvg_CFL_Local()); SetHistoryOutputValue("LINSOL_ITER", NEMO_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(NEMO_solver->GetResLinSolver())); diff --git a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp index b50e200e18a4..45bc0aa5fb9c 100644 --- a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp +++ b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp @@ -6,7 +6,7 @@ * * SU2 Project Website: https://su2code.github.io * - * The SU2 Project is maintained by the SU2 Foundation + * The SU2 Project is maintained by the SU2 Foundation * (http://su2foundation.org) * * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) @@ -44,8 +44,8 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, nvar, config ), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - - vector energies; + + vector energies; unsigned short iDim, iSpecies; su2double soundspeed, sqvel, rho; @@ -109,14 +109,14 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, Primitive.resize(nPoint,nPrimVar) = su2double(0.0); Primitive_Aux.resize(nPoint,nPrimVar) = su2double(0.0); Secondary.resize(nPoint,nPrimVar) = su2double(0.0); - + dPdU.resize(nPoint, nVar) = su2double(0.0); dTdU.resize(nPoint, nVar) = su2double(0.0); dTvedU.resize(nPoint, nVar) = su2double(0.0); Cvves.resize(nPoint, nSpecies) = su2double(0.0); eves.resize(nPoint, nSpecies) = su2double(0.0); Gamma.resize(nPoint) = su2double(0.0); - + /*--- Compressible flow, gradients primitive variables ---*/ Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); Gradient.resize(nPoint,nVar,nDim,0.0); @@ -139,42 +139,43 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, Non_Physical.resize(nPoint) = false; Non_Physical_Counter.resize(nPoint) = 0; - /* Under-relaxation parameter. */ + /* Under-relaxation parameter. */ + UnderRelaxation.resize(nPoint) = su2double(1.0); LocalCFL.resize(nPoint) = su2double(0.0); - + /*--- Loop over all points --*/ for(unsigned long iPoint = 0; iPoint < nPoint; ++iPoint){ /*--- Reset velocity^2 [m2/s2] to zero ---*/ sqvel = 0.0; - + /*--- Set mixture state ---*/ fluidmodel->SetTDStatePTTv(val_pressure, val_massfrac, val_temperature, val_temperature_ve); - + /*--- Compute necessary quantities ---*/ rho = fluidmodel->GetDensity(); soundspeed = fluidmodel->ComputeSoundSpeed(); for (iDim = 0; iDim < nDim; iDim++){ sqvel += val_mach[iDim]*soundspeed * val_mach[iDim]*soundspeed; } - energies = fluidmodel->ComputeMixtureEnergies(); - + energies = fluidmodel->ComputeMixtureEnergies(); + /*--- Initialize Solution & Solution_Old vectors ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) Solution(iPoint,iSpecies) = rho*val_massfrac[iSpecies]; - for (iDim = 0; iDim < nDim; iDim++) + for (iDim = 0; iDim < nDim; iDim++) Solution(iPoint,nSpecies+iDim) = rho*val_mach[iDim]*soundspeed; - + Solution(iPoint,nSpecies+nDim) = rho*(energies[0]+0.5*sqvel); Solution(iPoint,nSpecies+nDim+1) = rho*(energies[1]); - + Solution_Old = Solution; - + /*--- Assign primitive variables ---*/ Primitive(iPoint,T_INDEX) = val_temperature; Primitive(iPoint,TVE_INDEX) = val_temperature_ve; Primitive(iPoint,P_INDEX) = val_pressure; - } + } } void CNEMOEulerVariable::SetVelocity2(unsigned long iPoint) { @@ -207,7 +208,7 @@ bool CNEMOEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidMode } /*--- Set additional point quantaties ---*/ - Gamma(iPoint) = fluidmodel->ComputeGamma(); + Gamma(iPoint) = fluidmodel->ComputeGamma(); SetVelocity2(iPoint); @@ -273,7 +274,7 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, /*--- Temperatures ---*/ V[T_INDEX] = T[0]; V[TVE_INDEX] = T[1]; - + // Determine if the temperature lies within the acceptable range //TODO: fIX THIS if (V[T_INDEX] == Tmin) { @@ -281,7 +282,7 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, } else if (V[T_INDEX] == Tmax){ nonPhys = true; } - + /*--- Vibrational-Electronic Temperature ---*/ vector eves_min = fluidmodel->ComputeSpeciesEve(Tvemin); vector eves_max = fluidmodel->ComputeSpeciesEve(Tvemax); @@ -296,7 +297,7 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, } if (rhoEve < rhoEve_min) { - + nonPhys = true; V[TVE_INDEX] = Tvemin; U[nSpecies+nDim+1] = rhoEve_min; @@ -310,7 +311,7 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, V[TVE_INDEX] = Tve_Freestream; } - // Determine other properties of the mixture at the current state + // Determine other properties of the mixture at the current state fluidmodel->SetTDStateRhosTTv(rhos, V[T_INDEX], V[TVE_INDEX]); const auto& cvves = fluidmodel->ComputeSpeciesCvVibEle(); vector eves = fluidmodel->ComputeSpeciesEve(V[TVE_INDEX]); @@ -322,7 +323,7 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, su2double rhoCvtr = fluidmodel->ComputerhoCvtr(); su2double rhoCvve = fluidmodel->ComputerhoCvve(); - + V[RHOCVTR_INDEX] = rhoCvtr; V[RHOCVVE_INDEX] = rhoCvve; From e605242b1384e88a9b64f4dc22c19d1e806fe179 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi <60700515+Nicola-Fonzi@users.noreply.github.com> Date: Wed, 17 Feb 2021 10:17:49 +0100 Subject: [PATCH 280/326] Introduced condition on mesh boundary --- SU2_CFD/src/solvers/CMeshSolver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index b2ceac739d48..d2b23604084c 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -298,7 +298,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { unsigned long nVertex_SolidWall = 0; for(auto iMarker=0u; iMarkerGetnMarker_All(); ++iMarker) { - if(config->GetSolid_Wall(iMarker)) { + if(config->GetSolid_Wall(iMarker) && !config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) { nVertex_SolidWall += geometry->GetnVertex(iMarker); } } @@ -315,7 +315,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { for (unsigned long iMarker=0, ii=0, jj=0; iMarkerGetnMarker_All(); ++iMarker) { - if (!config->GetSolid_Wall(iMarker)) continue; + if (!config->GetSolid_Wall(iMarker) && !config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) continue; for (auto iVertex=0u; iVertexGetnVertex(iMarker); ++iVertex) { auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); From 96640081e43651521a7cabbd65decde12893ccce Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Wed, 17 Feb 2021 10:23:01 +0000 Subject: [PATCH 281/326] Update SU2_CFD/src/solvers/CMeshSolver.cpp --- SU2_CFD/src/solvers/CMeshSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index d2b23604084c..07748237afde 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -315,7 +315,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { for (unsigned long iMarker=0, ii=0, jj=0; iMarkerGetnMarker_All(); ++iMarker) { - if (!config->GetSolid_Wall(iMarker) && !config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) continue; + if (!config->GetSolid_Wall(iMarker) || config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) continue; for (auto iVertex=0u; iVertexGetnVertex(iMarker); ++iVertex) { auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); From 43ab65a34b6cdc959d7c73ef859f066e12293708 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 17 Feb 2021 19:28:38 +0100 Subject: [PATCH 282/326] Minor comments --- Common/src/grid_movement/CVolumetricMovement.cpp | 4 ++-- SU2_DOT/src/SU2_DOT.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index 32fcbd1e5e92..edbae4ac3eb8 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -1641,10 +1641,10 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig VarIncrement = 1.0/((su2double)config->GetGridDef_Nonlinear_Iter()); /*--- As initialization, set to zero displacements of all the surfaces except the symmetry - plane, internal and periodic bc the receive boundaries and periodic boundaries. ---*/ + plane (which is treated specially, see below), internal and the send-receive boundaries ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((//(config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && + if (((config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) && (config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 06dfe71d02dd..f948b485d014 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -937,7 +937,7 @@ void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned shor output->SetSurface_Filename(config[iZone]->GetSurfSens_FileName()); - /*--- Set the surface filename ---*/ + /*--- Set the volume filename ---*/ // Note TobiKattmann: Why would I write volume output here as this should be the surface gradient only output->SetVolume_Filename(config[iZone]->GetVolSens_FileName()); From bf8f084670bc775de975f667b3a1bbab27008593 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 17 Feb 2021 18:50:20 +0000 Subject: [PATCH 283/326] faster check for normal direction in neighbor loops --- SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp | 2 +- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSolver.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp index 8c2541c7da5c..89bd45f8c3a7 100644 --- a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp +++ b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp @@ -103,7 +103,7 @@ void computeGradientsGreenGauss(CSolver* solver, /*--- Determine if edge points inwards or outwards of iPoint. * If inwards we need to flip the area vector. ---*/ - su2double dir = (iPoint == geometry.edges->GetNode(iEdge,0))? 1.0 : -1.0; + su2double dir = (iPoint < jPoint)? 1.0 : -1.0; su2double weight = dir * halfOnVol; const auto area = geometry.edges->GetNormal(iEdge); diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 53f2205ff7d3..34af21a7b23f 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1796,7 +1796,7 @@ void CFVMFlowSolverBase::SetResidual_DualTime(CGeometry *geometry GridVel_j = geometry->nodes->GetGridVel(jPoint); /*--- Determine whether to consider the normal outward or inward. ---*/ - su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; + su2double dir = (iPoint < jPoint)? 0.5 : -0.5; Residual_GCL = 0.0; for (iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index cae900661ed9..e7887bf793b6 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2469,7 +2469,7 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver GridVel_j = geometry->nodes->GetGridVel(jPoint); /*--- Determine whether to consider the normal outward or inward. ---*/ - su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; + su2double dir = (iPoint < jPoint)? 0.5 : -0.5; su2double Residual_GCL = 0.0; for (iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 19dcbddf4368..27cd06a27754 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2414,7 +2414,7 @@ void CSolver::SetRotatingFrame_GCL(CGeometry *geometry, const CConfig *config) { const su2double* GridVel_j = geometry->nodes->GetGridVel(jPoint); /*--- Determine whether to consider the normal outward or inward. ---*/ - su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; + su2double dir = (iPoint < jPoint)? 0.5 : -0.5; su2double Flux = 0.0; for (auto iDim = 0u; iDim < nDim; iDim++) diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index 204a4ed78834..d860922b97bc 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -845,7 +845,7 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con GridVel_j = geometry->nodes->GetGridVel(jPoint); /*--- Determine whether to consider the normal outward or inward. ---*/ - su2double dir = (geometry->edges->GetNode(iEdge,0) == iPoint)? 0.5 : -0.5; + su2double dir = (iPoint < jPoint)? 0.5 : -0.5; Residual_GCL = 0.0; for (iDim = 0; iDim < nDim; iDim++) From fcf24442e6d39f7c10e26f0523741b5a8b92bcf5 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 17 Feb 2021 23:32:38 +0100 Subject: [PATCH 284/326] Changing some reg test. CHT 2D. --- .../chtPinArray_2d/DA_configMaster.cfg | 21 ++++++------- .../chtPinArray_2d/FD_configMaster.cfg | 23 +++++++------- .../chtPinArray_2d/README.md | 27 +++++++++++++++++ .../chtPinArray_2d/configMaster.cfg | 30 +++++++++++-------- .../chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 5 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index c174e2659ac8..7a24865407b0 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -60,7 +60,8 @@ FFD_CONTINUITY= NO_DERIVATIVE DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +MARKER_SYM= ( fluid_symmetry ) +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface, fluid_symmetry ) % % Parameters of the shape deformation % - FFD_SETTING ( 1.0 ) @@ -99,14 +100,14 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE DEFORM_COEFF = 1E6 % DEFINITION_DV= \ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 0, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 1, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 2, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 3, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 4, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 5, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 6, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 7, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 54df50e97b77..757ceb9d0d5e 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -37,7 +37,7 @@ OUTPUT_WRT_FREQ= 10000 MESH_FILENAME= 2D-PinArray_FFD.su2 MESH_FORMAT= SU2 % -% Options that have to be kept for finite_differences.py +% Options that have to be kept for finite_differences.py. Otherwise it won't run. RESTART_SOL= NO MARKER_MONITORING= ( NONE ) SOLUTION_FILENAME= restart @@ -69,7 +69,8 @@ DV_KIND= FFD_SETTING %DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +MARKER_SYM= ( fluid_symmetry ) +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface, fluid_symmetry ) % % Parameters of the shape deformation % - FFD_SETTING ( 1.0 ) @@ -109,15 +110,15 @@ DEFORM_COEFF = 1E6 % % For gradient validation uncomment the other DV's! DEFINITION_DV= \ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ -%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 0, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 1, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 2, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 3, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 4, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 5, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 6, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 7, 1, 0.0, 1.0 );\ +%( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md new file mode 100644 index 000000000000..731e207c1329 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md @@ -0,0 +1,27 @@ +# Gradient validation from start to finish + +This guide steps you through the steps necessary to perform a validation of the discrete adjoint sensitivites using finite differences. + +All necessary config files are present and this guide steps through the different tasks to do. + +If you are lucky enough too have some cores to spare, 14 is a suitable substitution for the `<#cores>` placeholder. + +## FFD-box creation +In `configMaster.cfg` the mentioned options have to be uncommented and others commented if they appear twice in the config. +Note that (only!) for the FFD-box creation a `MARKER_HEATFLUX= ( fluid_symmetry ) is artificially is set to avoid an error. This has to be done to make the config-Postprocessing aware that this marker exists as it is used in `DV_MARKER`. +Call `SU2_DEF configMaster.cfg` which creates the new mesh with the name given in 'MESH_OUT_FILENAME'. + +## Primal run +Run `mpirun -n <#cores> SU2_CFD configMaster.cfg` + +## Discrete-Adjoint runb +Rename\copy\symlink `restart_*.dat` -> `solution_*.dat` +Run `mpirun -n <#cores> SU2_CFD_AD DA_configMaster.cfg` and afterwards `SU2_DOT_AD DA_configMaster.cfg` + +## Finite-Differences run +The `OUTER_ITER` is set low in order to be suitable for the regression test. Set that back the number given in the config. +For the full gradient validation uncomment all design variables of the `DEFINITION_DV` config option. +Run `finite_differences.py -f FD_configMaster.cfg -z 2 -n <#cores>`. + +## Comparing results +Just plot the `of_grad.csv` and `FINDIFF/of_grad_findiff.csv` with your tool of choice. Paraview's `Line Chart View` is one option. \ No newline at end of file diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 0d49826f0210..104c9b1b595a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -54,16 +54,23 @@ FFD_CONTINUITY= NO_DERIVATIVE % % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % +% Config options for writing the FFD-box into the mesh. +% Comment these options if they appear elsewhere in the .cfg file. %DV_KIND= FFD_SETTING +%DV_PARAM= ( 1.0 ) +%DV_VALUE= 1.0 +%MESH_FILENAME= 2D-PinArray.su2 +%MESH_OUT_FILENAME= 2D-PinArray_FFD.su2 +MARKER_SYM= ( fluid_symmetry ) + DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D % % Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface ) +DV_MARKER= ( fluid_pin2_interface, solid_pin2_interface, fluid_symmetry ) % % Parameters of the shape deformation % - FFD_SETTING ( 1.0 ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) -%DV_PARAM= ( 1.0 ) DV_PARAM= \ ( BOX, 0, 1, 0.0, 1.0);\ ( BOX, 1, 1, 0.0, 1.0);\ @@ -76,7 +83,6 @@ DV_PARAM= \ ( BOX, 8, 1, 0.0, 1.0) % % Value of the shape deformation -%DV_VALUE= 1.0 DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 % % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% @@ -97,14 +103,14 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE DEFORM_COEFF = 1E6 % DEFINITION_DV= \ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 0, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 1, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 2, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 3, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 4, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 5, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 6, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 7, 1, 0.0, 1.0 );\ -( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 0, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 1, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 2, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 3, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 4, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 5, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 6, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 7, 1, 0.0, 1.0 );\ +( 19, 1.0 | fluid_pin2_interface, solid_pin2_interface, fluid_symmetry | BOX, 8, 1, 0.0, 1.0 ) %DEFORM_MESH= YES diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 3cf10d5cc4aa..171d03d67480 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 399999.9724328518, 3.330700000025998e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -1.310000000143141, 0.0 , 3.139999998902354 , 0.0 , -4.639999999500599 , -5.41000000076064 , 2150.0000002561137 , 120.00000424450263 , -8545.000000026448 , 120.00000424450263 , -13.30000001242837 , 950.0000032858225 , 0.0 , -350.00000480067683, 1e-08 +0 , 0.0 , -100000.016391 , 8.88180000003e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.0499999999737, -5.55100000026e-08 , -2.06999999919 , 0.0 , 2.12999999999 , 3.69999999805 , 330.000000304 , -30.0000010611 , 314.999999773 , -30.0000010611 , -1.40000000481 , -129.999995124 , 0.0 , -510.00000667 , 1e-08 From 11c9975b357bc2efa1708b5eef187ae6c8cfa5bb Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 17 Feb 2021 23:41:00 +0100 Subject: [PATCH 285/326] update fd ofgrad file --- .../streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 171d03d67480..c830b62a8379 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , -100000.016391 , 8.88180000003e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.0499999999737, -5.55100000026e-08 , -2.06999999919 , 0.0 , 2.12999999999 , 3.69999999805 , 330.000000304 , -30.0000010611 , 314.999999773 , -30.0000010611 , -1.40000000481 , -129.999995124 , 0.0 , -510.00000667 , 1e-08 +0 , 0.0 , -100000.01639127731, 8.88180000002836e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.04999999997368221, -5.5510000002640306e-08, -2.069999999187999 , 0.0 , 2.129999999989085 , 3.6999999980524834 , 330.00000030369847 , -30.00000106112566 , 314.99999977313564 , -30.00000106112566 , -1.400000004814217 , -129.99999512430804, 0.0 , -510.0000066704524, 1e-08 From 8278d009d43c287ffdf5b1bce254f442b381b184 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 17 Feb 2021 23:10:23 +0000 Subject: [PATCH 286/326] restarted FGMRES --- Common/include/option_structure.hpp | 2 +- .../drivers/CDiscAdjMultizoneDriver.hpp | 7 +++- .../src/drivers/CDiscAdjMultizoneDriver.cpp | 40 ++++++++++++------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 743d8cbc771f..54da9e9bb916 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -237,7 +237,7 @@ static const MapType Solver_Map = { }; /*! - * \brief different solver types for the multizone environment component + * \brief Different solver types for multizone problems */ enum ENUM_MULTIZONE { MZ_BLOCK_GAUSS_SEIDEL = 0, /*!< \brief Definition of a Block-Gauss-Seidel multizone solver. */ diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index 97e79c2fab9e..53506899fc6a 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -106,9 +106,12 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { for jZone, we need to store all terms to have BGS-type updates with relaxation. */ vector > > Cross_Terms; - vector > fixPtCorrector; + /*!< \brief Fixed-Point corrector that can be applied to inner iterations. */ + vector > FixPtCorrector; - static constexpr unsigned long KrylovMinIters = 5; + /*!< \brief Members to use GMRES to drive inner iterations (alternative to quasi-Newton). */ + static constexpr unsigned long KrylovMinIters = 3; + const Scalar KrylovTol = 0.01; vector > LinSolver; vector > AdjRHS, AdjSol; diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 7c0543779f99..47ae13e35405 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -46,7 +46,8 @@ CDiscAdjMultizoneDriver::CDiscAdjMultizoneDriver(char* confFile, Has_Deformation.resize(nZone) = false; - fixPtCorrector.resize(nZone); + + FixPtCorrector.resize(nZone); LinSolver.resize(nZone); AdjRHS.resize(nZone); AdjSol.resize(nZone); @@ -179,10 +180,10 @@ bool CDiscAdjMultizoneDriver::Iterate(unsigned short iZone, unsigned long iInner /*--- Use QN driver to improve the solution. ---*/ - if (fixPtCorrector[iZone].size()) { - GetAllSolutions(iZone, true, fixPtCorrector[iZone].FPresult()); - fixPtCorrector[iZone].compute(); - if(iInnerIter) SetAllSolutions(iZone, true, fixPtCorrector[iZone]); + if (FixPtCorrector[iZone].size()) { + GetAllSolutions(iZone, true, FixPtCorrector[iZone].FPresult()); + FixPtCorrector[iZone].compute(); + if(iInnerIter) SetAllSolutions(iZone, true, FixPtCorrector[iZone]); } /*--- Residuals during GMRES iterations have no meaning ---*/ @@ -225,14 +226,15 @@ void CDiscAdjMultizoneDriver::Run() { const auto nPointDomain = geometry_container[iZone][INST_0][MESH_0]->GetnPointDomain(); const auto nVar = GetTotalNumberOfVariables(iZone, true); - if (config_container[iZone]->GetNewtonKrylov() && nInnerIter[iZone] >= KrylovMinIters) { + if (config_container[iZone]->GetNewtonKrylov() && + config_container[iZone]->GetnQuasiNewtonSamples() >= KrylovMinIters) { AdjRHS[iZone].Initialize(nPoint, nPointDomain, nVar, nullptr); AdjSol[iZone].Initialize(nPoint, nPointDomain, nVar, nullptr); LinSolver[iZone].SetRecomputeResidual(false); LinSolver[iZone].SetMonitoringFrequency(config_container[iZone]->GetScreen_Wrt_Freq(2)); } else if (config_container[iZone]->GetnQuasiNewtonSamples() > 1) { - fixPtCorrector[iZone].resize(config_container[iZone]->GetnQuasiNewtonSamples(), nPoint, nVar, nPointDomain); + FixPtCorrector[iZone].resize(config_container[iZone]->GetnQuasiNewtonSamples(), nPoint, nVar, nPointDomain); } } @@ -326,12 +328,12 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Reset QN driver for new inner iterations. ---*/ - if (fixPtCorrector[iZone].size()) { - fixPtCorrector[iZone].reset(); - if(restart && (iOuterIter==1)) GetAllSolutions(iZone, true, fixPtCorrector[iZone]); + if (FixPtCorrector[iZone].size()) { + FixPtCorrector[iZone].reset(); + if(restart && (iOuterIter==1)) GetAllSolutions(iZone, true, FixPtCorrector[iZone]); } - if (!config_container[iZone]->GetNewtonKrylov() || !no_restart || nInnerIter[iZone]GetNewtonKrylov() || !no_restart || nInnerIter[iZone] < KrylovMinIters) { /*--- Regular fixed-point, possibly with quasi-Newton method. ---*/ @@ -367,10 +369,18 @@ void CDiscAdjMultizoneDriver::Run() { GetAllSolutions(iZone, true, AdjSol[iZone]); const bool monitor = config_container[iZone]->GetWrt_ZoneConv(); - - Scalar eps = 0.0; - LinSolver[iZone].FGMRES_LinSolver(AdjRHS[iZone], AdjSol[iZone], AdjointProduct(this,iZone), Identity(), - Scalar(1e-9), nInnerIter[iZone]-2, eps, monitor, config_container[iZone]); + const auto product = AdjointProduct(this, iZone); + + Scalar eps = 1.0; + for (auto totalIter = nInnerIter[iZone]; totalIter >= KrylovMinIters && eps > KrylovTol;) { + Scalar eps_l = 0.0; + Scalar tol_l = KrylovTol / eps; + auto iter = min(totalIter-1ul, config_container[iZone]->GetnQuasiNewtonSamples()-1ul); + iter = LinSolver[iZone].FGMRES_LinSolver(AdjRHS[iZone], AdjSol[iZone], product, Identity(), + tol_l, iter, eps_l, monitor, config_container[iZone]); + totalIter -= iter+1; + eps *= eps_l; + } SetAllSolutions(iZone, true, AdjSol[iZone]); From c2d43cde852b89b9998cee14c314cc099472bd68 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 18 Feb 2021 12:48:20 +0100 Subject: [PATCH 287/326] fix_typoLinael --- TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg | 2 +- TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg | 2 +- TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg | 2 +- TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg | 2 +- TestCases/coupled_cht/comp_2d/flow_cylinder.cfg | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg | 2 +- TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg | 2 +- TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg | 2 +- TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg | 2 +- TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg | 2 +- TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg | 2 +- TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg | 2 +- TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg | 2 +- .../disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg | 2 +- TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg | 2 +- TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg | 2 +- TestCases/incomp_euler/nozzle/inv_nozzle.cfg | 2 +- .../incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg | 2 +- TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg | 2 +- .../incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg | 2 +- TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg | 2 +- TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg | 2 +- TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg | 2 +- .../multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg | 2 +- .../multiobjective_wedge/inv_wedge_ROE_multiobj.cfg | 2 +- .../multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg | 2 +- .../multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg | 2 +- .../flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg | 2 +- .../flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg | 2 +- config_template.cfg | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg index 93180d8936e1..f40f1775b496 100644 --- a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg @@ -143,7 +143,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg index e519891a2a1d..fa9cadd19f22 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ERROR= 1E-6 % Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 5 % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % -------------------------- MULTIGRID PARAMETERS -----------------------------% diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg index d5e37789b0c0..81a4e80be47d 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg @@ -110,7 +110,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % -------------------------- MULTIGRID PARAMETERS -----------------------------% diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg index 88ba1cf853b9..7b90ced501ce 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg index c15f371c0d4d..bbc1ffd9c49a 100644 --- a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg @@ -97,7 +97,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg index 06325af0a5e1..9f8ec43f71ed 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg index 05756d604714..bca1647b7dfd 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg index 22ee243c51b3..e834d1134beb 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg index aba99dce0511..c4c66039fd96 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg @@ -151,7 +151,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg index 5e45bd1daad6..feccb6c2413c 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg index 6dcccea26062..b9a20fa95db7 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg index 47d064accbcf..f7576060b5dc 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg index c587d6907b3d..072923c45e3e 100644 --- a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg @@ -148,7 +148,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg index df303ab245eb..ea93e593514e 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg index 3f2a7a5d5f65..4b296aedbc5d 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg index 3e33cbe1a989..201c4f681e79 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg index 75f4590a4814..a12beaa28d9b 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg @@ -135,7 +135,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg index c424aca32456..56f56418c637 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg index 379a6eaf3803..1013307d8f46 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg index 439aa0f77e4b..2f5cdfd50cdd 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg index 501f16e9429b..d201209a6521 100644 --- a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg +++ b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg @@ -288,7 +288,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= LU_SGS % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg index fe1b637bbba4..0ca25328f85d 100644 --- a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg +++ b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg @@ -206,7 +206,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index e54a8b047034..69485bc41d99 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -212,7 +212,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg index 3ebb6e30fbcc..b6591fef723f 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg @@ -131,7 +131,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg index 1b7577fe53ed..d615f549ff2e 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg @@ -131,7 +131,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg index fc9eb30d4ed0..c5b6e21df541 100644 --- a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg +++ b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg @@ -119,7 +119,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 52371510ccc2..8f07b27a0640 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -144,7 +144,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Min error of the linear solver for the implicit formulation diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index c9b8c73ca425..99f14c72867a 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -195,7 +195,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg index ce00494b14d9..8b50e4df8e2b 100644 --- a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg +++ b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg @@ -155,7 +155,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg index a7017d93c384..d8331a7080a3 100755 --- a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg +++ b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg @@ -111,7 +111,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index cfabd77e7300..20a25bbd8aad 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -129,7 +129,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg index 011294a777ba..a55057a7b202 100755 --- a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg +++ b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg @@ -146,7 +146,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg index 30f8b9432d1e..41cd1505c4e3 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg @@ -111,7 +111,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg index 24171325ad6d..40d5597280de 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg index 09bc08fd8650..a4165b7d9dc2 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg index 767b543cac4f..8affe19a7dbf 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg @@ -114,7 +114,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index 0ebe07328e12..8003d977a020 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -355,7 +355,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index 9454f923fbb8..e6f06d2b8056 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -335,7 +335,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/config_template.cfg b/config_template.cfg index 937c13a8cb1f..9d5d4299623a 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1019,7 +1019,7 @@ LINEAR_SOLVER_PREC= ILU % Same for discrete adjoint (JACOBI or ILU), replaces LINEAR_SOLVER_PREC in SU2_*_AD codes. DISCADJ_LIN_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations From 08a0113203406b1feaab36a26cd51c6ae7bae0b0 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 18 Feb 2021 19:24:47 +0100 Subject: [PATCH 288/326] Cleanups. More use of GeometryToolbox --- Common/include/CConfig.hpp | 3 +- Common/src/CConfig.cpp | 2 + Common/src/geometry/CPhysicalGeometry.cpp | 36 ++++++++--------- .../include/numerics/flow/flow_sources.hpp | 10 ++--- SU2_CFD/include/solvers/CHeatSolver.hpp | 16 -------- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 6 +-- SU2_CFD/src/numerics/flow/flow_sources.cpp | 40 ++++++------------- SU2_CFD/src/solvers/CHeatSolver.cpp | 12 ------ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 18 +++------ SU2_DOT/src/SU2_DOT.cpp | 2 +- 11 files changed, 45 insertions(+), 104 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 83656d74a89c..31406aa15da5 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -6248,9 +6248,8 @@ class CConfig { * \param[in] val_index - Index corresponding to the periodic transformation. * \return The translation vector. */ + const su2double* GetPeriodic_Translation(unsigned short val_index ) const { return Periodic_Translation[val_index]; } - const su2double GetPeriodic_Translation(unsigned short iDim, unsigned short val_index = 0) const { return Periodic_Translation[val_index][iDim]; } - /*! * \brief Get the rotationally periodic donor marker for boundary val_marker. * \return Periodic donor marker from the config information for the marker val_marker. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d671521a6b31..3385c89b9f61 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4613,6 +4613,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION); if (Ref_Inc_NonDim != DIMENSIONAL && false) SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\"", CURRENT_FUNCTION); + if (Axisymmetric) + SU2_MPI::Error("Streamwise Periodicity terms does not not have axisymmetric corrections.", CURRENT_FUNCTION); /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ Streamwise_Periodic_RefNode.resize(val_nDim); diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 7c88747747fe..058da3a31f68 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7473,9 +7473,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*-------------------------------------------------------------------------------------------*/ /*--- Initialize/Allocate variables. ---*/ - unsigned short iMarker, iPeriodic, iDim; - unsigned long iPoint; - su2double norm, min_norm = 0.0; + su2double min_norm = 0.0; vector Buffer_Send_RefNode(nDim, 1e300), Buffer_Recv_RefNode(size*nDim); @@ -7487,25 +7485,25 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- therefore the default value of the send value is set super high. ---*/ /*-------------------------------------------------------------------------------------------*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (int iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ - iPeriodic = config->GetMarker_All_PerBound(iMarker); + auto iPeriodic = config->GetMarker_All_PerBound(iMarker); if (iPeriodic == 1) { - for (iPoint = 0; iPoint < GetnVertex(iMarker); iPoint++) { + for (auto iVertex = 0ul; iVertex < GetnVertex(iMarker); iVertex++) { + + auto iPoint = vertex[iMarker][iVertex]->GetNode(); /*--- Get the squared norm of the current point. ---*/ - norm = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm += pow(nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim),2); + auto norm = GeometryToolbox::SquaredNorm(nDim, nodes->GetCoord(iPoint)); /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iPoint == 0) { + if (norm < min_norm || iVertex == 0) { min_norm = norm; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = nodes->GetCoord(vertex[iMarker][iPoint]->GetNode(),iDim); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = nodes->GetCoord(iPoint,iDim); } /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } @@ -7524,18 +7522,16 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- config container. ---*/ /*-------------------------------------------------------------------------------------------*/ - for (iPoint = 0; iPoint < static_cast(size); iPoint++) { // loop over all vertices on that marker and fi + for (int iRank = 0; iRank < size; iRank++) { // loop over all vertices on that marker and fi /*--- Get the norm of the current Point. ---*/ - norm = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm += pow(Buffer_Recv_RefNode[iPoint*nDim + iDim],2); + auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[iRank*nDim]); /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iPoint == 0) { + if (norm < min_norm || iRank == 0) { min_norm = norm; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iPoint*nDim + iDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iRank*nDim + iDim]; } /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } @@ -7546,7 +7542,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- Print the reference node to screen. ---*/ if (rank == MASTER_NODE) { cout << "Streamwise Periodic Reference Node: ["; - for (iDim = 0; iDim < nDim; iDim++) + for (unsigned short iDim = 0; iDim < nDim; iDim++) cout << " " << Buffer_Send_RefNode[iDim]; cout << " ]" << endl; } diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 9e286cbf0679..29a48c15f6e1 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -333,16 +333,12 @@ class CSourceWindGust final : public CSourceBase_Flow { class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { private: - bool turbulent, /*!< \brief Turbulence model used. */ - energy, /*!< \brief Energy equation on. */ - streamwisePeriodic_temperature; /*!< \brief Periodicity in energy equation */ - + bool turbulent; /*!< \brief Turbulence model used. */ + bool energy; /*!< \brief Energy equation on. */ + bool streamwisePeriodic_temperature; /*!< \brief Periodicity in energy equation */ vector Streamwise_Coord_Vector; /*!< \brief Translation vector between streamwise periodic surfaces. */ su2double norm2_translation, /*!< \brief Square of distance between the 2 periodic surfaces. */ - integrated_heatflow, /*!< \brief Total heat added into the domain via heatflux marker. */ - massflow, /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ - delta_p, /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ dot_product, /*!< \brief Container for various dot-products. */ scalar_factor; /*!< \brief Holds scalar factors to simplify final equations. */ diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index 40828dd7cff9..d09d1c3eaefa 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -161,22 +161,6 @@ class CHeatSolver final : public CSolver { void Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) override; -/*! - * \brief Impose the symmetry boundary condition using the residual. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Surface marker where the boundary condition is applied. - */ - void BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) final; - /*! * \brief Impose the Navier-Stokes boundary condition (strong). * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 2764bbad6f4d..1ebdd1f7a5ab 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -125,9 +125,9 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetPeriodic_Translation(iDim); + Streamwise_Coord_Vector[iDim] = config->GetPeriodic_Translation(0)[iDim]; /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: dot_prod(t*t) = (|t|_2)^2 ---*/ - norm2_translation = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(Streamwise_Coord_Vector[iDim],2); + norm2_translation = GeometryToolbox::SquaredNorm(nDim, Streamwise_Coord_Vector.data()); } CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { - delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); - massflow = config->GetStreamwise_Periodic_MassFlow(); - integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + const su2double massflow = config->GetStreamwise_Periodic_MassFlow(); /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ + const su2double integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); /*!< \brief Total heat added into the domain via heatflux marker. */ /*--- No contribution in the continuity equation ---*/ residual[0] = 0.0; @@ -713,9 +713,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); /*--- Compute scalar-product dot_prod(v*t) ---*/ - dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - dot_product += Streamwise_Coord_Vector[iDim] * V_i[iDim+1]; + dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector.data(), &V_i[1]); residual[nDim+1] = Volume * scalar_factor * dot_product; @@ -727,9 +725,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ - dot_product = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - dot_product += Streamwise_Coord_Vector[iDim] * PrimVar_Grad_i[nDim+5][iDim]; // gradient of eddy viscosity + dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector.data(), PrimVar_Grad_i[nDim+5]); residual[nDim+1] -= Volume * scalar_factor * dot_product; } // if turbulent @@ -748,25 +744,13 @@ CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(c for (iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; - // Compute the residual contribution - if (config->GetAxisymmetric()) { - if (Coord_i[1] != 0.0) - AxiFactor = 2.0*PI_NUMBER*Coord_i[1]; - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } - - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - FaceArea = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { FaceArea += pow(Normal[iDim] * AxiFactor, 2); } - FaceArea = sqrt(FaceArea); + /*--- A = sqrt(dot_prod(n_A*n_A)), with n_A beeing the area-normal. ---*/ + FaceArea = GeometryToolbox::Norm(nDim, Normal); //compute local massflow [kg/s] local_Massflow = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - local_Massflow += Normal[iDim] * V_i[iDim+1] * DensityInc_i * AxiFactor; + local_Massflow += Normal[iDim] * V_i[iDim+1] * DensityInc_i; } AreaAvgInletTemp = config->GetStreamwise_Periodic_InletTemperature(); diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 2e0a688eca15..d640603e6523 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -712,18 +712,6 @@ void CHeatSolver::Set_Heatflux_Areas(CGeometry *geometry, CConfig *config) { delete[] Local_Surface_Areas; } -void CHeatSolver::BC_Sym_Plane(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) { - - /* In case of a heat solver (scalar transport equation) nothing has to be done (zero residual contribution) - for the symmetry BC. */ - -} - void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index a4e5b0b39e1f..0c57fb1bafe9 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2870,9 +2870,9 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetStreamwise_Periodic_Properties(CGeometry *geometry, +void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, CConfig *config, - unsigned short iMesh) { + const unsigned short iMesh) { /*---------------------------------------------------------------------------------------------*/ // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 740392c64af4..bfef0a77e973 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -102,8 +102,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (config->GetKind_Streamwise_Periodic() != NONE) { /*--- Define and initialize helping variables ---*/ - su2double norm2_translation = 0.0, - dot_product, + su2double dot_product, Pressure_Recovered, Temperature_Recovered; @@ -115,8 +114,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container vector ReferenceNode = config->GetStreamwise_Periodic_RefNode(); /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) - norm2_translation += pow(config->GetPeriodic_Translation(iDim),2); + su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); /*--- Compute recoverd pressure and temperature for all points ---*/ for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { @@ -124,7 +122,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ dot_product = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) - dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(iDim)); + dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK:: added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; @@ -211,10 +209,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con massflow = config->GetStreamwise_Periodic_MassFlow(); integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); - norm2_translation = 0.0; - for (auto iDim = 0u; iDim < nDim; iDim++) { - norm2_translation += pow(config->GetPeriodic_Translation(iDim),2); - } + norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); } /*--- Identify the boundary by string name ---*/ @@ -297,10 +292,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); /*--- Dot product ---*/ - dot_product = 0.0; - for (auto iDim = 0u; iDim < nDim; iDim++) { - dot_product += config->GetPeriodic_Translation(iDim)*Normal[iDim]; - } + dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), Normal); LinSysRes(iPoint, nDim+1) += scalar_factor*dot_product; } // if streamwise_periodic diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index f948b485d014..6e021f8df85d 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -321,7 +321,7 @@ int main(int argc, char *argv[]) { } } // for iZone - /*--- Write the gradient in a external file ---*/ + /*--- Write the gradient to a file ---*/ if (rank == MASTER_NODE) Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); From 9d78c06d1eff53ef53b5c6ec26ab549a63aef6ce Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 19 Feb 2021 14:28:14 +0000 Subject: [PATCH 289/326] constification, remove legacy python FSI --- Common/include/CConfig.hpp | 4 +- Common/include/option_structure.hpp | 4 -- Common/src/CConfig.cpp | 15 +----- SU2_CFD/include/drivers/CDriver.hpp | 47 ++++++++-------- SU2_CFD/src/iteration/CIteration.cpp | 31 ----------- SU2_CFD/src/iteration/CIterationFactory.cpp | 2 +- SU2_CFD/src/python_wrapper_structure.cpp | 54 +++++++++---------- .../cont_adj_rans/oneram6/turb_ONERAM6.cfg | 7 +-- TestCases/gust/inv_gust_NACA0012.cfg | 2 +- TestCases/moving_wall/cavity/lam_cavity.cfg | 3 +- .../spinning_cylinder/spinning_cylinder.cfg | 2 +- .../pitching_NACA64A010.cfg | 2 +- .../pitching_oneram6/pitching_ONERAM6.cfg | 2 +- .../rotating_naca0012/rotating_NACA0012.cfg | 2 +- 14 files changed, 58 insertions(+), 119 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3aa76c0faa40..91684f20d32d 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -657,7 +657,7 @@ class CConfig { nMarker_ZoneInterface, /*!< \brief Number of markers in the zone interface. */ nMarker_Plotting, /*!< \brief Number of markers to plot. */ nMarker_Analyze, /*!< \brief Number of markers to analyze. */ - nMarker_Moving, /*!< \brief Number of markers in motion (DEFORMING, MOVING_WALL, or FLUID_STRUCTURE). */ + nMarker_Moving, /*!< \brief Number of markers in motion (DEFORMING, MOVING_WALL). */ nMarker_PyCustom, /*!< \brief Number of markers that are customizable in Python. */ nMarker_DV, /*!< \brief Number of markers affected by the design variables. */ nMarker_WallFunctions; /*!< \brief Number of markers for which wall functions must be applied. */ @@ -667,7 +667,7 @@ class CConfig { *Marker_Plotting, /*!< \brief Markers to plot. */ *Marker_Analyze, /*!< \brief Markers to analyze. */ *Marker_ZoneInterface, /*!< \brief Markers in the FSI interface. */ - *Marker_Moving, /*!< \brief Markers in motion (DEFORMING, MOVING_WALL, or FLUID_STRUCTURE). */ + *Marker_Moving, /*!< \brief Markers in motion (DEFORMING, MOVING_WALL). */ *Marker_PyCustom, /*!< \brief Markers that are customizable in Python. */ *Marker_DV, /*!< \brief Markers affected by the design variables. */ *Marker_WallFunctions; /*!< \brief Markers for which wall functions must be applied. */ diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 5a3c8213c379..c7044f8b75ea 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -176,7 +176,6 @@ enum ENUM_MAIN_SOLVER { INC_NAVIER_STOKES =5, /*!< \brief Definition of the incompressible Navier-Stokes' solver. */ INC_RANS = 6, /*!< \brief Definition of the incompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */ HEAT_EQUATION = 7, /*!< \brief Definition of the finite volume heat solver. */ - FLUID_STRUCTURE_INTERACTION = 8, /*!< \brief Definition of a FSI solver. */ FEM_ELASTICITY = 9, /*!< \brief Definition of a FEM solver. */ ADJ_EULER = 10, /*!< \brief Definition of the continuous adjoint Euler's solver. */ ADJ_NAVIER_STOKES = 11, /*!< \brief Definition of the continuous adjoint Navier-Stokes' solver. */ @@ -231,7 +230,6 @@ static const MapType Solver_Map = { MakePair("DISC_ADJ_FEM_RANS", DISC_ADJ_FEM_RANS) MakePair("DISC_ADJ_FEM_NS", DISC_ADJ_FEM_NS) MakePair("DISC_ADJ_FEM", DISC_ADJ_FEM) - MakePair("FLUID_STRUCTURE_INTERACTION", FLUID_STRUCTURE_INTERACTION) MakePair("TEMPLATE_SOLVER", TEMPLATE_SOLVER) MakePair("MULTIPHYSICS", MULTIPHYSICS) }; @@ -699,7 +697,6 @@ enum ENUM_SURFACEMOVEMENT { MOVING_WALL = 2, /*!< \brief Simulation with moving wall. */ AEROELASTIC = 3, /*!< \brief Simulation with aeroelastic motion. */ AEROELASTIC_RIGID_MOTION = 4, /*!< \brief Simulation with rotation and aeroelastic motion. */ - FLUID_STRUCTURE = 5, /*!< \brief Fluid structure deformation. */ EXTERNAL = 6, /*!< \brief Simulation with external motion. */ EXTERNAL_ROTATION = 7, /*!< \brief Simulation with external rotation motion. */ }; @@ -708,7 +705,6 @@ static const MapType SurfaceMovement_Map = { MakePair("MOVING_WALL", MOVING_WALL) MakePair("AEROELASTIC_RIGID_MOTION", AEROELASTIC_RIGID_MOTION) MakePair("AEROELASTIC", AEROELASTIC) - MakePair("FLUID_STRUCTURE", FLUID_STRUCTURE) MakePair("EXTERNAL", EXTERNAL) MakePair("EXTERNAL_ROTATION", EXTERNAL_ROTATION) }; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 01137a94aae3..b434a2f6edd2 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3114,13 +3114,6 @@ void CConfig::SetnZone(){ } - /*--- Temporary fix until Multizone Disc. Adj. solver is ready ---- */ - - if (Kind_Solver == FLUID_STRUCTURE_INTERACTION){ - - nZone = GetnZone(Mesh_FileName, Mesh_FileFormat); - - } } void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_izone, unsigned short val_nDim) { @@ -3563,11 +3556,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - if ((nKind_SurfaceMovement > 1) && GetSurface_Movement(FLUID_STRUCTURE)) { - SU2_MPI::Error("FSI in combination with moving surfaces is currently not supported.", CURRENT_FUNCTION); - } - - if ((nKind_SurfaceMovement != nMarker_Moving) && !GetSurface_Movement(FLUID_STRUCTURE)) { + if (nKind_SurfaceMovement != nMarker_Moving) { SU2_MPI::Error("Number of KIND_SURFACE_MOVEMENT must match number of MARKER_MOVING", CURRENT_FUNCTION); } @@ -5590,7 +5579,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { case RIGID_MOTION: cout << "rigid mesh motion." << endl; break; case MOVING_HTP: cout << "HTP moving." << endl; break; case ROTATING_FRAME: cout << "rotating reference frame." << endl; break; - case FLUID_STRUCTURE: cout << "fluid-structure motion." << endl; break; case EXTERNAL: cout << "externally prescribed motion." << endl; break; } } @@ -8302,7 +8290,6 @@ bool CConfig::GetVolumetric_Movement() const { if (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)|| - GetSurface_Movement(FLUID_STRUCTURE) || GetSurface_Movement(EXTERNAL) || GetSurface_Movement(EXTERNAL_ROTATION)){ volumetric_movement = true; diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 617c23d7316c..b4c1bc0c868d 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -428,13 +428,13 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return True if the specified vertex is a halo node. */ - bool IsAHaloNode(unsigned short iMarker, unsigned long iVertex); + bool IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the number of external iterations. * \return Number of external iterations. */ - unsigned long GetnTimeIter(); + unsigned long GetnTimeIter() const; /*! * \brief Get the current external iteration. @@ -446,7 +446,7 @@ class CDriver { * \brief Get the unsteady time step. * \return Unsteady time step. */ - passivedouble GetUnsteady_TimeStep(); + passivedouble GetUnsteady_TimeStep() const; /*! * \brief Get the global index of a vertex on a specified marker. @@ -454,7 +454,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vertex global index. */ - unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex); + unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get undeformed coordinates from the mesh solver. @@ -462,7 +462,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return x,y,z coordinates of the vertex. */ - vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex); + vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the temperature at a vertex on a specified marker. @@ -470,7 +470,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Temperature of the vertex. */ - passivedouble GetVertexTemperature(unsigned short iMarker, unsigned long iVertex); + passivedouble GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the temperature of a vertex on a specified marker. @@ -486,7 +486,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return True if the vertex is a halo node. */ - vector GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex); + vector GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the wall normal component of the heat flux at a vertex on a specified marker. @@ -494,7 +494,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Wall normal component of the heat flux at the vertex. */ - passivedouble GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex); + passivedouble GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the wall normal component of the heat flux at a vertex on a specified marker. @@ -510,7 +510,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Thermal conductivity at the vertex. */ - passivedouble GetThermalConductivity(unsigned short iMarker, unsigned long iVertex); + passivedouble GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Preprocess the inlets via file input for all solvers. @@ -518,8 +518,7 @@ class CDriver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, - CConfig *config) const; + void Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, CConfig *config) const; /*! * \brief Get the unit normal (vector) at a vertex on a specified marker. @@ -527,43 +526,43 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Unit normal (vector) at the vertex. */ - vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex); + vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get all the boundary markers tags. * \return List of boundary markers tags. */ - vector GetAllBoundaryMarkersTag(); + vector GetAllBoundaryMarkersTag() const; /*! * \brief Get all the deformable boundary marker tags. * \return List of deformable boundary markers tags. */ - vector GetAllDeformMeshMarkersTag(); + vector GetAllDeformMeshMarkersTag() const; /*! * \brief Get all the heat transfer boundary markers tags. * \return List of heat transfer boundary markers tags. */ - vector GetAllCHTMarkersTag(); + vector GetAllCHTMarkersTag() const; /*! * \brief Get all the (subsonic) inlet boundary markers tags. * \return List of inlet boundary markers tags. */ - vector GetAllInletMarkersTag(); + vector GetAllInletMarkersTag() const; /*! * \brief Get all the boundary markers tags with their associated indices. * \return List of boundary markers tags with their indices. */ - map GetAllBoundaryMarkers(); + map GetAllBoundaryMarkers() const; /*! * \brief Get all the boundary markers tags with their associated types. * \return List of boundary markers tags with their types. */ - map GetAllBoundaryMarkersType(); + map GetAllBoundaryMarkersType() const; /*! * \brief Set the mesh displacement for the elasticity mesh solver. @@ -586,7 +585,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of sensitivities. */ - vector GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex); + vector GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the load in X direction for the structural solver. @@ -605,7 +604,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of displacements. */ - vector GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Return the velocities from the FEA Solver. @@ -613,7 +612,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of velocities. */ - vector GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Return the velocities from the FEA Solver. @@ -621,7 +620,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of velocities at time n. */ - vector GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the sensitivity of the flow loads for the structural solver. @@ -631,7 +630,7 @@ class CDriver { * \param[in] LoadX - Value of the load in the direction Y. * \param[in] LoadX - Value of the load in the direction Z. */ - vector GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex); + vector GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the flow load (from the extra step - the repeated methods should be unified once the postprocessing @@ -639,7 +638,7 @@ class CDriver { * \param[in] iMarker - Marker identifier. * \param[in] iVertex - Vertex identifier. */ - vector GetFlowLoad(unsigned short iMarker, unsigned long iVertex); + vector GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the adjoint of the flow tractions (from the extra step - diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index b33b39131f92..d76b49ef187e 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -34,13 +34,8 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac CVolumetricMovement* grid_movement, CSolver*** solver, CConfig* config, unsigned long IntIter, unsigned long TimeIter) { unsigned short Kind_Grid_Movement = config->GetKind_GridMovement(); - unsigned long nIterMesh; - bool stat_mesh = true; bool adjoint = config->GetContinuous_Adjoint(); - /*--- Only write to screen if this option is enabled ---*/ - bool Screen_Output = config->GetDeform_Output(); - unsigned short val_iZone = config->GetiZone(); /*--- Perform mesh movement depending on specified type ---*/ @@ -120,32 +115,6 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac } } - if (config->GetSurface_Movement(FLUID_STRUCTURE)) { - if (rank == MASTER_NODE && Screen_Output) - cout << endl << "Deforming the grid for Fluid-Structure Interaction applications." << endl; - - /*--- Deform the volume grid around the new boundary locations ---*/ - - if (rank == MASTER_NODE && Screen_Output) cout << "Deforming the volume grid." << endl; - grid_movement->SetVolume_Deformation(geometry[MESH_0], config, true, false); - - nIterMesh = grid_movement->Get_nIterMesh(); - stat_mesh = (nIterMesh == 0); - - if (!adjoint && !stat_mesh) { - if (rank == MASTER_NODE && Screen_Output) cout << "Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, TimeIter); - } else if (stat_mesh) { - if (rank == MASTER_NODE && Screen_Output) - cout << "The mesh is up-to-date. Using previously stored grid velocities." << endl; - } - - /*--- Update the multigrid structure after moving the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - - grid_movement->UpdateMultiGrid(geometry, config); - } - if (config->GetSurface_Movement(EXTERNAL) || config->GetSurface_Movement(EXTERNAL_ROTATION)) { /*--- Apply rigid rotation to entire grid first, if necessary ---*/ diff --git a/SU2_CFD/src/iteration/CIterationFactory.cpp b/SU2_CFD/src/iteration/CIterationFactory.cpp index d55188cf2abc..e330c9434e60 100644 --- a/SU2_CFD/src/iteration/CIterationFactory.cpp +++ b/SU2_CFD/src/iteration/CIterationFactory.cpp @@ -112,7 +112,7 @@ CIteration* CIterationFactory::CreateIteration(ENUM_MAIN_SOLVER kindSolver, cons iteration = new CDiscAdjHeatIteration(config); break; - case NO_SOLVER: case FLUID_STRUCTURE_INTERACTION: case TEMPLATE_SOLVER: case MULTIPHYSICS: + case NO_SOLVER: case TEMPLATE_SOLVER: case MULTIPHYSICS: SU2_MPI::Error("No iteration found for specified solver.", CURRENT_FUNCTION); break; } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 80b4d9aa98e2..3299b75484c8 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -33,10 +33,7 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geometry, CSolver *****solver){ int rank = MASTER_NODE; - -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); /* --- Initialize boundary conditions customization, this is achieve through the Python wrapper --- */ for(iZone=0; iZone < nZone; iZone++){ @@ -193,7 +190,7 @@ unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker){ } -unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) { +unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint, GlobalIndex; @@ -204,7 +201,7 @@ unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned lon } -bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) { +bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; @@ -214,7 +211,7 @@ bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) { } -vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const { vector coord(3,0.0); vector coord_passive(3, 0.0); @@ -231,7 +228,7 @@ vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsig return coord_passive; } -vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex){ +vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const { su2double *Normal; su2double Area; @@ -257,9 +254,9 @@ vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsig /* Functions to obtain global parameters from SU2 (time steps, delta t, ecc...) */ ////////////////////////////////////////////////////////////////////////////////// -unsigned long CDriver::GetnTimeIter() { +unsigned long CDriver::GetnTimeIter() const { - return config_container[ZONE_0]->GetnTime_Iter(); + return config_container[ZONE_0]->GetnTime_Iter(); } unsigned long CDriver::GetTime_Iter() const{ @@ -267,7 +264,7 @@ unsigned long CDriver::GetTime_Iter() const{ return TimeIter; } -passivedouble CDriver::GetUnsteady_TimeStep(){ +passivedouble CDriver::GetUnsteady_TimeStep() const { return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } @@ -276,7 +273,7 @@ passivedouble CDriver::GetUnsteady_TimeStep(){ /* Functions related to CHT solver */ /////////////////////////////////////////////////////////////////////////////// -passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; su2double vertexWallTemp(0.0); @@ -298,7 +295,7 @@ void CDriver::SetVertexTemperature(unsigned short iMarker, unsigned long iVertex geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryTemperature(iMarker, iVertex, val_WallTemp); } -vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex){ +vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; unsigned short iDim; @@ -313,7 +310,6 @@ vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsig vector HeatFluxPassive (3,0.0); bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); - bool halo; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); @@ -333,7 +329,7 @@ vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsig return HeatFluxPassive; } -passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const{ unsigned long iPoint; unsigned short iDim; @@ -381,7 +377,7 @@ void CDriver::SetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVer geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryHeatFlux(iMarker, iVertex, val_WallHeatFlux); } -passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; su2double Prandtl_Lam = config_container[ZONE_0]->GetPrandtl_Lam(); @@ -403,7 +399,7 @@ passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned l /* Functions related to the management of markers */ //////////////////////////////////////////////////////////////////////////////// -vector CDriver::GetAllBoundaryMarkersTag(){ +vector CDriver::GetAllBoundaryMarkersTag() const { vector boundariesTagList; unsigned short iMarker,nBoundariesMarkers; @@ -420,7 +416,7 @@ vector CDriver::GetAllBoundaryMarkersTag(){ return boundariesTagList; } -vector CDriver::GetAllDeformMeshMarkersTag(){ +vector CDriver::GetAllDeformMeshMarkersTag() const { vector interfaceBoundariesTagList; unsigned short iMarker, nBoundariesMarker; @@ -437,7 +433,7 @@ vector CDriver::GetAllDeformMeshMarkersTag(){ return interfaceBoundariesTagList; } -vector CDriver::GetAllCHTMarkersTag(){ +vector CDriver::GetAllCHTMarkersTag() const { vector CHTBoundariesTagList; unsigned short iMarker, nBoundariesMarker; @@ -456,7 +452,7 @@ vector CDriver::GetAllCHTMarkersTag(){ return CHTBoundariesTagList; } -vector CDriver::GetAllInletMarkersTag(){ +vector CDriver::GetAllInletMarkersTag() const { vector BoundariesTagList; unsigned short iMarker, nBoundariesMarker; @@ -476,7 +472,7 @@ vector CDriver::GetAllInletMarkersTag(){ return BoundariesTagList; } -map CDriver::GetAllBoundaryMarkers(){ +map CDriver::GetAllBoundaryMarkers() const { map allBoundariesMap; unsigned short iMarker, nBoundaryMarkers; @@ -492,7 +488,7 @@ map CDriver::GetAllBoundaryMarkers(){ return allBoundariesMap; } -map CDriver::GetAllBoundaryMarkersType(){ +map CDriver::GetAllBoundaryMarkersType() const { map allBoundariesTypeMap; unsigned short iMarker, KindBC; @@ -647,7 +643,7 @@ void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passiv } -vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Displacements(3, 0.0); @@ -672,7 +668,7 @@ vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsi } -vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Velocity(3, 0.0); @@ -698,7 +694,7 @@ vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned return Velocity_passive; } -vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Velocity_n(3, 0.0); @@ -729,7 +725,7 @@ vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigne /* Functions related to adjoint simulations */ //////////////////////////////////////////////////////////////////////////////// -vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Disp_Sens(3, 0.0); @@ -754,9 +750,7 @@ vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, u } - - -vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector FlowLoad_Sens(3, 0.0); @@ -842,7 +836,7 @@ void CDriver::CommunicateMeshDisplacement(void) { /* Functions related to flow loads */ //////////////////////////////////////////////////////////////////////////////// -vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const { vector FlowLoad(3, 0.0); vector FlowLoad_passive(3, 0.0); diff --git a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg index 5c7f5c8dcdd8..ebfc62d342cd 100644 --- a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg @@ -11,12 +11,7 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Physical governing equations (EULER, NAVIER_STOKES, -% PLASMA_EULER, PLASMA_NAVIER_STOKES, -% FREE_SURFACE_EULER, FREE_SURFACE_NAVIER_STOKES, -% FLUID_STRUCTURE_EULER, FLUID_STRUCTURE_NAVIER_STOKES, -% AEROACOUSTIC_EULER, AEROACOUSTIC_NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY) +% Physical governing equations (EULER, NAVIER_STOKES, etc.) SOLVER= NAVIER_STOKES % % Specify turbulence model (NONE, SA, SA_NEG, SST) diff --git a/TestCases/gust/inv_gust_NACA0012.cfg b/TestCases/gust/inv_gust_NACA0012.cfg index 61950875cf14..c3d44d246925 100644 --- a/TestCases/gust/inv_gust_NACA0012.cfg +++ b/TestCases/gust/inv_gust_NACA0012.cfg @@ -72,7 +72,7 @@ INNER_ITER= 100 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, ELASTICITY, +% MOVING_WALL, AEROELASTIC, ELASTICITY, % EXTERNAL, AEROELASTIC_RIGID_MOTION) GRID_MOVEMENT= GUST % diff --git a/TestCases/moving_wall/cavity/lam_cavity.cfg b/TestCases/moving_wall/cavity/lam_cavity.cfg index 545e44b297b5..f6f7378821e0 100644 --- a/TestCases/moving_wall/cavity/lam_cavity.cfg +++ b/TestCases/moving_wall/cavity/lam_cavity.cfg @@ -48,8 +48,7 @@ REYNOLDS_LENGTH= 1.0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, ELASTICITY, -% EXTERNAL) +% MOVING_WALL, AEROELASTIC, ELASTICITY, EXTERNAL) SURFACE_MOVEMENT= MOVING_WALL % % Motion mach number (non-dimensional). Used for initializing a viscous flow diff --git a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg index 4dc1a80d0a7b..534193074e4e 100644 --- a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg +++ b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg @@ -48,7 +48,7 @@ REYNOLDS_LENGTH= 1.0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) SURFACE_MOVEMENT= MOVING_WALL % % Motion mach number (non-dimensional). Used for intitializing a viscous flow diff --git a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg index 8d22b6507446..f5fa022f1b4e 100644 --- a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg +++ b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg @@ -51,7 +51,7 @@ UNST_ADJOINT_ITER= 251 % Dynamic mesh simulation (NO, YES) GRID_MOVEMENT= YES % -% Type of mesh motion (NONE, FLUTTER, RIGID_MOTION, FLUID_STRUCTURE) +% Type of mesh motion (NONE, FLUTTER, RIGID_MOTION) GRID_MOVEMENT_KIND= RIGID_MOTION % % Motion mach number (non-dimensional). Used for initializing a viscous flow diff --git a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg index 8a1ab1851c2b..d9ca2a72dd7a 100644 --- a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg +++ b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg @@ -65,7 +65,7 @@ UNST_ADJOINT_ITER= 251 GRID_MOVEMENT= YES % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) GRID_MOVEMENT_KIND= RIGID_MOTION % % Motion mach number (non-dimensional). Used for intitializing a viscous flow diff --git a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg index ff3a00c420f0..83801d29d8c5 100644 --- a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg +++ b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg @@ -58,7 +58,7 @@ REF_AREA= 1.0 GRID_MOVEMENT= YES % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) GRID_MOVEMENT_KIND= ROTATING_FRAME % % Motion mach number (non-dimensional). Used for intitializing a viscous flow From f956724c55365ae53b9df7577a48db3ea9ff965f Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 19 Feb 2021 14:35:24 +0000 Subject: [PATCH 290/326] fix #1202 --- SU2_CFD/src/output/CFlowCompOutput.cpp | 7 ------- SU2_CFD/src/output/CFlowOutput.cpp | 4 ++++ SU2_CFD/src/output/CNEMOCompOutput.cpp | 7 ------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 3b6f328b533f..14240f531057 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -279,9 +279,6 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ Add_CpInverseDesignOutput(config); - /*--- Add combo obj value --- */ - - AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ @@ -718,10 +715,6 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol Set_CpInverseDesign(flow_solver, geometry, config); - /*--- Set combo obj value --- */ - - SetHistoryOutputValue("COMBO", flow_solver->GetTotal_ComboObj()); - } bool CFlowCompOutput::SetInit_Residuals(CConfig *config){ diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index e0b28799cf5e..4c33d0354a26 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -638,6 +638,8 @@ void CFlowOutput::AddAerodynamicCoefficients(CConfig *config){ /// DESCRIPTION: Angle of attack AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::FIXED, "AOA", "Angle of attack"); + + AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CFlowOutput::SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solver){ @@ -680,6 +682,8 @@ void CFlowOutput::SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solv } SetHistoryOutputValue("AOA", config->GetAoA()); + + SetHistoryOutputValue("COMBO", flow_solver->GetTotal_ComboObj()); } void CFlowOutput::SetRotatingFrameCoefficients(CConfig *config, CSolver *flow_solver) { diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 917823fa4fd4..43686451a968 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -279,9 +279,6 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ Add_CpInverseDesignOutput(config); - /*--- Add combo obj value --- */ - - AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ @@ -686,10 +683,6 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol Set_CpInverseDesign(NEMO_solver, geometry, config); - /*--- Set combo obj value --- */ - - SetHistoryOutputValue("COMBO", NEMO_solver->GetTotal_ComboObj()); - } bool CNEMOCompOutput::SetInit_Residuals(CConfig *config){ From 392e31f89dcfede060dad906421f4d42e96dfcc9 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 19 Feb 2021 14:48:32 +0000 Subject: [PATCH 291/326] more const --- SU2_CFD/include/drivers/CDriver.hpp | 18 +++++++++--------- SU2_CFD/src/python_wrapper_structure.cpp | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index b4c1bc0c868d..954f943036fd 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -370,57 +370,57 @@ class CDriver { * \brief Get the total drag. * \return Total drag. */ - passivedouble Get_Drag(); + passivedouble Get_Drag() const; /*! * \brief Get the total lift. * \return Total lift. */ - passivedouble Get_Lift(); + passivedouble Get_Lift() const; /*! * \brief Get the total x moment. * \return Total x moment. */ - passivedouble Get_Mx(); + passivedouble Get_Mx() const; /*! * \brief Get the total y moment. * \return Total y moment. */ - passivedouble Get_My(); + passivedouble Get_My() const; /*! * \brief Get the total z moment. * \return Total z moment. */ - passivedouble Get_Mz(); + passivedouble Get_Mz() const; /*! * \brief Get the total drag coefficient. * \return Total drag coefficient. */ - passivedouble Get_DragCoeff(); + passivedouble Get_DragCoeff() const; /*! * \brief Get the total lift coefficient. * \return Total lift coefficient. */ - passivedouble Get_LiftCoeff(); + passivedouble Get_LiftCoeff() const; /*! * \brief Get the number of vertices (halo nodes included) from a specified marker. * \param[in] iMarker - Marker identifier. * \return Number of vertices. */ - unsigned long GetNumberVertices(unsigned short iMarker); + unsigned long GetNumberVertices(unsigned short iMarker) const; /*! * \brief Get the number of halo vertices from a specified marker. * \param[in] iMarker - Marker identifier. * \return Number of vertices. */ - unsigned long GetNumberHaloVertices(unsigned short iMarker); + unsigned long GetNumberHaloVertices(unsigned short iMarker) const; /*! * \brief Check if a vertex is physical or not (halo node) on a specified marker. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 3299b75484c8..ebf9a926d5d2 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -63,7 +63,7 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geom /* Functions related to the global performance indices (Lift, Drag, ecc..) */ ///////////////////////////////////////////////////////////////////////////// -passivedouble CDriver::Get_Drag() { +passivedouble CDriver::Get_Drag() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -78,7 +78,7 @@ passivedouble CDriver::Get_Drag() { return SU2_TYPE::GetValue(val_Drag); } -passivedouble CDriver::Get_Lift() { +passivedouble CDriver::Get_Lift() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -93,7 +93,7 @@ passivedouble CDriver::Get_Lift() { return SU2_TYPE::GetValue(val_Lift); } -passivedouble CDriver::Get_Mx(){ +passivedouble CDriver::Get_Mx() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -110,7 +110,7 @@ passivedouble CDriver::Get_Mx(){ return SU2_TYPE::GetValue(val_Mx); } -passivedouble CDriver::Get_My(){ +passivedouble CDriver::Get_My() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -127,7 +127,7 @@ passivedouble CDriver::Get_My(){ return SU2_TYPE::GetValue(val_My); } -passivedouble CDriver::Get_Mz() { +passivedouble CDriver::Get_Mz() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -144,7 +144,7 @@ passivedouble CDriver::Get_Mz() { return SU2_TYPE::GetValue(val_Mz); } -passivedouble CDriver::Get_DragCoeff() { +passivedouble CDriver::Get_DragCoeff() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -155,7 +155,7 @@ passivedouble CDriver::Get_DragCoeff() { return SU2_TYPE::GetValue(CDrag); } -passivedouble CDriver::Get_LiftCoeff() { +passivedouble CDriver::Get_LiftCoeff() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); @@ -170,13 +170,13 @@ passivedouble CDriver::Get_LiftCoeff() { /* Functions to obtain information from the geometry/mesh */ ///////////////////////////////////////////////////////////////////////////// -unsigned long CDriver::GetNumberVertices(unsigned short iMarker){ +unsigned long CDriver::GetNumberVertices(unsigned short iMarker) const { return geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; } -unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker){ +unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker) const { unsigned long nHaloVertices, iVertex, iPoint; From a341847464012a9eed08d056fa2007f04bac1854 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 12:02:51 +0000 Subject: [PATCH 292/326] update authors in 2 files --- SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp | 2 +- SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index 53506899fc6a..b5856f49e829 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -1,7 +1,7 @@ /*! * \class CDiscAdjMultizoneDriver.hpp * \brief Class for driving adjoint multi-zone problems. - * \author O. Burghardt, T. Albring, R. Sanchez + * \author O. Burghardt, P. Gomes, T. Albring, R. Sanchez * \version 7.1.0 "Blackbird" * * SU2 Project Website: https://su2code.github.io diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 47ae13e35405..296065b86686 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -1,7 +1,7 @@ /*! * \file CDiscAdjMultizoneDriver.cpp * \brief The main subroutines for driving adjoint multi-zone problems - * \author O. Burghardt, T. Albring, R. Sanchez + * \author O. Burghardt, P. Gomes, T. Albring, R. Sanchez * \version 7.1.0 "Blackbird" * * SU2 Project Website: https://su2code.github.io From 2f9898dba5beaede96e3022ef476826e49065f97 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 12:16:44 +0000 Subject: [PATCH 293/326] pedantic warnings for CI builds, disable warnings of external libs --- .github/workflows/regression.yml | 14 +++++++------- UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp | 2 -- UnitTests/test_driver.cpp | 1 - externals/cgns/meson.build | 7 ++++++- externals/metis/meson.build | 13 ++++++++++++- externals/parmetis/meson.build | 2 +- externals/tecio/teciompisrc/meson.build | 9 +++++++++ externals/tecio/teciosrc/meson.build | 9 +++++++++ meson.build | 10 ++++++---- 9 files changed, 50 insertions(+), 17 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index ecd9e069edd0..cea9c098ee41 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -19,19 +19,19 @@ jobs: config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP] include: - config_set: BaseMPI - flags: '-Denable-pywrapper=true -Denable-tests=true --werror' + flags: '-Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ReverseMPI - flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --werror' + flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ForwardMPI - flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --werror' + flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror' - config_set: BaseNoMPI - flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --werror' + flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror' - config_set: ReverseNoMPI - flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --werror' + flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ForwardNoMPI - flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --werror' + flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror' - config_set: BaseOMP - flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --werror' + flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror' runs-on: ubuntu-latest steps: - name: Cache Object Files diff --git a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp index 5e4e313dcd7d..04ca30b34f24 100644 --- a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp @@ -39,8 +39,6 @@ TEST_CASE("NTS blending has a minimum of 0.05", "[Upwind/central blending]") { /*--- Setup ---*/ - const unsigned short nDim = 3; - CConfig* config = new CConfig(config_options, SU2_CFD, false); const su2double dissipation_i = 0; diff --git a/UnitTests/test_driver.cpp b/UnitTests/test_driver.cpp index 0fd92e5dc054..269c5a61db72 100644 --- a/UnitTests/test_driver.cpp +++ b/UnitTests/test_driver.cpp @@ -43,7 +43,6 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); /*--- Run the test driver supplied by Catch ---*/ int result = Catch::Session().run(argc, argv); diff --git a/externals/cgns/meson.build b/externals/cgns/meson.build index 1f201e585749..e7bc68e38c09 100644 --- a/externals/cgns/meson.build +++ b/externals/cgns/meson.build @@ -1,7 +1,12 @@ if build_machine.system() == 'windows' or meson.get_compiler('cpp').get_id() == 'intel' cgns_default_warnings = [] else - cgns_default_warnings = ['-Wno-unused-result'] + cgns_default_warnings = ['-Wno-unused-result', + '-Wno-unused-parameter', + '-Wno-unused-variable', + '-Wno-unused-but-set-variable', + '-Wno-sign-compare', + '-Wno-pedantic'] endif cgns_include = include_directories('adf', './') diff --git a/externals/metis/meson.build b/externals/metis/meson.build index 905368c6bae8..932cb9c5a1fd 100644 --- a/externals/metis/meson.build +++ b/externals/metis/meson.build @@ -4,7 +4,18 @@ metis_default_warnings = [] if build_machine.system() != 'windows' metis_default_warnings += ['-Wno-implicit-function-declaration'] if meson.get_compiler('cpp').get_id() != 'intel' - metis_default_warnings += ['-Wno-unused-result', '-Wno-macro-redefined'] + metis_default_warnings += ['-Wno-unused-result', + '-Wno-unused-parameter', + '-Wno-unused-variable', + '-Wno-unused-but-set-variable', + '-Wno-macro-redefined', + '-Wno-unknown-pragmas', + '-Wno-sign-compare', + '-Wno-clobbered', + '-Wno-empty-body', + '-Wno-unused-label', + '-Wno-misleading-indentation', + '-Wno-pedantic'] endif endif diff --git a/externals/parmetis/meson.build b/externals/parmetis/meson.build index 47a11c0891fc..51d3dbe4b426 100644 --- a/externals/parmetis/meson.build +++ b/externals/parmetis/meson.build @@ -41,6 +41,6 @@ parmetis = static_library('parmetis', 'libparmetis/match.c', 'libparmetis/mmetis.c', install : false, include_directories: parmetis_include, - dependencies: [mpi_dep, metis_dep], c_args: parmetis_c_args) + dependencies: [mpi_dep, metis_dep], c_args: parmetis_c_args + metis_default_warnings) parmetis_dep = declare_dependency(link_with: parmetis, include_directories: parmetis_include) diff --git a/externals/tecio/teciompisrc/meson.build b/externals/tecio/teciompisrc/meson.build index 427a7129dcda..383ea75fa6db 100644 --- a/externals/tecio/teciompisrc/meson.build +++ b/externals/tecio/teciompisrc/meson.build @@ -12,6 +12,15 @@ if (host_machine.system() == 'windows') tec_cxx_flags += ['-DMSWIN'] endif +if build_machine.system() != 'windows' + if meson.get_compiler('cpp').get_id() != 'intel' + tec_cxx_flags += ['-Wno-misleading-indentation', + '-Wno-uninitialized', + '-Wno-placement-new', + '-Wno-pedantic'] + endif +endif + teciompi_include = include_directories(['../', './']) diff --git a/externals/tecio/teciosrc/meson.build b/externals/tecio/teciosrc/meson.build index 4ef7481e156f..6c8fa088c215 100644 --- a/externals/tecio/teciosrc/meson.build +++ b/externals/tecio/teciosrc/meson.build @@ -12,6 +12,15 @@ if (host_machine.system() == 'windows') tecio_cpp_flags += ['-DMSWIN'] endif +if build_machine.system() != 'windows' + if meson.get_compiler('cpp').get_id() != 'intel' + tecio_cpp_flags += ['-Wno-misleading-indentation', + '-Wno-uninitialized', + '-Wno-placement-new', + '-Wno-pedantic'] + endif +endif + tecio_include = include_directories('../', './') tecio = static_library('tecio', 'ClassicZoneWriterAbstract.cpp', diff --git a/meson.build b/meson.build index 1dc70b6a41cb..cb688126fbed 100644 --- a/meson.build +++ b/meson.build @@ -18,9 +18,11 @@ if build_machine.system() != 'windows' default_warning_flags += ['-Wno-empty-body'] endif default_warning_flags += ['-Wno-unused-parameter', - '-Wno-format-security', - '-Wno-deprecated-declarations', - '-Wno-non-virtual-dtor'] + '-Wno-deprecated-declarations'] + + if get_option('enable-autodiff') or get_option('enable-directdiff') + default_warning_flags += ['-Wno-non-virtual-dtor'] + endif endif # meson script path @@ -236,4 +238,4 @@ if get_option('enable-mpp') export LD_LIBRARY_PATH=$SU2_HOME//subprojects/Mutationpp ''') -endif \ No newline at end of file +endif From f20d7908c8a56c31fa5124ec51ea1c77c9a4fe72 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 12:29:45 +0000 Subject: [PATCH 294/326] one more for metis --- externals/metis/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/externals/metis/meson.build b/externals/metis/meson.build index 932cb9c5a1fd..067e863847c7 100644 --- a/externals/metis/meson.build +++ b/externals/metis/meson.build @@ -15,6 +15,7 @@ if build_machine.system() != 'windows' '-Wno-empty-body', '-Wno-unused-label', '-Wno-misleading-indentation', + '-Wno-maybe-uninitialized', '-Wno-pedantic'] endif endif From daae8ffca05db2c6f528dad640d1edff48b41bf3 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 14:33:36 +0000 Subject: [PATCH 295/326] fix some warnings, replace exit with SU2_MPI::Error --- Common/src/CConfig.cpp | 4 +- SU2_CFD/include/sgs_model.inl | 28 ++++------- SU2_CFD/src/fluid/CNEMOGas.cpp | 49 +++++++++--------- SU2_CFD/src/fluid/CSU2TCLib.cpp | 41 ++++++++------- SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp | 15 +++--- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 3 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 28 ++--------- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 56 ++++++++------------- 8 files changed, 87 insertions(+), 137 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index b434a2f6edd2..03f5f48f22a8 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4142,9 +4142,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /* Check if the byte alignment of the matrix multiplications is a multiple of 64. */ if( byteAlignmentMatMul%64 ) { - if(rank == MASTER_NODE) - cout << "ALIGNED_BYTES_MATMUL must be a multiple of 64." << endl; - exit(EXIT_FAILURE); + SU2_MPI::Error("ALIGNED_BYTES_MATMUL must be a multiple of 64.", CURRENT_FUNCTION); } /* Determine the value of sizeMatMulPadding, which is the matrix size in diff --git a/SU2_CFD/include/sgs_model.inl b/SU2_CFD/include/sgs_model.inl index fb65720077a5..fbd2a27ced8b 100644 --- a/SU2_CFD/include/sgs_model.inl +++ b/SU2_CFD/include/sgs_model.inl @@ -6,7 +6,7 @@ * * SU2 Project Website: https://su2code.github.io * - * The SU2 Project is maintained by the SU2 Foundation + * The SU2 Project is maintained by the SU2 Foundation * (http://su2foundation.org) * * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) @@ -191,8 +191,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_2D(const su2double rho, const su2double distToWall, su2double &dMuTdx, su2double &dMuTdy) { - cout << "CSmagorinskyModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho, @@ -231,8 +230,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho, su2double &dMuTdx, su2double &dMuTdy, su2double &dMuTdz) { - cout << "CSmagorinskyModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } inline CWALEModel::CWALEModel(void) : CSGSModel() { @@ -363,8 +361,7 @@ inline void CWALEModel::ComputeGradEddyViscosity_2D(const su2double rho, const su2double distToWall, su2double &dMuTdx, su2double &dMuTdy) { - cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho, @@ -403,12 +400,11 @@ inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho, su2double &dMuTdx, su2double &dMuTdy, su2double &dMuTdz) { - cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } inline CVremanModel::CVremanModel(void) : CSGSModel() { - + /* const_Vreman = 2.5*Cs*Cs where Cs is the Smagorinsky constant */ const_Vreman = 0.07; } @@ -422,8 +418,8 @@ inline su2double CVremanModel::ComputeEddyViscosity_2D(const su2double rho, const su2double dvdy, const su2double lenScale, const su2double distToWall) { - cout << "CVremanModel::ComputeEddyViscosity_2D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); + return 0; } inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho, @@ -438,7 +434,7 @@ inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho, const su2double dwdz, const su2double lenScale, const su2double distToWall) { - + su2double alpha11 = dudx; su2double alpha22 = dvdy; su2double alpha33 = dwdz; @@ -495,8 +491,7 @@ inline void CVremanModel::ComputeGradEddyViscosity_2D(const su2double rho, const su2double distToWall, su2double &dMuTdx, su2double &dMuTdy) { - cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho, @@ -535,6 +530,5 @@ inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho, su2double &dMuTdx, su2double &dMuTdy, su2double &dMuTdz) { - cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl; - exit(1); + SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION); } diff --git a/SU2_CFD/src/fluid/CNEMOGas.cpp b/SU2_CFD/src/fluid/CNEMOGas.cpp index 8bc4f331a2f2..cfc21af63871 100644 --- a/SU2_CFD/src/fluid/CNEMOGas.cpp +++ b/SU2_CFD/src/fluid/CNEMOGas.cpp @@ -37,16 +37,16 @@ CNEMOGas::CNEMOGas(const CConfig* config, unsigned short val_nDim): CFluidModel( MolarMass.resize(nSpecies,0.0); MolarFractions.resize(nSpecies,0.0); rhos.resize(nSpecies,0.0); - Cvtrs.resize(nSpecies,0.0); - Cvves.resize(nSpecies,0.0); - eves.resize(nSpecies,0.0); - hs.resize(nSpecies,0.0); - ws.resize(nSpecies,0.0); + Cvtrs.resize(nSpecies,0.0); + Cvves.resize(nSpecies,0.0); + eves.resize(nSpecies,0.0); + hs.resize(nSpecies,0.0); + ws.resize(nSpecies,0.0); DiffusionCoeff.resize(nSpecies,0.0); Enthalpy_Formation.resize(nSpecies,0.0); Ref_Temperature.resize(nSpecies,0.0); temperatures.resize(nEnergyEq,0.0); - energies.resize(nEnergyEq,0.0); + energies.resize(nEnergyEq,0.0); ThermalConductivities.resize(nEnergyEq,0.0); gas_model = config->GetGasModel(); @@ -62,12 +62,12 @@ void CNEMOGas::SetTDStatePTTv(su2double val_pressure, const su2double *val_massf su2double denom; for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) - MassFrac[iSpecies] = val_massfrac[iSpecies]; - Pressure = val_pressure; - T = val_temperature; - Tve = val_temperature_ve; - - denom = 0.0; + MassFrac[iSpecies] = val_massfrac[iSpecies]; + Pressure = val_pressure; + T = val_temperature; + Tve = val_temperature_ve; + + denom = 0.0; /*--- Calculate mixture density from supplied primitive quantities ---*/ for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) @@ -79,7 +79,7 @@ void CNEMOGas::SetTDStatePTTv(su2double val_pressure, const su2double *val_massf for (iSpecies = 0; iSpecies < nSpecies; iSpecies++){ rhos[iSpecies] = MassFrac[iSpecies]*Density; MassFrac[iSpecies] = rhos[iSpecies]/Density; - } + } } su2double CNEMOGas::ComputeSoundSpeed(){ @@ -87,7 +87,7 @@ su2double CNEMOGas::ComputeSoundSpeed(){ su2double conc, rhoCvtr; conc = 0.0; - rhoCvtr = 0.0; + rhoCvtr = 0.0; Density = 0.0; auto& Cvtrs = GetSpeciesCvTraRot(); @@ -127,7 +127,7 @@ su2double CNEMOGas::ComputeGasConstant(){ for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) Mass += MassFrac[iSpecies] * MolarMass[iSpecies]; GasConstant = Ru / Mass; - + return GasConstant; } @@ -166,8 +166,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector& val_eves, su2double su2double CvtrBAR, rhoCvtr, rhoCvve, rho_el, sqvel, conc, ef; if (val_dPdU == NULL) { - cout << "ERROR: CNEMOGas - CalcdPdU - Array dPdU not allocated!" << endl; - exit(1); + SU2_MPI::Error("Array dPdU not allocated!", CURRENT_FUNCTION); } /*--- Determine the electron density (if ionized) ---*/ @@ -188,7 +187,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector& val_eves, su2double Cvtrs = GetSpeciesCvTraRot(); Enthalpy_Formation = GetSpeciesFormationEnthalpy(); Ref_Temperature = GetRefTemperature(); - + /*--- Rename for convenience ---*/ rhoCvtr = V[RHOCVTR_INDEX]; rhoCvve = V[RHOCVVE_INDEX]; @@ -241,7 +240,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector& val_eves, su2double /*--- Vib.-el energy derivative ---*/ val_dPdU[nSpecies+nDim+1] = -val_dPdU[nSpecies+nDim] + - rho_el*Ru/MolarMass[nSpecies-1]*1.0/rhoCvve; + rho_el*Ru/MolarMass[nSpecies-1]*1.0/rhoCvve; } @@ -273,9 +272,9 @@ void CNEMOGas::ComputedTdU(su2double *V, su2double *val_dTdU){ ef = Enthalpy_Formation[iSpecies] - Ru/MolarMass[iSpecies]*Ref_Temperature[iSpecies]; val_dTdU[iSpecies] = (-ef + 0.5*v2 + Cvtrs[iSpecies]*(Ref_Temperature[iSpecies]-T)) / rhoCvtr; } + if (ionization) { - cout << "CNEMOGas: NEED TO IMPLEMENT dTdU for IONIZED MIX" << endl; - exit(1); + SU2_MPI::Error("NEED TO IMPLEMENT dTdU for IONIZED MIX",CURRENT_FUNCTION); } /*--- Momentum derivatives ---*/ @@ -286,15 +285,15 @@ void CNEMOGas::ComputedTdU(su2double *V, su2double *val_dTdU){ val_dTdU[nSpecies+nDim] = 1.0 / V[RHOCVTR_INDEX]; val_dTdU[nSpecies+nDim+1] = -1.0 / V[RHOCVTR_INDEX]; -} +} void CNEMOGas::ComputedTvedU(su2double *V, vector& val_eves, su2double *val_dTvedU){ su2double rhoCvve; - /*--- Necessary indexes to assess primitive variables ---*/ + /*--- Necessary indexes to assess primitive variables ---*/ unsigned long RHOCVVE_INDEX = nSpecies+nDim+7; - + /*--- Rename for convenience ---*/ rhoCvve = V[RHOCVVE_INDEX]; @@ -308,7 +307,7 @@ void CNEMOGas::ComputedTvedU(su2double *V, vector& val_eves, su2doubl /*--- Energy derivatives ---*/ val_dTvedU[nSpecies+nDim] = 0.0; - val_dTvedU[nSpecies+nDim+1] = 1.0 / rhoCvve; + val_dTvedU[nSpecies+nDim+1] = 1.0 / rhoCvve; } diff --git a/SU2_CFD/src/fluid/CSU2TCLib.cpp b/SU2_CFD/src/fluid/CSU2TCLib.cpp index 5d51bcc360b1..f378101efe61 100644 --- a/SU2_CFD/src/fluid/CSU2TCLib.cpp +++ b/SU2_CFD/src/fluid/CSU2TCLib.cpp @@ -66,7 +66,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou if (mf != 1.0) { cout << "CONFIG ERROR: Intial gas mass fractions do not sum to 1!" << " mf is equal to "<< mf < 2N + M RxnConstantTable(0,0) = 3.4907; RxnConstantTable(0,1) = 0.83133; RxnConstantTable(0,2) = 4.0978; RxnConstantTable(0,3) = -12.728; RxnConstantTable(0,4) = 0.07487; //n = 1E14 @@ -1517,7 +1516,7 @@ void CSU2TCLib::GetChemistryEquilConstants(unsigned short iReaction){ RxnConstantTable(5,0) = -0.002428; RxnConstantTable(5,1) = -1.7415; RxnConstantTable(5,2) = -1.2331; RxnConstantTable(5,3) = -0.95365; RxnConstantTable(5,4) = -0.04585; } - } else if (gas_model == "AIR-7"){ + } else if (gas_model == "AIR-7"){ if (iReaction <= 6) { diff --git a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp index 5795d9a85324..853a14da47fb 100644 --- a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp +++ b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp @@ -55,7 +55,7 @@ CNEMONumerics::CNEMONumerics(unsigned short val_nDim, unsigned short val_nVar, EDDY_VISC_INDEX = nSpecies+nDim+9; /*--- Read from CConfig ---*/ - implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); ionization = config->GetIonization(); if (ionization) { nHeavy = nSpecies-1; nEl = 1; } @@ -69,7 +69,7 @@ CNEMONumerics::CNEMONumerics(unsigned short val_nDim, unsigned short val_nVar, #else SU2_MPI::Error(string("Mutation++ has not been configured/compiled. Add 1) '-Denable-mpp=true' to your meson string or 2) '-DHAVE_MPP' to the CXX FLAGS of your configure string, and recompile."), CURRENT_FUNCTION); - #endif + #endif break; case SU2_NONEQ: fluidmodel = new CSU2TCLib(config, nDim, false); @@ -163,7 +163,7 @@ void CNEMONumerics::GetInviscidProjJac(const su2double *val_U, const su2doubl const su2double *rhos; rhos = &val_V[RHOS_INDEX]; - + /*--- Initialize the Jacobian tensor ---*/ for (iVar = 0; iVar < nVar; iVar++) for (jVar = 0; jVar < nVar; jVar++) @@ -265,7 +265,7 @@ void CNEMONumerics::GetViscousProjFlux(su2double *val_primvar, Ru = 1000.0*RuSI; hs = fluidmodel->ComputeSpeciesEnthalpy(T, Tve, val_eve); - + /*--- Scale thermal conductivity with turb visc ---*/ // TODO: Need to determine proper way to incorporate eddy viscosity // This is only scaling Kve by same factor as ktr @@ -295,13 +295,12 @@ void CNEMONumerics::GetViscousProjFlux(su2double *val_primvar, /*--- Populate entries in the viscous flux vector ---*/ for (iDim = 0; iDim < nDim; iDim++) { /*--- Species diffusion velocity ---*/ - for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) { Flux_Tensor[iSpecies][iDim] = rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][iDim] - V[RHOS_INDEX+iSpecies]*Vector[iDim]; } if (ionization) { - cout << "GetViscProjFlux -- NEED TO IMPLEMENT IONIZED FUNCTIONALITY!!!" << endl; - exit(1); + SU2_MPI::Error("NEED TO IMPLEMENT IONIZED FUNCTIONALITY!!!",CURRENT_FUNCTION); } /*--- Shear stress related terms ---*/ @@ -708,7 +707,7 @@ void CNEMONumerics::GetPMatrix(const su2double *U, const su2double *V, const su2 val_p_tensor[nSpecies+iDim][nSpecies+1] = m[iDim]; val_p_tensor[nSpecies+iDim][nSpecies+2] = (V[VEL_INDEX+iDim]+a*val_normal[iDim]) / (2.0*a2); val_p_tensor[nSpecies+iDim][nSpecies+3] = (V[VEL_INDEX+iDim]-a*val_normal[iDim]) / (2.0*a2); - val_p_tensor[nSpecies+iDim][nSpecies+4] = 0.0; + val_p_tensor[nSpecies+iDim][nSpecies+4] = 0.0; } val_p_tensor[nSpecies+3][nSpecies] = vV; diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 694cb88bc4d6..245318ff48bd 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1749,8 +1749,7 @@ void CFEM_DG_EulerSolver::MetaDataJacobianComputation(const CMeshFEM *FEMGeom for(int j=0; j= nDOFsLocOwned) { - cout << "This DOF should be owned, but it is not. This should not happen." << endl; - exit(1); + SU2_MPI::Error("This DOF should be owned, but it is not. This should not happen.",CURRENT_FUNCTION); } sendReturnBuf[i][j] = colorLocalDOFs[jj]; } diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 66f981d61268..11a54fceb2dc 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -312,15 +312,9 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * for (iDim = 0; iDim < nDim; iDim++) Coord[iDim] = 0.0; - int rank = MASTER_NODE; -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif - int counter = 0; long iPoint_Local = 0; unsigned long iPoint_Global = 0; unsigned long iPoint_Global_Local = 0; - unsigned short rbuf_NotMatching = 0, sbuf_NotMatching = 0; /*--- Skip coordinates ---*/ @@ -376,25 +370,9 @@ void CHeatSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * /*--- Detect a wrong solution file ---*/ - if (iPoint_Global_Local < nPointDomain) { sbuf_NotMatching = 1; } - -#ifndef HAVE_MPI - rbuf_NotMatching = sbuf_NotMatching; -#else - SU2_MPI::Allreduce(&sbuf_NotMatching, &rbuf_NotMatching, 1, MPI_UNSIGNED_SHORT, MPI_SUM, SU2_MPI::GetComm()); -#endif - if (rbuf_NotMatching != 0) { - if (rank == MASTER_NODE) { - cout << endl << "The solution file " << restart_filename.data() << " doesn't match with the mesh file!" << endl; - cout << "It could be empty lines at the end of the file." << endl << endl; - } -#ifndef HAVE_MPI - exit(EXIT_FAILURE); -#else - MPI_Barrier(SU2_MPI::GetComm()); - MPI_Abort(SU2_MPI::GetComm(),1); - MPI_Finalize(); -#endif + if (iPoint_Global_Local != nPointDomain) { + SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + + string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); } /*--- Communicate the loaded solution on the fine grid before we transfer diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 6a0bf19e7064..a19f92c09fed 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -537,8 +537,7 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, } if (catalytic) { - cout << "NEED TO IMPLEMENT CATALYTIC BOUNDARIES IN HEATFLUX!!!" << endl; - exit(1); + SU2_MPI::Error("NEED TO IMPLEMENT CATALYTIC BOUNDARIES IN HEATFLUX!!!",CURRENT_FUNCTION); } else { @@ -674,8 +673,7 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, bool ionization = config->GetIonization(); if (ionization) { - cout << "BC_ISOTHERMAL: NEED TO TAKE A CLOSER LOOK AT THE JACOBIAN W/ IONIZATION" << endl; - exit(1); + SU2_MPI::Error("NEED TO TAKE A CLOSER LOOK AT THE JACOBIAN W/ IONIZATION",CURRENT_FUNCTION); } /*--- Extract required indices ---*/ @@ -982,36 +980,33 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, CConfig *config, unsigned short val_marker) { - - unsigned short iDim, jDim, iVar, iSpecies; + unsigned short iDim, iVar, iSpecies; unsigned short T_INDEX, TVE_INDEX, VEL_INDEX; unsigned long iVertex, iPoint, jPoint; su2double ktr, kve, Mass = 0.0; su2double Ti, Tvei, Tj, Tvej; su2double Twall, Tslip, Tslip_ve, dij; su2double Pi; - su2double Area, *Normal, UnitNormal[3]; - su2double *Coord_i, *Coord_j; + su2double Area, UnitNormal[MAXNDIM]; su2double C, alpha_V, alpha_T; su2double TMAC, TAC; su2double Viscosity, Eddy_Visc, Lambda; su2double Density, GasConstant; - su2double **Grad_PrimVar; - su2double Vector_Tangent_dT[3], Vector_Tangent_dTve[3], Vector_Tangent_HF[3]; + const su2double* const* Grad_PrimVar; + su2double Vector_Tangent_dT[MAXNDIM] = {0.0}, Vector_Tangent_dTve[MAXNDIM] = {0.0}, Vector_Tangent_HF[MAXNDIM] = {0.0}; su2double dTn, dTven; su2double rhoCvtr, rhoCvve; - su2double TauElem[3], TauTangent[3]; - su2double Tau[3][3]; + su2double TauElem[MAXNDIM] = {0.0}, TauTangent[MAXNDIM] = {0.0}; + su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; su2double TauNormal; bool ionization = config->GetIonization(); if (ionization) { - cout << "BC_SMOLUCHOWSKI_MAXWELL: NEED TO TAKE A CLOSER LOOK AT THE JACOBIAN W/ IONIZATION" << endl; - exit(1); + SU2_MPI::Error("NEED TO TAKE A CLOSER LOOK AT THE JACOBIAN W/ IONIZATION", CURRENT_FUNCTION); } /*--- Define 'proportional control' constant ---*/ @@ -1041,7 +1036,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, if (geometry->nodes->GetDomain(iPoint)) { /*--- Compute dual-grid area and boundary normal ---*/ - Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); + const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); Area = GeometryToolbox::Norm(nDim, Normal); for (iDim = 0; iDim < nDim; iDim++) @@ -1051,13 +1046,10 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, jPoint = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); /*--- Compute distance between wall & normal neighbor ---*/ - Coord_i = geometry->nodes->GetCoord(iPoint); - Coord_j = geometry->nodes->GetCoord(jPoint); + const auto Coord_i = geometry->nodes->GetCoord(iPoint); + const auto Coord_j = geometry->nodes->GetCoord(jPoint); - dij = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - dij += (Coord_j[iDim] - Coord_i[iDim])*(Coord_j[iDim] - Coord_i[iDim]); - dij = sqrt(dij); + dij = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); /*--- Calculate Pressure ---*/ Pi = nodes->GetPressure(iPoint); @@ -1083,7 +1075,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, Gamma = nodes->GetGamma(iPoint); /*--- Incorporate turbulence effects ---*/ - auto& Ms = FluidModel->GetSpeciesMolarMass(); + const auto& Ms = FluidModel->GetSpeciesMolarMass(); su2double Ru = 1000.0*UNIVERSAL_GAS_CONSTANT; su2double tmp1, scl, Cptr; su2double *Vi = nodes->GetPrimitive(iPoint); @@ -1106,11 +1098,8 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, GasConstant+=UNIVERSAL_GAS_CONSTANT*1000.0/Ms[iSpecies]*nodes->GetMassFraction(iPoint,iSpecies); /*--- Calculate temperature gradients normal to surface---*/ //Doubt about minus sign - dTn = 0.0; dTven = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - dTn += Grad_PrimVar[T_INDEX][iDim]*UnitNormal[iDim]; - dTven += Grad_PrimVar[TVE_INDEX][iDim]*UnitNormal[iDim]; - } + dTn = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[T_INDEX], UnitNormal); + dTven = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[TVE_INDEX], UnitNormal); /*--- Calculate molecular mean free path ---*/ Lambda = Viscosity/Density*sqrt(PI_NUMBER/(2.0*GasConstant*Ti)); @@ -1136,19 +1125,14 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, Res_Visc[iVar] = 0.0; CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - TauElem[iDim] = 0.0; - for (jDim = 0; jDim < nDim; jDim++) - TauElem[iDim] += Tau[iDim][jDim]*UnitNormal[jDim]; - } + for (iDim = 0; iDim < nDim; iDim++) + TauElem[iDim] = GeometryToolbox::DotProduct(nDim, Tau[iDim], UnitNormal); /*--- Compute wall shear stress (using the stress tensor) ---*/ - TauNormal = 0.0; + TauNormal = GeometryToolbox::DotProduct(nDim, TauElem, UnitNormal); + for (iDim = 0; iDim < nDim; iDim++) - TauNormal += TauElem[iDim] * UnitNormal[iDim]; - for (iDim = 0; iDim < nDim; iDim++) { TauTangent[iDim] = TauElem[iDim] - TauNormal * UnitNormal[iDim]; - } /*--- Store the Slip Velocity at the wall */ for (iDim = 0; iDim < nDim; iDim++) From 9adacff075b43152d486aa5d9c84ebab5e5428a0 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 15:13:50 +0000 Subject: [PATCH 296/326] fewer bare pointers in flow solver base --- .../include/solvers/CFVMFlowSolverBase.hpp | 54 +++--- .../include/solvers/CFVMFlowSolverBase.inl | 162 +++--------------- SU2_CFD/include/solvers/CSolver.hpp | 2 +- 3 files changed, 49 insertions(+), 169 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 131ade3eda69..9ed96fdffbec 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -137,28 +137,28 @@ class CFVMFlowSolverBase : public CSolver { su2double Total_Heat = 0.0; /*!< \brief Total heat load for all the boundaries. */ su2double Total_MaxHeat = 0.0; /*!< \brief Maximum heat flux on all boundaries. */ su2double AllBound_CNearFieldOF_Inv = 0.0; /*!< \brief Near-Field press coeff (inviscid) for all the boundaries. */ - su2double* CNearFieldOF_Inv = nullptr; /*!< \brief Near field pressure (inviscid) for each boundary. */ - su2double* Surface_HF_Visc = nullptr; /*!< \brief Total (integrated) heat flux for each monitored surface. */ - su2double* Surface_MaxHF_Visc = nullptr; /*!< \brief Maximum heat flux for each monitored surface. */ - su2double* HF_Visc = nullptr; /*!< \brief Heat load (viscous contribution) for each boundary. */ - su2double* MaxHF_Visc = nullptr; /*!< \brief Maximum heat flux (viscous contribution) for each boundary. */ - su2double AllBound_HF_Visc = 0.0; /*!< \brief Heat load (viscous contribution) for all the boundaries. */ - su2double AllBound_MaxHF_Visc = 0.0; /*!< \brief Maximum heat flux (viscous contribution) for all boundaries. */ - - su2double** Inlet_Ptotal = nullptr; /*!< \brief Value of the Total P. */ - su2double** Inlet_Ttotal = nullptr; /*!< \brief Value of the Total T. */ - su2double*** Inlet_FlowDir = nullptr; /*!< \brief Value of the Flow Direction. */ - su2double** HeatFlux = nullptr; /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - su2double** HeatFluxTarget = nullptr; /*!< \brief Heat transfer coefficient for each boundary and vertex. */ - su2double*** CharacPrimVar = nullptr; /*!< \brief Value of the characteristic variables at each boundary. */ - su2double*** CSkinFriction = nullptr; /*!< \brief Skin friction coefficient for each boundary and vertex. */ - su2double** WallShearStress = nullptr; /*!< \brief Wall Shear Stress for each boundary and vertex. */ - su2double*** HeatConjugateVar = nullptr; /*!< \brief CHT variables for each boundary and vertex. */ - su2double** CPressure = nullptr; /*!< \brief Pressure coefficient for each boundary and vertex. */ - su2double** CPressureTarget = nullptr; /*!< \brief Target Pressure coefficient for each boundary and vertex. */ - su2double** YPlus = nullptr; /*!< \brief Yplus for each boundary and vertex. */ - - bool space_centered; /*!< \brief True if space centered scheeme used. */ + vector CNearFieldOF_Inv; /*!< \brief Near field pressure (inviscid) for each boundary. */ + vector Surface_HF_Visc; /*!< \brief Total (integrated) heat flux for each monitored surface. */ + vector Surface_MaxHF_Visc; /*!< \brief Maximum heat flux for each monitored surface. */ + vector HF_Visc; /*!< \brief Heat load (viscous contribution) for each boundary. */ + vector MaxHF_Visc; /*!< \brief Maximum heat flux (viscous contribution) for each boundary. */ + su2double AllBound_HF_Visc = 0.0; /*!< \brief Heat load (viscous contribution) for all the boundaries. */ + su2double AllBound_MaxHF_Visc = 0.0; /*!< \brief Maximum heat flux (viscous contribution) for all boundaries. */ + + vector > Inlet_Ptotal; /*!< \brief Value of the Total P. */ + vector > Inlet_Ttotal; /*!< \brief Value of the Total T. */ + vector Inlet_FlowDir; /*!< \brief Value of the Flow Direction. */ + vector > HeatFlux; /*!< \brief Heat transfer coefficient for each boundary and vertex. */ + vector > HeatFluxTarget; /*!< \brief Heat transfer coefficient for each boundary and vertex. */ + vector CharacPrimVar; /*!< \brief Value of the characteristic variables at each boundary. */ + vector CSkinFriction; /*!< \brief Skin friction coefficient for each boundary and vertex. */ + vector > WallShearStress; /*!< \brief Wall Shear Stress for each boundary and vertex. */ + vector HeatConjugateVar; /*!< \brief CHT variables for each boundary and vertex. */ + vector > CPressure; /*!< \brief Pressure coefficient for each boundary and vertex. */ + vector > CPressureTarget; /*!< \brief Target Pressure coefficient for each boundary and vertex. */ + vector > YPlus; /*!< \brief Yplus for each boundary and vertex. */ + + bool space_centered; /*!< \brief True if space centered scheme used. */ bool euler_implicit; /*!< \brief True if euler implicit scheme used. */ bool least_squares; /*!< \brief True if computing gradients by least squares. */ su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ @@ -167,7 +167,7 @@ class CFVMFlowSolverBase : public CSolver { /*--- Sliding meshes variables ---*/ su2double**** SlidingState = nullptr; - int** SlidingStateNodes = nullptr; + vector > SlidingStateNodes; /*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/ @@ -2193,7 +2193,7 @@ class CFVMFlowSolverBase : public CSolver { * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. * \return Value of the pressure coefficient. */ - inline su2double* GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) const final { + inline su2double* GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) final { return CharacPrimVar[val_marker][val_vertex]; } @@ -2251,8 +2251,6 @@ class CFVMFlowSolverBase : public CSolver { * checking to prevent segmentation faults ---*/ if (val_marker >= nMarker) SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_Ttotal == nullptr || Inlet_Ttotal[val_marker] == nullptr) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); else if (val_vertex >= nVertex[val_marker]) SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); else @@ -2270,8 +2268,6 @@ class CFVMFlowSolverBase : public CSolver { * checking to prevent segmentation faults ---*/ if (val_marker >= nMarker) SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_Ptotal == nullptr || Inlet_Ptotal[val_marker] == nullptr) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); else if (val_vertex >= nVertex[val_marker]) SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); else @@ -2291,8 +2287,6 @@ class CFVMFlowSolverBase : public CSolver { * checking to prevent segmentation faults ---*/ if (val_marker >= nMarker) SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_FlowDir == nullptr || Inlet_FlowDir[val_marker] == nullptr) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); else if (val_vertex >= nVertex[val_marker]) SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); else diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 865b6b216a02..848ed2b90ef7 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -84,8 +84,8 @@ void CFVMFlowSolverBase::AeroCoeffsArray::setZero(int i) { template void CFVMFlowSolverBase::Allocate(const CConfig& config) { - unsigned short iDim, iVar, iMarker; - unsigned long iPoint, iVertex; + unsigned short iVar; + unsigned long iPoint, iMarker; /*--- Define some auxiliar vector related with the residual ---*/ @@ -116,19 +116,16 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { /*--- Allocates a 2D array with variable "outer" sizes and init to 0. ---*/ - auto Alloc2D = [](unsigned long M, const unsigned long* N, su2double**& X) { - X = new su2double*[M]; - for (unsigned long i = 0; i < M; ++i) X[i] = new su2double[N[i]](); + auto Alloc2D = [](unsigned long M, const unsigned long* N, vector >& X) { + X.resize(M); + for (unsigned long i = 0; i < M; ++i) X[i].resize(N[i],0.0); }; /*--- Allocates a 3D array with variable "middle" sizes and init to 0. ---*/ - auto Alloc3D = [](unsigned long M, const unsigned long* N, unsigned long P, su2double***& X) { - X = new su2double**[M]; - for (unsigned long i = 0; i < M; ++i) { - X[i] = new su2double*[N[i]]; - for (unsigned long j = 0; j < N[i]; ++j) X[i][j] = new su2double[P](); - } + auto Alloc3D = [](unsigned long M, const unsigned long* N, unsigned long P, vector& X) { + X.resize(M); + for (unsigned long i = 0; i < M; ++i) X[i].resize(N[i],P) = su2double(0.0); }; /*--- Store the value of the characteristic primitive variables at the boundaries ---*/ @@ -164,25 +161,25 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { /*--- Heat flux coefficients. ---*/ - HF_Visc = new su2double[nMarker]; - MaxHF_Visc = new su2double[nMarker]; + HF_Visc.resize(nMarker,0.0); + MaxHF_Visc.resize(nMarker,0.0); - Surface_HF_Visc = new su2double[config.GetnMarker_Monitoring()]; - Surface_MaxHF_Visc = new su2double[config.GetnMarker_Monitoring()]; + Surface_HF_Visc.resize(config.GetnMarker_Monitoring()); + Surface_MaxHF_Visc.resize(config.GetnMarker_Monitoring()); /*--- Supersonic coefficients ---*/ - CNearFieldOF_Inv = new su2double[nMarker]; + CNearFieldOF_Inv.resize(nMarker,0.0); /*--- Initializate quantities for SlidingMesh Interface ---*/ SlidingState = new su2double***[nMarker](); - SlidingStateNodes = new int*[nMarker](); + SlidingStateNodes.resize(nMarker); for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config.GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { SlidingState[iMarker] = new su2double**[nVertex[iMarker]](); - SlidingStateNodes[iMarker] = new int[nVertex[iMarker]](); + SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); for (iPoint = 0; iPoint < nVertex[iMarker]; iPoint++) SlidingState[iMarker][iPoint] = new su2double*[nPrimVar + 1](); @@ -200,13 +197,9 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { /*--- Skin friction in all the markers ---*/ - CSkinFriction = new su2double**[nMarker]; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - CSkinFriction[iMarker] = new su2double*[nDim]; - for (iDim = 0; iDim < nDim; iDim++) { - CSkinFriction[iMarker][iDim] = new su2double[nVertex[iMarker]](); - } - } + CSkinFriction.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) + CSkinFriction[iMarker].resize(nDim, nVertex[iMarker]) = su2double(0.0); /*--- Wall Shear Stress in all the markers ---*/ @@ -216,14 +209,8 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { used for coupling with a solid donor cell ---*/ constexpr auto nHeatConjugateVar = 4u; - HeatConjugateVar = new su2double**[nMarker]; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - HeatConjugateVar[iMarker] = new su2double*[nVertex[iMarker]]; - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - HeatConjugateVar[iMarker][iVertex] = new su2double[nHeatConjugateVar](); - HeatConjugateVar[iMarker][iVertex][0] = config.GetTemperature_FreeStreamND(); - } - } + Alloc3D(nMarker, nVertex, nHeatConjugateVar, HeatConjugateVar); + for (auto& x : HeatConjugateVar) x = config.GetTemperature_FreeStreamND(); if (MGLevel == MESH_0) { VertexTraction.resize(nMarker); @@ -385,14 +372,8 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi template CFVMFlowSolverBase::~CFVMFlowSolverBase() { - unsigned short iMarker, iVar, iDim; - unsigned long iVertex; - - delete[] CNearFieldOF_Inv; - delete[] HF_Visc; - delete[] MaxHF_Visc; - delete[] Surface_HF_Visc; - delete[] Surface_MaxHF_Visc; + unsigned short iVar; + unsigned long iMarker, iVertex; if (SlidingState != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) { @@ -408,101 +389,6 @@ CFVMFlowSolverBase::~CFVMFlowSolverBase() { delete[] SlidingState; } - if (SlidingStateNodes != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (SlidingStateNodes[iMarker] != nullptr) delete[] SlidingStateNodes[iMarker]; - } - delete[] SlidingStateNodes; - } - - if (CPressure != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) delete[] CPressure[iMarker]; - delete[] CPressure; - } - - if (CPressureTarget != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) delete[] CPressureTarget[iMarker]; - delete[] CPressureTarget; - } - - if (CharacPrimVar != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) delete[] CharacPrimVar[iMarker][iVertex]; - delete[] CharacPrimVar[iMarker]; - } - delete[] CharacPrimVar; - } - - if (Inlet_Ttotal != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Inlet_Ttotal[iMarker] != nullptr) delete[] Inlet_Ttotal[iMarker]; - delete[] Inlet_Ttotal; - } - - if (Inlet_Ptotal != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Inlet_Ptotal[iMarker] != nullptr) delete[] Inlet_Ptotal[iMarker]; - delete[] Inlet_Ptotal; - } - - if (Inlet_FlowDir != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (Inlet_FlowDir[iMarker] != nullptr) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) delete[] Inlet_FlowDir[iMarker][iVertex]; - delete[] Inlet_FlowDir[iMarker]; - } - } - delete[] Inlet_FlowDir; - } - - if (HeatFlux != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - delete[] HeatFlux[iMarker]; - } - delete[] HeatFlux; - } - - if (HeatFluxTarget != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - delete[] HeatFluxTarget[iMarker]; - } - delete[] HeatFluxTarget; - } - - if (YPlus != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - delete[] YPlus[iMarker]; - } - delete[] YPlus; - } - - if (CSkinFriction != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iDim = 0; iDim < nDim; iDim++) { - delete[] CSkinFriction[iMarker][iDim]; - } - delete[] CSkinFriction[iMarker]; - } - delete[] CSkinFriction; - } - - if (WallShearStress != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - delete[] WallShearStress[iMarker]; - } - delete[] WallShearStress; - } - - if (HeatConjugateVar != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - delete[] HeatConjugateVar[iMarker][iVertex]; - } - delete[] HeatConjugateVar[iMarker]; - } - delete[] HeatConjugateVar; - } - delete nodes; delete edgeNumerics; } @@ -2890,8 +2776,8 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr Allreduce_inplace(nMarkerMon, SurfaceViscCoeff.CMy); Allreduce_inplace(nMarkerMon, SurfaceViscCoeff.CMz); - Allreduce_inplace(nMarkerMon, Surface_HF_Visc); - Allreduce_inplace(nMarkerMon, Surface_MaxHF_Visc); + Allreduce_inplace(nMarkerMon, Surface_HF_Visc.data()); + Allreduce_inplace(nMarkerMon, Surface_MaxHF_Visc.data()); delete[] buffer; } diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index e8d108e6d218..1cd5ae9f2278 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -2976,7 +2976,7 @@ class CSolver { * \return Value of the pressure coefficient. */ inline virtual su2double *GetCharacPrimVar(unsigned short val_marker, - unsigned long val_vertex) const { return nullptr; } + unsigned long val_vertex) { return nullptr; } /*! * \brief A virtual member From 450286124c846bee7a29a7074f4fd009ab029f31 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 15:34:44 +0000 Subject: [PATCH 297/326] fix tecplot writer --- SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp | 2 +- SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 9ed96fdffbec..eb20d2f28f81 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -180,7 +180,7 @@ class CFVMFlowSolverBase : public CSolver { static constexpr bool ReducerStrategy = false; #endif - /*--- Edge fluxes, for OpenMP parallelization off difficult-to-color grids. + /*--- Edge fluxes, for OpenMP parallelization of difficult-to-color grids. * We first store the fluxes and then compute the sum for each cell. * This strategy is thread-safe but lower performance than writting to both * end points of each edge, so we only use it when necessary, i.e. when the diff --git a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp index 6b745f026a9d..63824a1c7e2b 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp @@ -55,14 +55,13 @@ void CTecplotBinaryFileWriter::Write_Data(){ /*--- Reduce the total number of each element. ---*/ - unsigned long nParallel_Line = dataSorter->GetnElem(LINE), - nParallel_Tria = dataSorter->GetnElem(TRIANGLE), + unsigned long nParallel_Tria = dataSorter->GetnElem(TRIANGLE), nParallel_Quad = dataSorter->GetnElem(QUADRILATERAL), nParallel_Tetr = dataSorter->GetnElem(TETRAHEDRON), nParallel_Hexa = dataSorter->GetnElem(HEXAHEDRON), nParallel_Pris = dataSorter->GetnElem(PRISM), nParallel_Pyra = dataSorter->GetnElem(PYRAMID); - + unsigned long nTot_Line = dataSorter->GetnElemGlobal(LINE), nTot_Tria = dataSorter->GetnElemGlobal(TRIANGLE), nTot_Quad = dataSorter->GetnElemGlobal(QUADRILATERAL), @@ -135,6 +134,8 @@ void CTecplotBinaryFileWriter::Write_Data(){ #ifdef HAVE_MPI + unsigned long nParallel_Line = dataSorter->GetnElem(LINE); + unsigned short iVar; NodePartitioner node_partitioner(num_nodes, size); std::set halo_nodes; From 8642dcdde4bb0fcffa0817eb1c4ce65b381ca065 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 18:53:19 +0000 Subject: [PATCH 298/326] no more pointer, except all the turbo stuff --- .../numerics_simd/flow/diffusion/common.hpp | 4 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 44 ++++--- .../include/solvers/CFVMFlowSolverBase.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.inl | 25 +--- SU2_CFD/include/solvers/CNEMONSSolver.hpp | 7 +- SU2_CFD/include/solvers/CNSSolver.hpp | 12 +- SU2_CFD/include/solvers/CTurbSASolver.hpp | 4 +- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSolver.hpp | 10 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 110 ++++-------------- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 16 +-- SU2_CFD/src/solvers/CNSSolver.cpp | 46 +------- SU2_CFD/src/solvers/CTurbSASolver.cpp | 61 ++-------- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 64 +++------- SU2_CFD/src/solvers/CTurbSolver.cpp | 12 +- 15 files changed, 95 insertions(+), 324 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index accad7706507..a519cf28f94a 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -71,7 +71,7 @@ FORCEINLINE void correctGradient(const PrimitiveType& V, */ template FORCEINLINE MatrixDbl stressTensor(Double viscosity, - const MatrixDbl grad) { + const MatrixDbl& grad) { /*--- Hydrostatic term. ---*/ Double velDiv = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { @@ -154,7 +154,7 @@ FORCEINLINE void addQCR(const MatrixType& grad, MatrixDbl& tau) { */ template FORCEINLINE MatrixDbl stressTensorJacobian(const PrimitiveType& V, - const VectorDbl normal, + const VectorDbl& normal, Double dist_ij) { Double viscosity = V.laminarVisc() + V.eddyVisc(); Double xi = viscosity / (V.density() * dist_ij); diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 22857bc2a5f7..3467c25df400 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -43,42 +43,38 @@ class CEulerSolver : public CFVMFlowSolverBase { Prandtl_Lam = 0.0, /*!< \brief Laminar Prandtl number. */ Prandtl_Turb = 0.0; /*!< \brief Turbulent Prandtl number. */ + su2double AllBound_CEquivArea_Inv=0.0; /*!< \brief equivalent area coefficient (inviscid contribution) for all the boundaries. */ + vector CEquivArea_Mnt; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ + vector CEquivArea_Inv; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ + + vector Inflow_MassFlow; /*!< \brief Mass flow rate for each boundary. */ + vector Exhaust_MassFlow; /*!< \brief Mass flow rate for each boundary. */ + vector Inflow_Pressure; /*!< \brief Fan face pressure for each boundary. */ + vector Inflow_Mach; /*!< \brief Fan face mach number for each boundary. */ + vector Inflow_Area; /*!< \brief Boundary total area. */ + vector Exhaust_Area; /*!< \brief Boundary total area. */ + vector Exhaust_Pressure; /*!< \brief Fan face pressure for each boundary. */ + vector Exhaust_Temperature; /*!< \brief Fan face mach number for each boundary. */ su2double - AllBound_CEquivArea_Inv = 0.0, /*!< \brief equivalent area coefficient (inviscid contribution) for all the boundaries. */ - *CEquivArea_Mnt = nullptr, /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ - *CEquivArea_Inv = nullptr; /*!< \brief Equivalent area (inviscid contribution) for each boundary. */ - - su2double - *Inflow_MassFlow = nullptr, /*!< \brief Mass flow rate for each boundary. */ - *Exhaust_MassFlow = nullptr, /*!< \brief Mass flow rate for each boundary. */ - *Inflow_Pressure = nullptr, /*!< \brief Fan face pressure for each boundary. */ - *Inflow_Mach = nullptr, /*!< \brief Fan face mach number for each boundary. */ - *Inflow_Area = nullptr, /*!< \brief Boundary total area. */ - *Exhaust_Area = nullptr, /*!< \brief Boundary total area. */ - *Exhaust_Pressure = nullptr, /*!< \brief Fan face pressure for each boundary. */ - *Exhaust_Temperature = nullptr,/*!< \brief Fan face mach number for each boundary. */ Inflow_MassFlow_Total = 0.0, /*!< \brief Mass flow rate for each boundary. */ Exhaust_MassFlow_Total = 0.0, /*!< \brief Mass flow rate for each boundary. */ Inflow_Pressure_Total = 0.0, /*!< \brief Fan face pressure for each boundary. */ Inflow_Mach_Total = 0.0, /*!< \brief Fan face mach number for each boundary. */ InverseDesign = 0.0; /*!< \brief Inverse design functional for each boundary. */ - unsigned long - **DonorGlobalIndex = nullptr; /*!< \brief Value of the donor global index. */ - su2double - ***DonorPrimVar = nullptr, /*!< \brief Value of the donor variables at each boundary. */ - **ActDisk_DeltaP = nullptr, /*!< \brief Value of the Delta P. */ - **ActDisk_DeltaT = nullptr; /*!< \brief Value of the Delta T. */ + vector > DonorGlobalIndex; /*!< \brief Value of the donor global index. */ + vector DonorPrimVar; /*!< \brief Value of the donor variables at each boundary. */ + vector > ActDisk_DeltaP; /*!< \brief Value of the Delta P. */ + vector > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ su2activevector ActDisk_R; /*!< \brief Value of the actuator disk Radius. */ su2activematrix ActDisk_C, /*!< \brief Value of the actuator disk Center. */ ActDisk_Axis; /*!< \brief Value of the actuator disk Axis. */ - su2double - **ActDisk_Fa, /*!< \brief Value of the actuator disk Axial Force per Unit Area. */ - **ActDisk_Fx, /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ - **ActDisk_Fy, /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ - **ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fa; /*!< \brief Value of the actuator disk Axial Force per Unit Area. */ + vector > ActDisk_Fx; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fy; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ su2double Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index eb20d2f28f81..a1bf84a6f4bb 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -166,7 +166,7 @@ class CFVMFlowSolverBase : public CSolver { /*--- Sliding meshes variables ---*/ - su2double**** SlidingState = nullptr; + vector > SlidingState; // vector of matrix of pointers... inner dim alloc'd elsewhere (welcome, to the twilight zone) vector > SlidingStateNodes; /*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 848ed2b90ef7..d2a63439808a 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -85,7 +85,7 @@ void CFVMFlowSolverBase::AeroCoeffsArray::setZero(int i) { template void CFVMFlowSolverBase::Allocate(const CConfig& config) { unsigned short iVar; - unsigned long iPoint, iMarker; + unsigned long iMarker; /*--- Define some auxiliar vector related with the residual ---*/ @@ -173,16 +173,13 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { /*--- Initializate quantities for SlidingMesh Interface ---*/ - SlidingState = new su2double***[nMarker](); + SlidingState.resize(nMarker); SlidingStateNodes.resize(nMarker); for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config.GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { - SlidingState[iMarker] = new su2double**[nVertex[iMarker]](); + SlidingState[iMarker].resize(nVertex[iMarker], nPrimVar+1) = nullptr; SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); - - for (iPoint = 0; iPoint < nVertex[iMarker]; iPoint++) - SlidingState[iMarker][iPoint] = new su2double*[nPrimVar + 1](); } } @@ -372,21 +369,9 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi template CFVMFlowSolverBase::~CFVMFlowSolverBase() { - unsigned short iVar; - unsigned long iMarker, iVertex; - if (SlidingState != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (SlidingState[iMarker] != nullptr) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - if (SlidingState[iMarker][iVertex] != nullptr) { - for (iVar = 0; iVar < nPrimVar + 1; iVar++) delete[] SlidingState[iMarker][iVertex][iVar]; - delete[] SlidingState[iMarker][iVertex]; - } - delete[] SlidingState[iMarker]; - } - } - delete[] SlidingState; + for (auto& mat : SlidingState) { + for (auto ptr : mat) delete [] ptr; } delete nodes; diff --git a/SU2_CFD/include/solvers/CNEMONSSolver.hpp b/SU2_CFD/include/solvers/CNEMONSSolver.hpp index d06fcad1cf4d..7e9acf02f546 100644 --- a/SU2_CFD/include/solvers/CNEMONSSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMONSSolver.hpp @@ -38,7 +38,6 @@ * \brief Main class for defining the NEMO Navier-Stokes flow solver. * \ingroup Navier_Stokes_Equations * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.0.8 * */ class CNEMONSSolver final : public CNEMOEulerSolver { @@ -46,10 +45,6 @@ class CNEMONSSolver final : public CNEMOEulerSolver { su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number. */ Prandtl_Turb; /*!< \brief Turbulent Prandtl number. */ - - su2double StrainMag_Max, - Omega_Max; /*!< \brief Maximum Strain Rate magnitude and Omega. */ - su2double *primitives_aux; /*!< \brief Primitive auxiliary variables (Y_s, T, Tve, ...) in compressible flows. */ /*! * \brief Compute the velocity^2, SoundSpeed, Pressure, Enthalpy, Viscosity. @@ -77,7 +72,7 @@ class CNEMONSSolver final : public CNEMOEulerSolver { /*! * \brief Destructor of the class. */ - ~CNEMONSSolver(void) override; + ~CNEMONSSolver() = default; /*! * \brief Compute the gradient of the primitive variables using Green-Gauss method, diff --git a/SU2_CFD/include/solvers/CNSSolver.hpp b/SU2_CFD/include/solvers/CNSSolver.hpp index 0b1a75e2d0be..99260e34f2c1 100644 --- a/SU2_CFD/include/solvers/CNSSolver.hpp +++ b/SU2_CFD/include/solvers/CNSSolver.hpp @@ -37,11 +37,11 @@ */ class CNSSolver final : public CEulerSolver { private: - su2double - *Surface_Buffet_Metric = nullptr, /*!< \brief Integrated separation sensor for each monitoring surface. */ - *Buffet_Metric = nullptr, /*!< \brief Integrated separation sensor for each boundary. */ - **Buffet_Sensor = nullptr, /*!< \brief Separation sensor for each boundary and vertex. */ - Total_Buffet_Metric = 0.0; /*!< \brief Integrated separation sensor for all the boundaries. */ + + vector Surface_Buffet_Metric; /*!< \brief Integrated separation sensor for each monitoring surface. */ + vector Buffet_Metric; /*!< \brief Integrated separation sensor for each boundary. */ + vector > Buffet_Sensor; /*!< \brief Separation sensor for each boundary and vertex. */ + su2double Total_Buffet_Metric = 0.0; /*!< \brief Integrated separation sensor for all the boundaries. */ /*! * \brief A virtual member. @@ -131,7 +131,7 @@ class CNSSolver final : public CEulerSolver { /*! * \brief Destructor of the class. */ - ~CNSSolver(void) override; + ~CNSSolver() = default; /*! * \brief Provide the buffet metric. diff --git a/SU2_CFD/include/solvers/CTurbSASolver.hpp b/SU2_CFD/include/solvers/CTurbSASolver.hpp index f26635e9c0e3..ef75485c7ccc 100644 --- a/SU2_CFD/include/solvers/CTurbSASolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSASolver.hpp @@ -71,7 +71,7 @@ class CTurbSASolver final : public CTurbSolver { /*! * \brief Constructor of the class. */ - CTurbSASolver(void); + CTurbSASolver(); /*! * \overload @@ -85,7 +85,7 @@ class CTurbSASolver final : public CTurbSolver { /*! * \brief Destructor of the class. */ - ~CTurbSASolver(void) override; + ~CTurbSASolver() = default; /*! * \brief Restart residual and compute gradients. diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 807a3b106130..6a5813be462d 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -59,7 +59,7 @@ class CTurbSSTSolver final : public CTurbSolver { /*! * \brief Destructor of the class. */ - ~CTurbSSTSolver(void) override; + ~CTurbSSTSolver() = default; /*! * \brief Restart residual and compute gradients. diff --git a/SU2_CFD/include/solvers/CTurbSolver.hpp b/SU2_CFD/include/solvers/CTurbSolver.hpp index cc75f2527f87..e21a9833a371 100644 --- a/SU2_CFD/include/solvers/CTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSolver.hpp @@ -52,13 +52,13 @@ class CTurbSolver : public CSolver { lowerlimit[MAXNVAR] = {0.0}, /*!< \brief contains lower limits for turbulence variables. */ upperlimit[MAXNVAR] = {0.0}, /*!< \brief contains upper limits for turbulence variables. */ Gamma, /*!< \brief Fluid's Gamma constant (ratio of specific heats). */ - Gamma_Minus_One, /*!< \brief Fluids's Gamma - 1.0 . */ - ***Inlet_TurbVars = nullptr; /*!< \brief Turbulence variables at inlet profiles */ + Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */ + vector Inlet_TurbVars; /*!< \brief Turbulence variables at inlet profiles */ /*--- Sliding meshes variables. ---*/ - su2double ****SlidingState = nullptr; - int **SlidingStateNodes = nullptr; + vector > SlidingState; // vector of matrix of pointers... inner dim alloc'd elsewhere (welcome, to the twilight zone) + vector > SlidingStateNodes; /*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/ @@ -371,8 +371,6 @@ class CTurbSolver : public CSolver { * checking to prevent segmentation faults ---*/ if (val_marker >= nMarker) SU2_MPI::Error("Out-of-bounds marker index used on inlet.", CURRENT_FUNCTION); - else if (Inlet_TurbVars == nullptr || Inlet_TurbVars[val_marker] == nullptr) - SU2_MPI::Error("Tried to set custom inlet BC on an invalid marker.", CURRENT_FUNCTION); else if (val_vertex >= nVertex[val_marker]) SU2_MPI::Error("Out-of-bounds vertex index used on inlet.", CURRENT_FUNCTION); else if (val_dim >= nVar) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 4239796ce30a..59bfd48fce5a 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -175,21 +175,16 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, /*--- Allocates a 2D array with variable "outer" sizes and init to 0. ---*/ - auto Alloc2D = [](unsigned long M, const unsigned long* N, su2double**& X) { - X = new su2double* [M]; - for(unsigned long i = 0; i < M; ++i) - X[i] = new su2double [N[i]] (); + auto Alloc2D = [](unsigned long M, const unsigned long* N, vector >& X) { + X.resize(M); + for(unsigned long i = 0; i < M; ++i) X[i].resize(N[i], 0.0); }; /*--- Allocates a 3D array with variable "middle" sizes and init to 0. ---*/ - auto Alloc3D = [](unsigned long M, const unsigned long* N, unsigned long P, su2double***& X) { - X = new su2double** [M]; - for(unsigned long i = 0; i < M; ++i) { - X[i] = new su2double* [N[i]]; - for(unsigned long j = 0; j < N[i]; ++j) - X[i][j] = new su2double [P] (); - } + auto Alloc3D = [](unsigned long M, const unsigned long* N, unsigned long P, vector& X) { + X.resize(M); + for(unsigned long i = 0; i < M; ++i) X[i].resize(N[i],P) = su2double(0.0); }; /*--- Store the value of the primitive variables + 2 turb variables at the boundaries, @@ -199,10 +194,9 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, /*--- Store the value of the characteristic primitive variables index at the boundaries ---*/ - DonorGlobalIndex = new unsigned long* [nMarker]; - for (iMarker = 0; iMarker < nMarker; iMarker++) { - DonorGlobalIndex[iMarker] = new unsigned long [nVertex[iMarker]](); - } + DonorGlobalIndex.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) + DonorGlobalIndex[iMarker].resize(nVertex[iMarker],0); /*--- Actuator Disk Radius allocation ---*/ ActDisk_R.resize(nMarker); @@ -229,19 +223,19 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, /*--- Supersonic coefficients ---*/ - CEquivArea_Inv = new su2double[nMarker]; + CEquivArea_Inv.resize(nMarker); /*--- Engine simulation ---*/ - Inflow_MassFlow = new su2double[nMarker]; - Inflow_Pressure = new su2double[nMarker]; - Inflow_Mach = new su2double[nMarker]; - Inflow_Area = new su2double[nMarker]; + Inflow_MassFlow.resize(nMarker); + Inflow_Pressure.resize(nMarker); + Inflow_Mach.resize(nMarker); + Inflow_Area.resize(nMarker); - Exhaust_Temperature = new su2double[nMarker]; - Exhaust_MassFlow = new su2double[nMarker]; - Exhaust_Pressure = new su2double[nMarker]; - Exhaust_Area = new su2double[nMarker]; + Exhaust_Temperature.resize(nMarker); + Exhaust_MassFlow.resize(nMarker); + Exhaust_Pressure.resize(nMarker); + Exhaust_Area.resize(nMarker); /*--- Read farfield conditions from config ---*/ @@ -357,74 +351,11 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, CEulerSolver::~CEulerSolver(void) { - unsigned short iMarker, iSpan; - unsigned long iVertex; + unsigned short iSpan; + unsigned long iMarker; /*--- Array deallocation ---*/ - delete [] CEquivArea_Inv; - - delete [] Inflow_MassFlow; - delete [] Exhaust_MassFlow; - delete [] Exhaust_Area; - delete [] Inflow_Pressure; - delete [] Inflow_Mach; - delete [] Inflow_Area; - - delete [] Exhaust_Pressure; - delete [] Exhaust_Temperature; - - if (DonorPrimVar != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - delete [] DonorPrimVar[iMarker][iVertex]; - delete [] DonorPrimVar[iMarker]; - } - delete [] DonorPrimVar; - } - - if (DonorGlobalIndex != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] DonorGlobalIndex[iMarker]; - delete [] DonorGlobalIndex; - } - - if (ActDisk_Fa != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_Fa[iMarker]; - delete [] ActDisk_Fa; - } - - if (ActDisk_Fx != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_Fx[iMarker]; - delete [] ActDisk_Fx; - } - - if (ActDisk_Fy != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_Fy[iMarker]; - delete [] ActDisk_Fy; - } - - if (ActDisk_Fz != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_Fz[iMarker]; - delete [] ActDisk_Fz; - } - - if (ActDisk_DeltaP != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_DeltaP[iMarker]; - delete [] ActDisk_DeltaP; - } - - if (ActDisk_DeltaT != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) - delete [] ActDisk_DeltaT[iMarker]; - delete [] ActDisk_DeltaT; - } - for(auto& model : FluidModel) delete model; if(AverageVelocity !=nullptr){ @@ -817,7 +748,6 @@ void CEulerSolver::InitTurboContainers(CGeometry *geometry, CConfig *config){ } } - } void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config) { diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index a19f92c09fed..b0f73ee79ea7 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -52,16 +52,6 @@ CNEMONSSolver::CNEMONSSolver(CGeometry *geometry, CConfig *config, unsigned shor break; } - /* Auxiliary vector for storing primitives for gradient computation in viscous flow */ - /* V = [Y1, ... , Yn, T, Tve, ... ] */ - primitives_aux = new su2double[nPrimVar]; - -} - -CNEMONSSolver::~CNEMONSSolver(void) { - - if (primitives_aux != nullptr) delete [] primitives_aux; - } void CNEMONSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, @@ -150,10 +140,10 @@ void CNEMONSSolver::SetPrimitive_Gradient_GG(CGeometry *geometry, const CConfig /*--- Modify species density to mass concentration ---*/ for ( iPoint = 0; iPoint < nPoint; iPoint++){ - for( iVar = 0; iVar < nPrimVar; iVar++) { + su2double primitives_aux[MAXNVAR] = {0.0}; + for( iVar = 0; iVar < nPrimVar; iVar++) primitives_aux[iVar] = nodes->GetPrimitive(iPoint, iVar); - } - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for ( iSpecies = 0; iSpecies < nSpecies; iSpecies++) primitives_aux[RHOS_INDEX+iSpecies] = primitives_aux[RHOS_INDEX+iSpecies]/primitives_aux[RHO_INDEX]; for( iVar = 0; iVar < nPrimVar; iVar++) nodes->SetPrimitive_Aux(iPoint, iVar, primitives_aux[iVar] ); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 45877d858880..4ac75e2874d7 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -41,19 +41,12 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) /*--- This constructor only allocates/inits what is extra to CEulerSolver. ---*/ - /*--- Allocates a 2D array with variable "outer" sizes and init to 0. ---*/ - - auto Alloc2D = [](unsigned long M, const unsigned long* N, su2double**& X) { - X = new su2double* [M]; - for(unsigned long i = 0; i < M; ++i) - X[i] = new su2double [N[i]] (); - }; - /*--- Buffet sensor in all the markers and coefficients ---*/ - Alloc2D(nMarker, nVertex, Buffet_Sensor); - Buffet_Metric = new su2double[nMarker]; - Surface_Buffet_Metric = new su2double[config->GetnMarker_Monitoring()]; + Buffet_Sensor.resize(nMarker); + for (unsigned long i = 0; i< nMarker; ++i) Buffet_Sensor[i].resize(nVertex[i], 0.0); + Buffet_Metric.resize(nMarker, 0.0); + Surface_Buffet_Metric.resize(config->GetnMarker_Monitoring(), 0.0); /*--- Read farfield conditions from config ---*/ @@ -75,22 +68,6 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) } -CNSSolver::~CNSSolver(void) { - - unsigned short iMarker; - - delete [] Buffet_Metric; - delete [] Surface_Buffet_Metric; - - if (Buffet_Sensor != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++){ - delete [] Buffet_Sensor[iMarker]; - } - delete [] Buffet_Sensor; - } - -} - void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { @@ -290,8 +267,6 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf } -#ifdef HAVE_MPI - /*--- Add buffet metric information using all the nodes ---*/ su2double MyTotal_Buffet_Metric = Total_Buffet_Metric; @@ -299,17 +274,8 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf /*--- Add the buffet metric on the surfaces using all the nodes ---*/ - su2double *MySurface_Buffet_Metric = new su2double[config->GetnMarker_Monitoring()]; - - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { - MySurface_Buffet_Metric[iMarker_Monitoring] = Surface_Buffet_Metric[iMarker_Monitoring]; - } - - SU2_MPI::Allreduce(MySurface_Buffet_Metric, Surface_Buffet_Metric, config->GetnMarker_Monitoring(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - - delete [] MySurface_Buffet_Metric; - -#endif + auto local_copy = Surface_Buffet_Metric; + SU2_MPI::Allreduce(local_copy.data(), Surface_Buffet_Metric.data(), local_copy.size(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 0c3ea4147e3b..90a391e336b2 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -160,35 +160,22 @@ CTurbSASolver::CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned shor /*--- Initializate quantities for SlidingMesh Interface ---*/ - unsigned long iMarker; + SlidingState.resize(nMarker); + SlidingStateNodes.resize(nMarker); - SlidingState = new su2double*** [nMarker] (); - SlidingStateNodes = new int* [nMarker] (); - - for (iMarker = 0; iMarker < nMarker; iMarker++){ - - if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE){ - - SlidingState[iMarker] = new su2double**[geometry->GetnVertex(iMarker)] (); - SlidingStateNodes[iMarker] = new int [geometry->GetnVertex(iMarker)] (); - - for (iPoint = 0; iPoint < geometry->GetnVertex(iMarker); iPoint++) - SlidingState[iMarker][iPoint] = new su2double*[nPrimVar+1] (); + for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { + SlidingState[iMarker].resize(nVertex[iMarker], nPrimVar+1) = nullptr; + SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); } - } /*-- Allocation of inlets has to happen in derived classes (not CTurbSolver), * due to arbitrary number of turbulence variables ---*/ - Inlet_TurbVars = new su2double**[nMarker]; - for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { - Inlet_TurbVars[iMarker] = new su2double*[nVertex[iMarker]]; - for(unsigned long iVertex=0; iVertex < nVertex[iMarker]; iVertex++){ - Inlet_TurbVars[iMarker][iVertex] = new su2double[nVar] (); - Inlet_TurbVars[iMarker][iVertex][0] = nu_tilde_Inf; - } - } + Inlet_TurbVars.resize(nMarker); + for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) + Inlet_TurbVars[iMarker].resize(nVertex[iMarker],nVar) = nu_tilde_Inf; /*--- The turbulence models are always solved implicitly, so set the implicit flag in case we have periodic BCs. ---*/ @@ -210,36 +197,6 @@ CTurbSASolver::CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned shor } -CTurbSASolver::~CTurbSASolver(void) { - - unsigned long iMarker, iVertex; - unsigned short iVar; - - if ( SlidingState != nullptr ) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if ( SlidingState[iMarker] != nullptr ) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - if ( SlidingState[iMarker][iVertex] != nullptr ){ - for (iVar = 0; iVar < nPrimVar+1; iVar++) - delete [] SlidingState[iMarker][iVertex][iVar]; - delete [] SlidingState[iMarker][iVertex]; - } - delete [] SlidingState[iMarker]; - } - } - delete [] SlidingState; - } - - if ( SlidingStateNodes != nullptr ){ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - if (SlidingStateNodes[iMarker] != nullptr) - delete [] SlidingStateNodes[iMarker]; - } - delete [] SlidingStateNodes; - } - -} - void CTurbSASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index b3884d2c4b1f..74518f0a9ace 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -159,33 +159,25 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh /*--- Initializate quantities for SlidingMesh Interface ---*/ - unsigned long iMarker; + SlidingState.resize(nMarker); + SlidingStateNodes.resize(nMarker); - SlidingState = new su2double*** [nMarker](); - SlidingStateNodes = new int* [nMarker](); - - for (iMarker = 0; iMarker < nMarker; iMarker++){ - - if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE){ - - SlidingState[iMarker] = new su2double**[geometry->GetnVertex(iMarker)](); - SlidingStateNodes[iMarker] = new int [geometry->GetnVertex(iMarker)](); - - for (iPoint = 0; iPoint < geometry->GetnVertex(iMarker); iPoint++) - SlidingState[iMarker][iPoint] = new su2double*[nPrimVar+1](); + for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { + SlidingState[iMarker].resize(nVertex[iMarker], nPrimVar+1) = nullptr; + SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); } } /*-- Allocation of inlets has to happen in derived classes (not CTurbSolver), due to arbitrary number of turbulence variables ---*/ - Inlet_TurbVars = new su2double**[nMarker]; + Inlet_TurbVars.resize(nMarker); for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { - Inlet_TurbVars[iMarker] = new su2double*[nVertex[iMarker]]; - for(unsigned long iVertex=0; iVertex < nVertex[iMarker]; iVertex++){ - Inlet_TurbVars[iMarker][iVertex] = new su2double[nVar]; - Inlet_TurbVars[iMarker][iVertex][0] = kine_Inf; - Inlet_TurbVars[iMarker][iVertex][1] = omega_Inf; + Inlet_TurbVars[iMarker].resize(nVertex[iMarker],nVar); + for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; ++iVertex) { + Inlet_TurbVars[iMarker](iVertex,0) = kine_Inf; + Inlet_TurbVars[iMarker](iVertex,1) = omega_Inf; } } @@ -209,36 +201,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh } -CTurbSSTSolver::~CTurbSSTSolver(void) { - - unsigned long iMarker, iVertex; - unsigned short iVar; - - if ( SlidingState != nullptr ) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if ( SlidingState[iMarker] != nullptr ) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - if ( SlidingState[iMarker][iVertex] != nullptr ){ - for (iVar = 0; iVar < nPrimVar+1; iVar++) - delete [] SlidingState[iMarker][iVertex][iVar]; - delete [] SlidingState[iMarker][iVertex]; - } - delete [] SlidingState[iMarker]; - } - } - delete [] SlidingState; - } - - if ( SlidingStateNodes != nullptr ){ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - if (SlidingStateNodes[iMarker] != nullptr) - delete [] SlidingStateNodes[iMarker]; - } - delete [] SlidingStateNodes; - } - -} - void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { @@ -322,7 +284,7 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { - + bool axisymmetric = config->GetAxisymmetric(); CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); @@ -378,7 +340,7 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta /*--- Set y coordinate ---*/ numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(iPoint)); } - + /*--- Compute the source term ---*/ auto residual = numerics->ComputeResidual(config); diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index c344c0a63a23..12e3aa2491a7 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -75,16 +75,8 @@ CTurbSolver::CTurbSolver(CGeometry* geometry, CConfig *config) : CSolver() { CTurbSolver::~CTurbSolver(void) { - if (Inlet_TurbVars != nullptr) { - for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { - if (Inlet_TurbVars[iMarker] != nullptr) { - for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - delete [] Inlet_TurbVars[iMarker][iVertex]; - } - delete [] Inlet_TurbVars[iMarker]; - } - } - delete [] Inlet_TurbVars; + for (auto& mat : SlidingState) { + for (auto ptr : mat) delete [] ptr; } delete nodes; From 79e6e4362f5d7c0c80705b0ea6c0c8df128800fe Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 23:34:04 +0000 Subject: [PATCH 299/326] add example and regression --- TestCases/hybrid_regression.py | 8 ++ TestCases/rans/oneram6/turb_ONERAM6_nk.cfg | 127 +++++++++++++++++++++ config_template.cfg | 3 + 3 files changed, 138 insertions(+) create mode 100644 TestCases/rans/oneram6/turb_ONERAM6_nk.cfg diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index d69473c646ff..f185ac848ba2 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -178,6 +178,14 @@ def main(): turb_oneram6.test_vals = [-2.388851, -6.689340, 0.230320, 0.157649] test_list.append(turb_oneram6) + # ONERA M6 Wing - Newton-Krylov + turb_oneram6_nk = TestCase('turb_oneram6_nk') + turb_oneram6_nk.cfg_dir = "rans/oneram6" + turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" + turb_oneram6_nk.test_iter = 100 + turb_oneram6_nk.test_vals = [-7.015278, -6.587369, -10.394193, 0.271661, 0.019845, 4, -0.626403, 2.8101e+02] + test_list.append(turb_oneram6_nk) + # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" diff --git a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg new file mode 100644 index 000000000000..012779363fb2 --- /dev/null +++ b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg @@ -0,0 +1,127 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Turbulent flow, ONERA M6, Newton-Krylov solver % +% File Version 7.1.0 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= RANS +KIND_TURB_MODEL= SA +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +% ------------------------- NEWTON-KRYLOV PARAMETERS --------------------------% +% +% --- Things that matter --- +NEWTON_KRYLOV= YES + +% Iterations and tolerance for the Krylov part, it is important not to +% "over solve", tolerance should be as high as possible. +LINEAR_SOLVER_ITER= 5 +LINEAR_SOLVER_ERROR= 0.25 + +% For "n0" iterations or "r0" residual reduction, the normal quasi-Newton iterations +% are used. Then, they become the preconditioner for the NK iterations with "np" linear +% iterations or "tp" tolerance, with "np"=0 the linear preconditioner (e.g. ILU) is +% used directly (this may be enough for unsteady). +% The tolerance for NK iterations is initially relaxed by factor "ft", and reaches +% LINEAR_SOLVER_ERROR after "rf" residual reduction (additional to "r0"). +% The Jacobian-free products are based on finite differences with step "e". +NEWTON_KRYLOV_IPARAM= (0, 3, 2) % n0, np, ft +NEWTON_KRYLOV_DPARAM= (-1.0, 0.1, -6.0, 1e-5) % r0, tp, rf, e + +CFL_ADAPT= YES % it's needed +CFL_NUMBER= 10 +CFL_ADAPT_PARAM= ( 0.8, 1.1, 5, 1000 ) % no point using NK with low CFL values + +% It is important (more than usual) to have similar magnitude variables +REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH + +USE_VECTORIZATION= YES % compile the code for AVX and mixed precision or it will be slow! +TIME_DISCRE_FLOW= EULER_IMPLICIT % what else +LINEAR_SOLVER_PREC= ILU % or LU_SGS + +% --- Things that don't --- +MGLEVEL= 0 % NK replaces MG +LINEAR_SOLVER= FGMRES % It will be FGMRES regardless + +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +MACH_NUMBER= 0.8395 +AOA= 3.06 +SIDESLIP_ANGLE= 0.0 + +FREESTREAM_TEMPERATURE= 288.15 +REYNOLDS_NUMBER= 11.72E6 +REYNOLDS_LENGTH= 0.64607 + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +FLUID_MODEL= STANDARD_AIR +GAMMA_VALUE= 1.4 +GAS_CONSTANT= 287.058 +ACENTRIC_FACTOR= 0.035 + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= SUTHERLAND +MU_CONSTANT= 1.716E-5 +MU_REF= 1.716E-5 +MU_T_REF= 273.15 +SUTHERLAND_CONSTANT= 110.4 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 0.64607 +REF_AREA= 0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( WING, 0.0 ) +MARKER_FAR= ( FARFIELD ) +MARKER_SYM= ( SYMMETRY ) +MARKER_PLOTTING= ( WING ) +MARKER_MONITORING= ( WING ) + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +NUM_METHOD_GRAD= GREEN_GAUSS +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= VAN_ALBADA_EDGE + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_CRITERIA= RESIDUAL +CONV_RESIDUAL_MINVAL= -11 +CONV_STARTITER= 10 +ITER= 2000 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= mesh_ONERAM6_turb_hexa_43008.su2 +MESH_FORMAT= SU2 +TABULAR_FORMAT= CSV +SOLUTION_FILENAME= solution.dat +RESTART_FILENAME= restart.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat +RESTART_ADJ_FILENAME= restart_adj.dat +VOLUME_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint +SURFACE_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint +OUTPUT_FILES=(RESTART, PARAVIEW, SURFACE_PARAVIEW) +OUTPUT_WRT_FREQ= 10000 +SCREEN_OUTPUT = (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_ENERGY, RMS_NU_TILDE, LIFT, DRAG, LINSOL_ITER, LINSOL_RESIDUAL, AVG_CFL) +CONV_FILENAME= history + diff --git a/config_template.cfg b/config_template.cfg index 9d5d4299623a..c6f553a40438 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1091,6 +1091,9 @@ CENTRAL_JACOBIAN_FIX_FACTOR= 4.0 % % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% Use a Newton-Krylov method on the flow equations, see TestCases/rans/oneram6/turb_ONERAM6_nk.cfg +NEWTON_KRYLOV= NO % ------------------- FEM FLOW NUMERICAL METHOD DEFINITION --------------------% % From ddb38d426892d15e6f0c4ab088d66303e6e756b7 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Mon, 22 Feb 2021 23:38:39 +0000 Subject: [PATCH 300/326] fix random bug in Check_IntElem_Orientation --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 411e4d0c7aa0..31a5ca91321b 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -4318,7 +4318,7 @@ void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig *config) { if (elem[iElem]->GetVTK_Type() == TETRAHEDRON) { - if (checkTetra(iElem,0,1,2,3) < 0.0) { + if (checkTetra(iElem,0,1,2,3)) { elem[iElem]->Change_Orientation(); tet_flip++; } From f43cab9a5ec9187b50ee0563d428421e6bcd3634 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 23 Feb 2021 09:03:44 +0100 Subject: [PATCH 301/326] More cleanups. --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- .../include/numerics/flow/flow_sources.hpp | 16 +------ SU2_CFD/src/numerics/flow/flow_sources.cpp | 46 ++++++++----------- 3 files changed, 21 insertions(+), 43 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 058da3a31f68..5f057f413339 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7485,7 +7485,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- therefore the default value of the send value is set super high. ---*/ /*-------------------------------------------------------------------------------------------*/ - for (int iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 29a48c15f6e1..2a91f802d328 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -336,15 +336,12 @@ class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { bool turbulent; /*!< \brief Turbulence model used. */ bool energy; /*!< \brief Energy equation on. */ bool streamwisePeriodic_temperature; /*!< \brief Periodicity in energy equation */ - vector Streamwise_Coord_Vector; /*!< \brief Translation vector between streamwise periodic surfaces. */ + su2double Streamwise_Coord_Vector[MAXNDIM] = {0.0}; /*!< \brief Translation vector between streamwise periodic surfaces. */ su2double norm2_translation, /*!< \brief Square of distance between the 2 periodic surfaces. */ dot_product, /*!< \brief Container for various dot-products. */ scalar_factor; /*!< \brief Holds scalar factors to simplify final equations. */ - unsigned short iDim, /*!< brief Counts over Dimensions. */ - iVar, jVar; /*!< brief Count over Variables. */ - public: /*! @@ -372,17 +369,6 @@ class CSourceIncStreamwise_Periodic final : public CSourceBase_Flow { * \author T. Kattmann */ class CSourceIncStreamwisePeriodic_Outlet : public CSourceBase_Flow { -private: - - su2double - AxiFactor, /*!< brief Factor for axisymmetric simulations */ - FaceArea, /*!< brief Boundary face area */ - local_Massflow, /*!< brief massflow through that one boundary cell */ - AreaAvgInletTemp; /*!< brief Area avg inlet Temp. Computed in GetStreamwise_Periodic_Properties */ - - unsigned short iDim, /*!< brief Counts over Dimensions. */ - iVar, jVar; /*!< brief Count over Variables. */ - public: /*! diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 864eae9ddb29..a1e8c9b86da6 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -677,17 +677,16 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CConfig *config) : CSourceBase_Flow(val_nDim, val_nVar, config) { - turbulent = (config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS); + turbulent = (config->GetKind_Turb_Model() != NONE); energy = config->GetEnergy_Equation(); streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); - Streamwise_Coord_Vector.resize(nDim); - for (iDim = 0; iDim < nDim; iDim++) + for (unsigned short iDim = 0; iDim < nDim; iDim++) Streamwise_Coord_Vector[iDim] = config->GetPeriodic_Translation(0)[iDim]; /*--- Compute square of the distance between the 2 periodic surfaces via inner product with itself: dot_prod(t*t) = (|t|_2)^2 ---*/ - norm2_translation = GeometryToolbox::SquaredNorm(nDim, Streamwise_Coord_Vector.data()); + norm2_translation = GeometryToolbox::SquaredNorm(nDim, Streamwise_Coord_Vector); } @@ -697,23 +696,21 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C const su2double massflow = config->GetStreamwise_Periodic_MassFlow(); /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ const su2double integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); /*!< \brief Total heat added into the domain via heatflux marker. */ - /*--- No contribution in the continuity equation ---*/ - residual[0] = 0.0; + for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; /*--- Compute the momentum equation source based on the prescribed (or computed if massflow) delta pressure ---*/ - for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) { scalar_factor = delta_p / norm2_translation * Streamwise_Coord_Vector[iDim]; residual[iDim+1] = -Volume * scalar_factor; } /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ - residual[nDim+1] = 0.0; if (energy && streamwisePeriodic_temperature) { scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); /*--- Compute scalar-product dot_prod(v*t) ---*/ - dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector.data(), &V_i[1]); + dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, &V_i[1]); residual[nDim+1] = Volume * scalar_factor * dot_product; @@ -725,7 +722,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ - dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector.data(), PrimVar_Grad_i[nDim+5]); + dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, PrimVar_Grad_i[nDim+5]); residual[nDim+1] -= Volume * scalar_factor * dot_product; } // if turbulent @@ -742,30 +739,25 @@ CSourceIncStreamwisePeriodic_Outlet::CSourceIncStreamwisePeriodic_Outlet(unsigne CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(const CConfig *config) { - for (iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; - - /*--- A = sqrt(dot_prod(n_A*n_A)), with n_A beeing the area-normal. ---*/ - FaceArea = GeometryToolbox::Norm(nDim, Normal); + for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; - //compute local massflow [kg/s] - local_Massflow = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - local_Massflow += Normal[iDim] * V_i[iDim+1] * DensityInc_i; - } - - AreaAvgInletTemp = config->GetStreamwise_Periodic_InletTemperature(); + /*--- m_dot_local = rho * dot_prod(n_A*v), with n_A beeing the area-normal ---*/ + const su2double local_Massflow = DensityInc_i * GeometryToolbox::DotProduct(nDim, Normal, &V_i[1]); // Massflow weighted heat sink, which takes out // a) the integrated amount over the Heatflux marker // b) a user provided quantity, especially the case for CHT cases - if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) { - residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_IntegratedHeatFlow(); - } else { - residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); - } + su2double factor; + if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) + factor = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + else + factor = config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); + + residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * factor; /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution ---*/ - residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * (AreaAvgInletTemp - config->GetInc_Temperature_Init()/config->GetTemperature_Ref() ); + const su2double delta_T = config->GetStreamwise_Periodic_InletTemperature() - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); + residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * delta_T; return ResidualType<>(residual, jacobian, nullptr); From 3ea3f988f06067e62767ccab6c05964d5015ec11 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 23 Feb 2021 09:54:19 +0000 Subject: [PATCH 302/326] race condition, reduce testcase duration, cleanup --- Common/include/CConfig.hpp | 2 +- Common/include/linear_algebra/CSysMatrix.hpp | 11 +++++------ Common/src/grid_movement/CVolumetricMovement.cpp | 8 ++++---- Common/src/linear_algebra/CSysMatrix.cpp | 2 -- SU2_CFD/src/integration/CNewtonIntegration.cpp | 15 ++++++++------- SU2_CFD/src/solvers/CFEASolver.cpp | 4 ++-- TestCases/hybrid_regression.py | 4 ++-- TestCases/rans/oneram6/turb_ONERAM6_nk.cfg | 4 ++-- config_template.cfg | 2 ++ 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 46514bebb262..717bb443a49d 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -28,7 +28,7 @@ #pragma once -#include "./parallelization/mpi_structure.hpp" +#include "parallelization/mpi_structure.hpp" #include #include diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index f4312d5321f3..0abbc3e663a3 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -28,9 +28,7 @@ #pragma once -#include "../../include/parallelization/mpi_structure.hpp" -#include "../../include/parallelization/omp_structure.hpp" -#include "../../include/parallelization/vectorization.hpp" +#include "../../include/CConfig.hpp" #include "CSysVector.hpp" #include "CPastixWrapper.hpp" @@ -75,7 +73,6 @@ struct mkl_jit_wrapper { #endif #endif -class CConfig; class CGeometry; struct CSysMatrixComms { @@ -88,7 +85,8 @@ struct CSysMatrixComms { * \param[in] commType - Enumerated type for the quantity to be communicated. */ template - static void Initiate(const CSysVector& x, CGeometry *geometry, const CConfig *config, unsigned short commType); + static void Initiate(const CSysVector& x, CGeometry *geometry, const CConfig *config, + unsigned short commType = SOLUTION_MATRIX); /*! * \brief Routine to complete the set of non-blocking communications launched by @@ -99,7 +97,8 @@ struct CSysMatrixComms { * \param[in] commType - Enumerated type for the quantity to be unpacked. */ template - static void Complete(CSysVector& x, CGeometry *geometry, const CConfig *config, unsigned short commType); + static void Complete(CSysVector& x, CGeometry *geometry, const CConfig *config, + unsigned short commType = SOLUTION_MATRIX); }; /*! diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index d18da5b4c9d4..e1790682b949 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -168,11 +168,11 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co so that all nodes have the same solution and r.h.s. entries across all partitions. ---*/ - CSysMatrixComms::Initiate(LinSysSol, geometry, config, SOLUTION_MATRIX); - CSysMatrixComms::Complete(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysSol, geometry, config); + CSysMatrixComms::Complete(LinSysSol, geometry, config); - CSysMatrixComms::Initiate(LinSysRes, geometry, config, SOLUTION_MATRIX); - CSysMatrixComms::Complete(LinSysRes, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysRes, geometry, config); + CSysMatrixComms::Complete(LinSysRes, geometry, config); /*--- Definition of the preconditioner matrix vector multiplication, and linear solver ---*/ diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index f967b71106d2..e71afd5144bb 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -28,8 +28,6 @@ #include "../../include/linear_algebra/CSysMatrix.inl" #include "../../include/geometry/CGeometry.hpp" -#include "../../include/CConfig.hpp" -#include "../../include/parallelization/omp_structure.hpp" #include "../../include/toolboxes/allocation_toolbox.hpp" #include diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 19be8c303c95..5c7abdf89083 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -222,10 +222,11 @@ void CNewtonIntegration::MultiGrid_Iteration(CGeometry ****geometry_, CSolver ** bool endStartup = false; if (startupPeriod) { - SU2_OMP_MASTER - firstResidual = max(firstResidual, residual); + SU2_OMP_MASTER { + firstResidual = max(firstResidual, residual); + if (startupIters) startupIters -= 1; + } SU2_OMP_BARRIER - if (startupIters) startupIters -= 1; endStartup = (startupIters == 0) && (residual - firstResidual < startupResidual); } @@ -328,8 +329,8 @@ void CNewtonIntegration::MatrixFreeProduct(const CSysVector& u, CSysVect } } - CSysMatrixComms::Initiate(v, geometry, config, SOLUTION_MATRIX); - CSysMatrixComms::Complete(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(v, geometry, config); + CSysMatrixComms::Complete(v, geometry, config); } void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector& v) const { @@ -350,7 +351,7 @@ void CNewtonIntegration::Preconditioner(const CSysVector& u, CSysVector< v(iPoint,iVar) = SU2_TYPE::GetValue(delta) * u(iPoint,iVar); } - CSysMatrixComms::Initiate(v, geometry, config, SOLUTION_MATRIX); - CSysMatrixComms::Complete(v, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(v, geometry, config); + CSysMatrixComms::Complete(v, geometry, config); } } diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 6aa1ddaec982..f8b0e91096d3 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2544,8 +2544,8 @@ void CFEASolver::GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const C void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) { /*--- Enforce solution at some halo points possibly not covered by essential BC markers. ---*/ - CSysMatrixComms::Initiate(LinSysSol, geometry, config, SOLUTION_MATRIX); - CSysMatrixComms::Complete(LinSysSol, geometry, config, SOLUTION_MATRIX); + CSysMatrixComms::Initiate(LinSysSol, geometry, config); + CSysMatrixComms::Complete(LinSysSol, geometry, config); for (auto iPoint : ExtraVerticesToEliminate) { Jacobian.EnforceSolutionAtNode(iPoint, LinSysSol.GetBlock(iPoint), LinSysRes); diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index f185ac848ba2..22ccf40eee0b 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -182,8 +182,8 @@ def main(): turb_oneram6_nk = TestCase('turb_oneram6_nk') turb_oneram6_nk.cfg_dir = "rans/oneram6" turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" - turb_oneram6_nk.test_iter = 100 - turb_oneram6_nk.test_vals = [-7.015278, -6.587369, -10.394193, 0.271661, 0.019845, 4, -0.626403, 2.8101e+02] + turb_oneram6_nk.test_iter = 20 + turb_oneram6_nk.test_vals = [-4.893470, -4.511977, -11.437109, 0.221926, 0.045766, 2, -0.893674, 31.384] test_list.append(turb_oneram6_nk) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) diff --git a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg index 012779363fb2..371ebb933d5a 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg @@ -28,8 +28,8 @@ LINEAR_SOLVER_ERROR= 0.25 % The tolerance for NK iterations is initially relaxed by factor "ft", and reaches % LINEAR_SOLVER_ERROR after "rf" residual reduction (additional to "r0"). % The Jacobian-free products are based on finite differences with step "e". -NEWTON_KRYLOV_IPARAM= (0, 3, 2) % n0, np, ft -NEWTON_KRYLOV_DPARAM= (-1.0, 0.1, -6.0, 1e-5) % r0, tp, rf, e +NEWTON_KRYLOV_IPARAM= (10, 3, 2) % n0, np, ft +NEWTON_KRYLOV_DPARAM= (1.0, 0.1, -6.0, 1e-5) % r0, tp, rf, e CFL_ADAPT= YES % it's needed CFL_NUMBER= 10 diff --git a/config_template.cfg b/config_template.cfg index c6f553a40438..b9d479ef717d 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1093,6 +1093,8 @@ CENTRAL_JACOBIAN_FIX_FACTOR= 4.0 TIME_DISCRE_FLOW= EULER_IMPLICIT % % Use a Newton-Krylov method on the flow equations, see TestCases/rans/oneram6/turb_ONERAM6_nk.cfg +% For multizone discrete adjoint it will use FGMRES on inner iterations with restart frequency +% equal to "QUASI_NEWTON_NUM_SAMPLES". NEWTON_KRYLOV= NO % ------------------- FEM FLOW NUMERICAL METHOD DEFINITION --------------------% From a8ff3a212a324b8c47a4c6021bca969230995c85 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 23 Feb 2021 11:11:10 +0100 Subject: [PATCH 303/326] Adress warnings that fails CI. --- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 0c57fb1bafe9..fd2db9764f8a 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1263,7 +1263,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont unsigned short iVar; unsigned long iPoint; - unsigned short iDim, iMarker; + unsigned short iMarker; unsigned long iVertex; const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index bfef0a77e973..aeae27108a0f 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -192,25 +192,15 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool energy = config->GetEnergy_Equation(); - bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); - bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Variable allocation for streamwise periodicity ---*/ + bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); su2double Cp, thermal_conductivity, dot_product, - norm2_translation, - scalar_factor, - massflow, - integratedHeatFlow; - - /*--- Variable initialization for streamwise periodicity ---*/ - if(energy && streamwise_periodic && streamwise_periodic_temperature) { - massflow = config->GetStreamwise_Periodic_MassFlow(); - integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + scalar_factor; - norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); - } /*--- Identify the boundary by string name ---*/ @@ -289,6 +279,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con thermal_conductivity = nodes->GetThermalConductivity(iPoint); /*--- Scalar factor of the residual contribution ---*/ + const su2double massflow = config->GetStreamwise_Periodic_MassFlow(); + const su2double integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); /*--- Dot product ---*/ From 90342e7c5227ba65f48ce7b017a4bb862fb58eac Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 23 Feb 2021 10:11:33 +0000 Subject: [PATCH 304/326] try to make serial compile faster --- .../include/parallelization/mpi_structure.cpp | 43 +++++++++++++++++++ .../include/parallelization/mpi_structure.hpp | 43 +------------------ 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/Common/include/parallelization/mpi_structure.cpp b/Common/include/parallelization/mpi_structure.cpp index 962426d1d4d7..3c7aa9c57479 100644 --- a/Common/include/parallelization/mpi_structure.cpp +++ b/Common/include/parallelization/mpi_structure.cpp @@ -122,6 +122,49 @@ void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName){ } Abort(currentComm, 0); } + +void CBaseMPIWrapper::CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype) { + switch (datatype) { + case MPI_DOUBLE: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_UNSIGNED_LONG: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_LONG: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_UNSIGNED_SHORT: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_CHAR: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_SHORT: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + case MPI_INT: + for (int i = 0; i < size; i++) { + static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; + } + break; + default: + Error("Unknown type", CURRENT_FUNCTION); + break; + }; +} #endif #ifdef HAVE_MPI diff --git a/Common/include/parallelization/mpi_structure.hpp b/Common/include/parallelization/mpi_structure.hpp index f538db18f6f6..09d8a10fd561 100644 --- a/Common/include/parallelization/mpi_structure.hpp +++ b/Common/include/parallelization/mpi_structure.hpp @@ -503,48 +503,7 @@ class CBaseMPIWrapper { static int Rank, Size; static Comm currentComm; - static inline void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype) { - switch (datatype) { - case MPI_DOUBLE: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_UNSIGNED_LONG: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_LONG: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_UNSIGNED_SHORT: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_CHAR: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_SHORT: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - case MPI_INT: - for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i] = static_cast(sendbuf)[i]; - } - break; - default: - Error("Unknown type", CURRENT_FUNCTION); - break; - }; - } + static void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype); public: static void Error(std::string ErrorMsg, std::string FunctionName); From ba33dee358cb0604ca8afbc31961ecb55679ef4b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 23 Feb 2021 14:05:00 +0100 Subject: [PATCH 305/326] Move vars from config to solver and geometry. --- Common/include/CConfig.hpp | 54 +------------------ Common/include/geometry/CGeometry.hpp | 6 +++ Common/include/geometry/CPhysicalGeometry.hpp | 7 +++ Common/src/CConfig.cpp | 3 -- Common/src/geometry/CPhysicalGeometry.cpp | 7 +-- SU2_CFD/include/numerics/CNumerics.hpp | 1 + .../include/numerics/flow/flow_sources.hpp | 16 ++++++ SU2_CFD/include/solvers/CIncEulerSolver.hpp | 22 ++++++++ SU2_CFD/include/solvers/CSolver.hpp | 18 +++++++ SU2_CFD/src/numerics/flow/flow_sources.cpp | 12 ++--- SU2_CFD/src/output/CFlowIncOutput.cpp | 4 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 16 ++---- SU2_CFD/src/solvers/CIncNSSolver.cpp | 12 ++--- 13 files changed, 89 insertions(+), 89 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 6d0dee3fa3b2..3d77203870ac 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -998,11 +998,7 @@ class CConfig { bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */ su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_OutletHeat, /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ - Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ - vector Streamwise_Periodic_RefNode; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ @@ -5754,18 +5750,6 @@ class CConfig { */ su2double GetStreamwise_Periodic_OutletHeat(void) const { return Streamwise_Periodic_OutletHeat; } - /*! - * \brief Set the value of the area avg periodic inlet Temperature. - * \param[in] Temp - area avg periodic inlet Temperature. - */ - void SetStreamwise_Periodic_InletTemperature(su2double Temp) { Streamwise_Periodic_InletTemperature = Temp; } - - /*! - * \brief Get the value of the area avg periodic inlet Temperature. - * \return Temperature value. - */ - su2double GetStreamwise_Periodic_InletTemperature(void) const { return Streamwise_Periodic_InletTemperature; } - /*! * \brief Get the value of the pressure delta from which body force vector is computed. * \return Delta Pressure for body force computation. @@ -5784,42 +5768,6 @@ class CConfig { */ su2double GetStreamwise_Periodic_TargetMassFlow(void) const { return Streamwise_Periodic_TargetMassFlow; } - /*! - * \brief Get a pointer to the reference node coordinate vector. - * \return A pointer to the reference node coordinate vector. - */ - vector GetStreamwise_Periodic_RefNode(void) { return Streamwise_Periodic_RefNode; } - - /*! - * \brief Get a pointer to the reference node coordinate vector. - * \return A pointer to the reference node coordinate vector. - */ - void SetStreamwise_Periodic_RefNode(vector RefNode) { Streamwise_Periodic_RefNode = RefNode; } - - /*! - * \brief Get the massflow of the streamwise periodic donor/outlet boundary. - * \return The streamwise periodic donor/outlet massflow. - */ - su2double GetStreamwise_Periodic_MassFlow() const { return Streamwise_Periodic_MassFlow; } - - /*! - * \brief Set the massflow at the streamwise periodic donor/outlet boundary. - * \param[in] val_massflow - Massflow at the streamwise periodic donor marker. - */ - void SetStreamwise_Periodic_MassFlow(su2double val_massflow) { Streamwise_Periodic_MassFlow = val_massflow; } - - /*! - * \brief Get the net sum of the heatflow into the domain. - * \return The net sum of the heatflow into the domain. - */ - su2double GetStreamwise_Periodic_IntegratedHeatFlow() const { return Streamwise_Periodic_IntegratedHeatFlow; } - - /*! - * \brief Set the net sum of the heatflow into the domain. - * \param[in] val_heatflow - Net sum of the heatflow into the domain. - */ - void SetStreamwise_Periodic_IntegratedHeatFlow(su2double val_heatflow) { Streamwise_Periodic_IntegratedHeatFlow = val_heatflow; } - /*! * \brief Get information about the volumetric heat source. * \return TRUE if it uses a volumetric heat source; otherwise FALSE. diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index dbd98db732b1..132491bbfb97 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1717,5 +1717,11 @@ class CGeometry { * \param[out] nNonconvexElements- amount of nonconvex elements in the mesh */ unsigned long GetnNonconvexElements() const {return nNonconvexElements;} + + /*! + * \brief Get a pointer to the reference node coordinate vector. + * \return A pointer to the reference node coordinate vector. + */ + inline virtual const su2double* GetStreamwise_Periodic_RefNode(void) const { return nullptr; } }; diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 1abfcbff9ae9..664bac8a2985 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -107,6 +107,8 @@ class CPhysicalGeometry final : public CGeometry { vector GlobalMarkerStorageDispl; vector GlobalRoughness_Height; + su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ using CGeometry::SetVertex; @@ -790,4 +792,9 @@ class CPhysicalGeometry final : public CGeometry { */ void SetGlobalMarkerRoughness(const CConfig* config); + /*! + * \brief Get a pointer to the reference node coordinate vector. + * \return A pointer to the reference node coordinate vector. + */ + inline const su2double* GetStreamwise_Periodic_RefNode(void) const final { return Streamwise_Periodic_RefNode;} }; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 004281c7e0da..c4598b690196 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4602,9 +4602,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\"", CURRENT_FUNCTION); if (Axisymmetric) SU2_MPI::Error("Streamwise Periodicity terms does not not have axisymmetric corrections.", CURRENT_FUNCTION); - - /*--- Allocate Memory for Reference Node for recovered pressure computation ---*/ - Streamwise_Periodic_RefNode.resize(val_nDim); } else { /*--- Safety measure ---*/ Streamwise_Periodic_Temperature = false; diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 5f057f413339..d5966a3d6cd4 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7531,19 +7531,16 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { if (norm < min_norm || iRank == 0) { min_norm = norm; for (unsigned short iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = Buffer_Recv_RefNode[iRank*nDim + iDim]; + Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode[iRank*nDim + iDim]; } /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } - /*--- Store the final reference node. ---*/ - config->SetStreamwise_Periodic_RefNode(Buffer_Send_RefNode); - /*--- Print the reference node to screen. ---*/ if (rank == MASTER_NODE) { cout << "Streamwise Periodic Reference Node: ["; for (unsigned short iDim = 0; iDim < nDim; iDim++) - cout << " " << Buffer_Send_RefNode[iDim]; + cout << " " << Streamwise_Periodic_RefNode[iDim]; cout << " ]" << endl; } diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 80718e9b0e3d..f89a0cd61029 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1604,6 +1604,7 @@ class CNumerics { */ virtual inline void SetGamma(su2double val_Gamma_i, su2double val_Gamma_j) { } + virtual inline void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { } }; /*! diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 2a91f802d328..b19e46ea8fc8 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -40,6 +40,10 @@ class CSourceBase_Flow : public CNumerics { protected: su2double* residual = nullptr; su2double** jacobian = nullptr; + su2double + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ /*! * \brief Constructor of the class. @@ -55,6 +59,18 @@ class CSourceBase_Flow : public CNumerics { */ ~CSourceBase_Flow() override; + /*! + * \brief Constructor of the class. + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of variables of the problem. + * \param[in] config - Definition of the particular problem. + */ + void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { + Streamwise_Periodic_MassFlow = massflow; + Streamwise_Periodic_IntegratedHeatFlow = integratedHeat; + Streamwise_Periodic_InletTemperature = inletTemp; + } + }; /*! diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 1ebdd1f7a5ab..9da595c62de2 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -39,6 +39,10 @@ class CIncEulerSolver : public CFVMFlowSolverBase { protected: vector FluidModel; /*!< \brief fluid model used in the solver. */ + su2double + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ /*! * \brief Preprocessing actions common to the Euler and NS solvers. @@ -392,4 +396,22 @@ class CIncEulerSolver : public CFVMFlowSolverBase CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ - const su2double massflow = config->GetStreamwise_Periodic_MassFlow(); /*!< \brief Massflow through streamwise periodic 'outlet' marker. */ - const su2double integrated_heatflow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); /*!< \brief Total heat added into the domain via heatflux marker. */ for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; @@ -707,7 +705,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ if (energy && streamwisePeriodic_temperature) { - scalar_factor = integrated_heatflow * DensityInc_i / (massflow * norm2_translation); + scalar_factor = Streamwise_Periodic_IntegratedHeatFlow * DensityInc_i / (Streamwise_Periodic_MassFlow * norm2_translation); /*--- Compute scalar-product dot_prod(v*t) ---*/ dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, &V_i[1]); @@ -719,7 +717,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C if(turbulent) { /*--- Compute the scalar factor ---*/ - scalar_factor = integrated_heatflow / (massflow * sqrt(norm2_translation) * Prandtl_Turb); + scalar_factor = Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, PrimVar_Grad_i[nDim+5]); @@ -749,14 +747,14 @@ CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(c // b) a user provided quantity, especially the case for CHT cases su2double factor; if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) - factor = config->GetStreamwise_Periodic_IntegratedHeatFlow(); + factor = Streamwise_Periodic_IntegratedHeatFlow; else factor = config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); - residual[nDim+1] -= abs(local_Massflow/config->GetStreamwise_Periodic_MassFlow()) * factor; + residual[nDim+1] -= abs(local_Massflow/Streamwise_Periodic_MassFlow) * factor; /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution ---*/ - const su2double delta_T = config->GetStreamwise_Periodic_InletTemperature() - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); + const su2double delta_T = Streamwise_Periodic_InletTemperature - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * delta_T; return ResidualType<>(residual, jacobian, nullptr); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 1beab2fcc091..a821aa668cde 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -342,9 +342,9 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("AVG_CFL", flow_solver->GetAvg_CFL_Local()); if(streamwisePeriodic) { - SetHistoryOutputValue("STREAMWISE_MASSFLOW", config->GetStreamwise_Periodic_MassFlow()); + SetHistoryOutputValue("STREAMWISE_MASSFLOW", flow_solver->GetStreamwise_Periodic_MassFlow()); SetHistoryOutputValue("STREAMWISE_DP", config->GetStreamwise_Periodic_PressureDrop()); - SetHistoryOutputValue("STREAMWISE_HEAT", config->GetStreamwise_Periodic_IntegratedHeatFlow()); + SetHistoryOutputValue("STREAMWISE_HEAT", flow_solver->GetStreamwise_Periodic_IntegratedHeatFlow()); } /*--- Set the analyse surface history values --- */ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index fd2db9764f8a..646a4638d042 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -865,14 +865,6 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ SU2_OMP_BARRIER } - /*--- Compute integrated Heatflux and massflow, TK:: Euler equations not implemented yet, probalby wasted here ---*/ - if (config->GetKind_Streamwise_Periodic() && false) { - SU2_OMP_MASTER - if(rank==MASTER_NODE) cout << "EulerPrepsocessing GetStreamwise_Periodic_Properties." << endl; - GetStreamwise_Periodic_Properties(geometry, config, iMesh); - SU2_OMP_BARRIER - } - /*--- Initialize the Jacobian matrix and residual, not needed for the reducer strategy * as we set blocks (including diagonal ones) and completely overwrite. ---*/ @@ -1280,6 +1272,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (streamwise_periodic) { + numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); /*--- Loop over all points ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) @@ -1314,6 +1307,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(!streamwise_periodic_temperature && energy) { CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; + second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -2941,8 +2935,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Average_Density_Global /= Area_Global; Temperature_Global /= Area_Global; // What do I do with the temperature now from here on? The only way really is to pipe it through the config... - config->SetStreamwise_Periodic_InletTemperature(Temperature_Global); - config->SetStreamwise_Periodic_MassFlow(MassFlow_Global); + Streamwise_Periodic_InletTemperature = Temperature_Global; + Streamwise_Periodic_MassFlow = MassFlow_Global; if (rank == MASTER_NODE && false) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } if (rank == MASTER_NODE && false) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } @@ -3038,7 +3032,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*--- Set the Integrated Heatflux ---*/ if (iMesh == MESH_0) - config->SetStreamwise_Periodic_IntegratedHeatFlow(HeatFlow_Global); + Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index aeae27108a0f..998fe23eed47 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -106,12 +106,10 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container Pressure_Recovered, Temperature_Recovered; - su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(), - HeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(), - MassFlow = config->GetStreamwise_Periodic_MassFlow(); + su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ - vector ReferenceNode = config->GetStreamwise_Periodic_RefNode(); + const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); @@ -131,7 +129,7 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container /*--- 'InnerIter > 0' as otherwise MassFlow in the denominator would be zero ---*/ if (energy && InnerIter > 0) { Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); - Temperature_Recovered += HeatFlow / (MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; + Temperature_Recovered += Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; nodes->SetStreamwise_Periodic_RecoveredTemperature(iPoint, Temperature_Recovered); } } @@ -279,10 +277,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con thermal_conductivity = nodes->GetThermalConductivity(iPoint); /*--- Scalar factor of the residual contribution ---*/ - const su2double massflow = config->GetStreamwise_Periodic_MassFlow(); - const su2double integratedHeatFlow = config->GetStreamwise_Periodic_IntegratedHeatFlow(); const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); - scalar_factor = integratedHeatFlow*thermal_conductivity / (massflow * Cp * norm2_translation); + scalar_factor = Streamwise_Periodic_IntegratedHeatFlow*thermal_conductivity / (Streamwise_Periodic_MassFlow * Cp * norm2_translation); /*--- Dot product ---*/ dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), Normal); From 6047ba750fa2e7bd6d5a9fd3fe91ccbd973edb7b Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 23 Feb 2021 22:33:06 +0000 Subject: [PATCH 306/326] update regression --- TestCases/hybrid_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 22ccf40eee0b..8e16ca220292 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -183,7 +183,7 @@ def main(): turb_oneram6_nk.cfg_dir = "rans/oneram6" turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" turb_oneram6_nk.test_iter = 20 - turb_oneram6_nk.test_vals = [-4.893470, -4.511977, -11.437109, 0.221926, 0.045766, 2, -0.893674, 31.384] + turb_oneram6_nk.test_vals = [-4.915831, -4.538025, -11.447429, 0.217968, 0.046136, 2, -0.895273, 31.384] test_list.append(turb_oneram6_nk) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) From 1ccc0b449659849123f2bf86bbc828b3632c5a31 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 24 Feb 2021 09:57:15 +0100 Subject: [PATCH 307/326] Some stylistic changes. --- Common/include/CConfig.hpp | 12 +---- Common/include/geometry/CPhysicalGeometry.hpp | 4 +- Common/src/CConfig.cpp | 4 +- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- SU2_CFD/include/numerics/CNumerics.hpp | 10 ++++- .../include/numerics/flow/flow_sources.hpp | 8 ++-- SU2_CFD/src/numerics/flow/flow_sources.cpp | 3 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 45 ++++++------------- 8 files changed, 35 insertions(+), 53 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3d77203870ac..b0017d4f943a 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -992,7 +992,6 @@ class CConfig { array mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */ array kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ - su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */ unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */ @@ -3091,14 +3090,6 @@ class CConfig { * has the marker val_marker. */ string GetMarker_Outlet_TagBound(unsigned short val_marker) const { return Marker_Outlet[val_marker]; } - - /*! - * \brief Get the index of the periodic surface defined in the geometry file. - * \param[in] val_marker - Value of the marker in which we are interested. - * \return Value of the index that is in the geometry file for the surface that - * has the marker val_marker. - */ - string GetMarker_Periodic_TagBound(unsigned short val_marker); /*! * \brief Get the index of the surface defined in the geometry file. @@ -6191,8 +6182,7 @@ class CConfig { const su2double *GetPeriodicTranslation(string val_marker) const; /*! - * \brief Get the translation vector for a periodic transformation. In streamwise periodic flow we currently only - * allow for one periodic boundary (pair) and there always acces val_index=0. + * \brief Get the translation vector for a periodic transformation. * \param[in] val_index - Index corresponding to the periodic transformation. * \return The translation vector. */ diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 664bac8a2985..4dd890d24557 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -107,7 +107,7 @@ class CPhysicalGeometry final : public CGeometry { vector GlobalMarkerStorageDispl; vector GlobalRoughness_Height; - su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/ + su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure/temperature computation only. Size nDim.*/ public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ @@ -471,7 +471,7 @@ class CPhysicalGeometry final : public CGeometry { * \brief For streamwise periodicity, find a unique reference node on the designated inlet. * \param[in] config - Definition of the particular problem. */ - void FindUniqueNode_PeriodicBound(CConfig *config) override; + void FindUniqueNode_PeriodicBound(CConfig *config) final; /*! * \brief Set boundary vertex structure of the control volume. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index c4598b690196..f5d5e2233afd 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4598,8 +4598,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); if (DiscreteAdjoint && Kind_Streamwise_Periodic == MASSFLOW) SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION); - if (Ref_Inc_NonDim != DIMENSIONAL && false) - SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\"", CURRENT_FUNCTION); + if (Ref_Inc_NonDim != DIMENSIONAL) + SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\", the nondimensionalization with source terms doesn;t work in general.", CURRENT_FUNCTION); if (Axisymmetric) SU2_MPI::Error("Streamwise Periodicity terms does not not have axisymmetric corrections.", CURRENT_FUNCTION); } else { diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index d5966a3d6cd4..ff83728e54bd 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7522,7 +7522,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- config container. ---*/ /*-------------------------------------------------------------------------------------------*/ - for (int iRank = 0; iRank < size; iRank++) { // loop over all vertices on that marker and fi + for (int iRank = 0; iRank < size; iRank++) { /*--- Get the norm of the current Point. ---*/ auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[iRank*nDim]); diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index f89a0cd61029..10b5f1d623ed 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1604,7 +1604,15 @@ class CNumerics { */ virtual inline void SetGamma(su2double val_Gamma_i, su2double val_Gamma_j) { } - virtual inline void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { } + /*! + * \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow. + * \param[in] massflow - massflow through periodic marker [kg/s]. + * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. + * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. + */ + virtual inline void SetStreamwise_Periodic_Values(const su2double massflow, + const su2double integratedHeat, + const su2double inletTemp) { } }; /*! diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index b19e46ea8fc8..b129934b2b85 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -60,10 +60,10 @@ class CSourceBase_Flow : public CNumerics { ~CSourceBase_Flow() override; /*! - * \brief Constructor of the class. - * \param[in] val_nDim - Number of dimensions of the problem. - * \param[in] val_nVar - Number of variables of the problem. - * \param[in] config - Definition of the particular problem. + * \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow. + * \param[in] massflow - massflow through periodic marker [kg/s]. + * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. + * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. */ void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { Streamwise_Periodic_MassFlow = massflow; diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 6d469ae4ec82..607800447527 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -692,7 +692,8 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { - const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 646a4638d042..6bc0cb604555 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1272,19 +1272,18 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (streamwise_periodic) { - numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); + numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, + Streamwise_Periodic_InletTemperature); /*--- Loop over all points ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) for (iPoint = 0; iPoint < nPointDomain; iPoint++) { /*--- Load the primitve variables ---*/ - numerics->SetPrimitive(nodes->GetPrimitive(iPoint), - NULL); + numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); /*--- Set incompressible density ---*/ - numerics->SetDensity(nodes->GetDensity(iPoint), - 0.0); + numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); /*--- Load the volume of the dual mesh cell ---*/ numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); @@ -1292,8 +1291,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- If viscous, we need gradients for extra terms. ---*/ if (viscous) { /*--- Gradient of the primitive variables ---*/ - numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), - NULL); + numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nullptr); } /*--- Compute the streamwise periodic source residual and add to the total ---*/ @@ -1307,13 +1305,14 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(!streamwise_periodic_temperature && energy) { CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; - second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); + second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, + Streamwise_Periodic_InletTemperature); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { /*--- Only "inlet"/donor periodic marker ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 1) { // here it doesnt matter whether 1 or 2 + config->GetMarker_All_PerBound(iMarker) == 1) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -1322,13 +1321,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (geometry->nodes->GetDomain(iPoint)) { /*--- Load the primitive variables ---*/ - second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL); + second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); /*--- Set the specific heat ---*/ second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); /*--- Set the Point coordinates ---*/ - second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint),NULL); + second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), nullptr); /*--- Set the area normal ---*/ second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); @@ -2938,9 +2937,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Streamwise_Periodic_InletTemperature = Temperature_Global; Streamwise_Periodic_MassFlow = MassFlow_Global; - if (rank == MASTER_NODE && false) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; } - if (rank == MASTER_NODE && false) { cout << "Average_Density_Global: " << Average_Density_Global << endl; } - if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { /*------------------------------------------------------------------------------------------------*/ /*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/ @@ -2956,7 +2952,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*--- Compute update to Delta p based on massflow-difference ---*/ ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); - + /*--- Store updated pressure difference ---*/ Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times @@ -2973,21 +2969,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge if((nZone==1 && InnerIter > 0) || (nZone>1 && OuterIter > 0)) config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); - - /*--- Output the new value of Delta P and ddp ---*/ - if ((rank == MASTER_NODE) && (iMesh == MESH_0) && false) { //TK:: Move whole computation up in front of output - - cout.precision(5); - cout.setf(ios::fixed, ios::floatfield); - - cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl; - cout << "New Delta P: " << Pressure_Drop_new * config->GetPressure_Ref() << endl; - - cout.unsetf(ios_base::floatfield); - - } // output + } // if massflow - + if (config->GetEnergy_Equation()) { /*---------------------------------------------------------------------------------------------*/ /*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/ @@ -3031,8 +3015,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Set the Integrated Heatflux ---*/ - if (iMesh == MESH_0) - Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; + Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; } // if energy } From 6b8299056aca2e2b8b8a2b7419767b6dc03cd2a9 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 24 Feb 2021 11:25:27 +0000 Subject: [PATCH 308/326] parallel regression instead of hybrid --- TestCases/hybrid_regression.py | 8 -------- TestCases/parallel_regression.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 8e16ca220292..d69473c646ff 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -178,14 +178,6 @@ def main(): turb_oneram6.test_vals = [-2.388851, -6.689340, 0.230320, 0.157649] test_list.append(turb_oneram6) - # ONERA M6 Wing - Newton-Krylov - turb_oneram6_nk = TestCase('turb_oneram6_nk') - turb_oneram6_nk.cfg_dir = "rans/oneram6" - turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" - turb_oneram6_nk.test_iter = 20 - turb_oneram6_nk.test_vals = [-4.915831, -4.538025, -11.447429, 0.217968, 0.046136, 2, -0.895273, 31.384] - test_list.append(turb_oneram6_nk) - # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 68dc0e3c29d2..2f18ab912e46 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -303,6 +303,17 @@ def main(): turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) + # ONERA M6 Wing - Newton-Krylov + turb_oneram6_nk = TestCase('turb_oneram6_nk') + turb_oneram6_nk.cfg_dir = "rans/oneram6" + turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" + turb_oneram6_nk.test_iter = 20 + turb_oneram6_nk.test_vals = [-4.892257, -4.514011, -11.432312, 0.221025, 0.045570, 2, -0.899459, 3.1384e+01] + turb_oneram6_nk.su2_exec = "mpirun -n 2 SU2_CFD" + turb_oneram6_nk.timeout = 600 + turb_oneram6_nk.tol = 0.0001 + test_list.append(turb_oneram6_nk) + # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" From 518ccd6fdc58ffea04734955c5da6c21bf88f522 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 24 Feb 2021 14:52:29 +0100 Subject: [PATCH 309/326] changed testcase a bit --- .../pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg | 9 +- .../pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 17 +-- .../pipeSlice_3d/pipeslice.geo | 112 ------------------ 3 files changed, 15 insertions(+), 123 deletions(-) delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg index c054326f6e04..9f62efd05f0d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg @@ -12,7 +12,6 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % SOLVER= INC_RANS -% KIND_TURB_MODEL= SST % % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -107,17 +106,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -CONV_RESIDUAL_MINVAL= -26 -CONV_STARTITER= 100000000 +CONV_FIELD= RMS_TEMPERATURE +CONV_RESIDUAL_MINVAL= -4.07 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % MESH_FILENAME= fluid_FFD.su2 % SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) -SCREEN_WRT_FREQ_INNER= 25 +SCREEN_WRT_FREQ_INNER= 100 % HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) +CONV_FILENAME= history_dptp % OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg index 65548b50b283..6bc3fdc39aef 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg @@ -12,7 +12,6 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % SOLVER= INC_RANS -% KIND_TURB_MODEL= SST % % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -50,10 +49,12 @@ PRANDTL_TURB= 0.90 KIND_STREAMWISE_PERIODIC= MASSFLOW STREAMWISE_PERIODIC_MASSFLOW= 0.85 STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -INC_OUTLET_DAMPING= 0.0001 +INC_OUTLET_DAMPING= 0.01 % STREAMWISE_PERIODIC_TEMPERATURE= NO -STREAMWISE_PERIODIC_OUTLET_HEAT= -6283.185307 +% Computation of outlet heat: Heatflux * Area = Heatflux * pi * radius (as we have an accumulated full circle) +% 5e5[W/m] * pi * 2e-3[m] +STREAMWISE_PERIODIC_OUTLET_HEAT= -3141.5926 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % @@ -78,7 +79,7 @@ MARKER_ANALYZE_AVERAGE = MASSFLUX % % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -ITER= 3500 +ITER= 10000 NUM_METHOD_GRAD= GREEN_GAUSS CFL_NUMBER= 1e2 % @@ -108,17 +109,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % CONV_CRITERIA= RESIDUAL -CONV_RESIDUAL_MINVAL= -26 -CONV_STARTITER= 100000000 +CONV_FIELD= RMS_TEMPERATURE +CONV_RESIDUAL_MINVAL= -10.9 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % MESH_FILENAME= fluid_FFD.su2 % SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) -SCREEN_WRT_FREQ_INNER= 25 +SCREEN_WRT_FREQ_INNER= 100 % HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) +CONV_FILENAME= history_mfhf % OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo deleted file mode 100644 index 214739f03472..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/pipeslice.geo +++ /dev/null @@ -1,112 +0,0 @@ -//-------------------------------------------------------------------------------------// -//Kattmann, 13.05.2018, 3D Butterfly mesh in a circular pipe -//-------------------------------------------------------------------------------------// - -// Evoque Meshing Algorithm? -Do_Meshing= 1; // 0=false, 1=true -// Write Mesh files in .su2 format -Write_mesh= 1; // 0=false, 1=true - -//Geometric inputs, ch: channel, Pin center is origin -Radius= 0.5e-2; // Pipe Radius -InnerBox= Radius/2; // Distance to the inner Block of the butterfly mesh - -//Mesh inputs -gridsize = 0.1; // unimportant once everything is structured - -//ch_box -Nbox = 30; // Inner Box points in x direction - -Ncircu = 30; // Outer ring circu. points -Rcircu = 0.9; // Spacing towards wall - -sqrtTwo = Cos(45*Pi/180); - -//-------------------------------------------------------------------------------------// -//Points -// Inner Box -Point(1) = {-InnerBox, -InnerBox, 0, gridsize}; -Point(2) = {-InnerBox, InnerBox, 0, gridsize}; -Point(3) = {InnerBox, InnerBox, 0, gridsize}; -Point(4) = {InnerBox, -InnerBox, 0, gridsize}; - -// Outer Ring -Point(5) = {-Radius*sqrtTwo, -Radius*sqrtTwo, 0, gridsize}; -Point(6) = {-Radius*sqrtTwo, Radius*sqrtTwo, 0, gridsize}; -Point(7) = {Radius*sqrtTwo, Radius*sqrtTwo, 0, gridsize}; -Point(8) = {Radius*sqrtTwo, -Radius*sqrtTwo, 0, gridsize}; - -Point(9) = {0,0,0,gridsize}; // Helper Point for circles - -//-------------------------------------------------------------------------------------// -//Lines -//Inner Box (clockwise) -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; - -//Walls (clockwise) -Circle(5) = {5, 9, 6}; -Circle(6) = {6, 9, 7}; -Circle(7) = {7, 9, 8}; -Circle(8) = {8, 9, 5}; - -//Connecting lines (outward facing) -Line(9) = {1, 5}; -Line(10) = {2, 6}; -Line(11) = {3, 7}; -Line(12) = {4, 8}; - -//-------------------------------------------------------------------------------------// -//Lineloops and surfaces -// Inner Box (clockwise) -Line Loop(1) = {1,2,3,4}; Plane Surface(1) = {1}; - -// Ring sections (clockwise starting at 9 o'clock) -Line Loop(2) = {5, -10, -1, 9}; Plane Surface(2) = {2}; -Line Loop(3) = {10, 6, -11, -2}; Plane Surface(3) = {3}; -Line Loop(4) = {-3, 11, 7, -12}; Plane Surface(4) = {4}; -Line Loop(5) = {12, 8, -9, -4}; Plane Surface(5) = {5}; - -//make structured mesh with transfinite lines -//radial -Transfinite Line{1, 2, 3, 4, 5, 6, 7, 8} = Nbox; -//circumferential -Transfinite Line{9, 10, 11, 12} = Ncircu Using Progression Rcircu; - -Transfinite Surface{1,2,3,4,5}; -Recombine Surface{1,2,3,4,5}; - -//Extrude 1 mesh layer -Extrude {0, 0, 0.0005} { - Surface{1}; Surface{2}; Surface{3}; Surface{4}; Surface{5}; - Layers{1}; - Recombine; -} -Coherence; - -//Physical groups made with GUI -Physical Surface("inlet") = {4, 1, 5, 3, 2}; -Physical Surface("outlet") = {100, 122, 56, 78, 34}; -Physical Surface("wall") = {69, 95, 113, 43}; -Physical Volume("fluid") = {1, 2, 3, 4, 5}; - -// ----------------------------------------------------------------------------------- // -// Meshing -Transfinite Surface "*"; -Recombine Surface "*"; - -If (Do_Meshing == 1) - Mesh 1; Mesh 2; Mesh 3; -EndIf - -// ----------------------------------------------------------------------------------- // -// Write .su2 meshfile -If (Write_mesh == 1) - - Mesh.Format = 42; // .su2 mesh format, - Save "pipe1cell3D.su2"; - -EndIf - From b8f45000b0944985b6742e5414cef321064f361f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 24 Feb 2021 15:38:40 +0100 Subject: [PATCH 310/326] Cleaning regression test files --- .../half_cylinder_2D/half_cylinder_2D.cfg | 94 -------- .../pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg | 201 ----------------- .../pinArray_2d/sp_pinArray_2d_mf_hf.cfg | 204 ------------------ TestCases/parallel_regression.py | 49 +++++ TestCases/parallel_regression_AD.py | 15 +- TestCases/streamwise_periodic_regression.py | 163 -------------- TestCases/tutorials.py | 25 ++- 7 files changed, 86 insertions(+), 665 deletions(-) delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg delete mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg delete mode 100755 TestCases/streamwise_periodic_regression.py diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg deleted file mode 100644 index 71fdb1b12b51..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/half_cylinder_2D/half_cylinder_2D.cfg +++ /dev/null @@ -1,94 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Poiseuille flow case for testing a body force/periodicity % -% Author: T. Kattmann % -% Institution: Robert Bosch GmbH % -% Date: 20.05.2020 % -% File Version 7.0.8 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_NAVIER_STOKES -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_DENSITY_INIT= 1.0 -INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) -INC_NONDIM= DIMENSIONAL -% -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 1e-4 -% -% ---------------------------- ENERGY EQUATION -------------------------------% -% -INC_ENERGY_EQUATION= YES -SPECIFIC_HEAT_CP= 3540.0 -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM= 1.17 -% -% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% -% -KIND_STREAMWISE_PERIODIC= MASSFLOW -STREAMWISE_PERIODIC_MASSFLOW= 0.0027 -STREAMWISE_PERIODIC_PRESSURE_DROP= 8.0 -INC_OUTLET_DAMPING= 0.1 -% -STREAMWISE_PERIODIC_TEMPERATURE= YES -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_HEATFLUX= ( fluid_top, 0.0, \ - fluid_pin_interface, 5e5 ) -MARKER_SYM= ( fluid_sym ) -MARKER_PERIODIC= ( inlet, outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.008,0.0,0.0 ) -% -MARKER_MONITORING= ( fluid_pin_interface ) -MARKER_ANALYZE = ( inlet, outlet ) -MARKER_ANALYZE_AVERAGE = MASSFLUX -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -CFL_NUMBER= 1e4 -ITER= 400 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-15 -LINEAR_SOLVER_ITER= 20 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 -TIME_DISCRE_FLOW= EULER_IMPLICIT - -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -KIND_TURB_MODEL= NONE -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -CONV_RESIDUAL_MINVAL= -24 -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 -% -MESH_FILENAME= channel_bump_2D.su2 -% -SCREEN_WRT_FREQ_INNER= 100 -% -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg deleted file mode 100644 index 9f62efd05f0d..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_dp_hf_tp.cfg +++ /dev/null @@ -1,201 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) % -% Author: T. Kattmann % -% Institution: Robert Bosch GmbH % -% Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_DENSITY_INIT= 1045.0 -INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) -% -INC_ENERGY_EQUATION = YES -INC_TEMPERATURE_INIT= 338.0 -INC_NONDIM= DIMENSIONAL -SPECIFIC_HEAT_CP= 3540.0 -% -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 0.001385 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] -% = 1.385e-3 * 3540 / 0.42 -% = 11.7 -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM= 11.7 -% -TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -PRANDTL_TURB= 0.90 -% -% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% -% -KIND_STREAMWISE_PERIODIC= PRESSURE_DROP -STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -%STREAMWISE_PERIODIC_MASSFLOW= 0.85 -%INC_OUTLET_DAMPING= 0.01 -% -STREAMWISE_PERIODIC_TEMPERATURE= YES -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, \ - fluid_pin2_interface, 5e5, \ - fluid_pin3_interface, 5e5 ) -MARKER_SYM= ( fluid_symmetry ) -MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) -% -% Alternative to periodic simulation with velocity inlet and pressure outlet -%INC_INLET_TYPE= VELOCITY_INLET -%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -%INC_OUTLET_TYPE= PRESSURE_OUTLET -%MARKER_OUTLET= ( fluid_outlet, 0.0 ) -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_MONITORING= ( fluid_pin2_interface ) -% -MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -MARKER_ANALYZE_AVERAGE = MASSFLUX -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -ITER= 3500 -NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 1e2 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1e-3 -LINEAR_SOLVER_ITER= 20 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE -% -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= NONE -% -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -CONV_FIELD= RMS_TEMPERATURE -CONV_RESIDUAL_MINVAL= -4.07 -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -MESH_FILENAME= fluid_FFD.su2 -% -SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) -SCREEN_WRT_FREQ_INNER= 100 -% -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) -CONV_FILENAME= history_dptp -% -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) -VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) -OUTPUT_WRT_FREQ= 5000 -% -% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% -% -FFD_TOLERANCE= 1E-10 -FFD_ITERATIONS= 500 -% -% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, -% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) -FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) -% -% FFD box degree: 2D case (x_degree, y_degree, 0) -FFD_DEGREE= (8, 1, 0) -% -% Surface grid continuity at the intersection with the faces of the FFD boxes. -% To keep a particular level of surface continuity, SU2 automatically freezes the right -% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) -FFD_CONTINUITY= NO_DERIVATIVE -% -% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% -% -DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D -% -% Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface ) -% -% Parameters of the shape deformation -% - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) -DV_PARAM= ( 1.0 ) -%DV_PARAM= \ -%( BOX, 0, 1, 0.0, 1.0);\ -%( BOX, 1, 1, 0.0, 1.0);\ -%( BOX, 2, 1, 0.0, 1.0);\ -%( BOX, 3, 1, 0.0, 1.0);\ -%( BOX, 4, 1, 0.0, 1.0);\ -%( BOX, 5, 1, 0.0, 1.0);\ -%( BOX, 6, 1, 0.0, 1.0);\ -%( BOX, 7, 1, 0.0, 1.0);\ -%( BOX, 8, 1, 0.0, 1.0) -% -% Value of the shape deformation -DV_VALUE= 1.0 -%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 -% -% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% -% -DEFORM_LINEAR_SOLVER= FGMRES -DEFORM_LINEAR_SOLVER_PREC= ILU -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -DEFORM_NONLINEAR_ITER= 1 -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -DEFORM_CONSOLE_OUTPUT= YES -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger -% value is also possible) -% !!! What is this doing !!! -DEFORM_COEFF = 1E6 -% -DEFINITION_DV= \ -( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) -%DEFORM_MESH= YES -% -% Finite difference step size for python scripts (0.001 default, recommended -% 0.001 x REF_LENGTH) -FIN_DIFF_STEP= 1e-6 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg deleted file mode 100644 index 6bc3fdc39aef..000000000000 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pinArray_2d/sp_pinArray_2d_mf_hf.cfg +++ /dev/null @@ -1,204 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) % -% Author: T. Kattmann % -% Institution: Robert Bosch GmbH % -% Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_DENSITY_INIT= 1045.0 -INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) -% -INC_ENERGY_EQUATION = YES -INC_TEMPERATURE_INIT= 338.0 -INC_NONDIM= DIMENSIONAL -SPECIFIC_HEAT_CP= 3540.0 -% -FREESTREAM_TURBULENCEINTENSITY= 0.05 -FREESTREAM_TURB2LAMVISCRATIO= 10.0 -% -% --------------------------- VISCOSITY MODEL ---------------------------------% -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 0.001385 -% -% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% -% -% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] -% = 1.385e-3 * 3540 / 0.42 -% = 11.7 -CONDUCTIVITY_MODEL= CONSTANT_PRANDTL -PRANDTL_LAM= 11.7 -% -TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB -PRANDTL_TURB= 0.90 -% -% --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% -% -KIND_STREAMWISE_PERIODIC= MASSFLOW -STREAMWISE_PERIODIC_MASSFLOW= 0.85 -STREAMWISE_PERIODIC_PRESSURE_DROP= 208.023676 -INC_OUTLET_DAMPING= 0.01 -% -STREAMWISE_PERIODIC_TEMPERATURE= NO -% Computation of outlet heat: Heatflux * Area = Heatflux * pi * radius (as we have an accumulated full circle) -% 5e5[W/m] * pi * 2e-3[m] -STREAMWISE_PERIODIC_OUTLET_HEAT= -3141.5926 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_HEATFLUX= ( fluid_pin1_interface, 5e5, \ - fluid_pin2_interface, 5e5, \ - fluid_pin3_interface, 5e5 ) -MARKER_SYM= ( fluid_symmetry ) -MARKER_PERIODIC= ( fluid_inlet, fluid_outlet, 0.0,0.0,0.0, 0.0,0.0,0.0, 0.0111544,0.0,0.0 ) -% -% Alternative to periodic simulation with velocity inlet and pressure outlet -%INC_INLET_TYPE= VELOCITY_INLET -%MARKER_INLET= ( fluid_inlet, 338.0, 0.75, 1.0, 0.0, 0.0 ) -%INC_OUTLET_TYPE= PRESSURE_OUTLET -%MARKER_OUTLET= ( fluid_outlet, 0.0 ) -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% -MARKER_MONITORING= ( fluid_pin2_interface ) -% -MARKER_ANALYZE = ( fluid_outlet, fluid_inlet ) -MARKER_ANALYZE_AVERAGE = MASSFLUX -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -ITER= 10000 -NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 1e2 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1e-3 -LINEAR_SOLVER_ITER= 20 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE -% -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= NONE -% -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_CRITERIA= RESIDUAL -CONV_FIELD= RMS_TEMPERATURE -CONV_RESIDUAL_MINVAL= -10.9 -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -MESH_FILENAME= fluid_FFD.su2 -% -SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, STREAMWISE_MASSFLOW, STREAMWISE_DP) -SCREEN_WRT_FREQ_INNER= 100 -% -HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, AERO_COEFF ) -CONV_FILENAME= history_mfhf -% -OUTPUT_FILES= ( RESTART, PARAVIEW_MULTIBLOCK ) -VOLUME_OUTPUT= ( COORDINATES, SOLUTION, RESIDUAL, PRIMITIVE ) -OUTPUT_WRT_FREQ= 5000 -% -% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% -% -FFD_TOLERANCE= 1E-10 -FFD_ITERATIONS= 500 -% -% FFD box definition: 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, -% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) -FFD_DEFINITION= (BOX, 0.0029772,0.0,0.0, 0.0081772,0.0,0.0 0.0081772,0.0026,0.0, 0.0029772,0.0026,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0 0.0,0.0,0.0, 0.0,0.0,0.0 ) -% -% FFD box degree: 2D case (x_degree, y_degree, 0) -FFD_DEGREE= (8, 1, 0) -% -% Surface grid continuity at the intersection with the faces of the FFD boxes. -% To keep a particular level of surface continuity, SU2 automatically freezes the right -% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) -FFD_CONTINUITY= NO_DERIVATIVE -% -% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% -% -DV_KIND= FFD_SETTING -%DV_KIND= FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D,FFD_CONTROL_POINT_2D -% -% Marker of the surface in which we are going apply the shape deformation -DV_MARKER= ( fluid_pin2_interface ) -% -% Parameters of the shape deformation -% - FFD_SETTING ( 1.0 ) -% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) -DV_PARAM= ( 1.0 ) -%DV_PARAM= \ -%( BOX, 0, 1, 0.0, 1.0);\ -%( BOX, 1, 1, 0.0, 1.0);\ -%( BOX, 2, 1, 0.0, 1.0);\ -%( BOX, 3, 1, 0.0, 1.0);\ -%( BOX, 4, 1, 0.0, 1.0);\ -%( BOX, 5, 1, 0.0, 1.0);\ -%( BOX, 6, 1, 0.0, 1.0);\ -%( BOX, 7, 1, 0.0, 1.0);\ -%( BOX, 8, 1, 0.0, 1.0) -% -% Value of the shape deformation -DV_VALUE= 1.0 -%DV_VALUE= 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 -% -% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% -% -DEFORM_LINEAR_SOLVER= FGMRES -DEFORM_LINEAR_SOLVER_PREC= ILU -DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -DEFORM_NONLINEAR_ITER= 1 -DEFORM_LINEAR_SOLVER_ITER= 1000 -% -DEFORM_CONSOLE_OUTPUT= YES -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE -% -% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger -% value is also possible) -% !!! What is this doing !!! -DEFORM_COEFF = 1E6 -% -DEFINITION_DV= \ -( 19, 1.0 | fluid_pin2_interface | BOX, 0, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 1, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 2, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 3, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 4, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 5, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 6, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 7, 1, 0.0, 1.0 ); \ -( 19, 1.0 | fluid_pin2_interface | BOX, 8, 1, 0.0, 1.0 ) -%DEFORM_MESH= YES -% -% Finite difference step size for python scripts (0.001 default, recommended -% 0.001 x REF_LENGTH) -FIN_DIFF_STEP= 1e-6 diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 68dc0e3c29d2..e72ef2133954 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -452,6 +452,17 @@ def main(): inc_lam_bend.tol = 0.00001 test_list.append(inc_lam_bend) + # 3D laminar channnel with 1 cell in flow direction, streamwise periodic + sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') + sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" + sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" + sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 + sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -8.694310, -0.000023] #last 4 lines + sp_pipeSlice_3d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pipeSlice_3d_dp_hf_tp.timeout = 1600 + sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 + test_list.append(sp_pipeSlice_3d_dp_hf_tp) + ############################ ### Incompressible RANS ### ############################ @@ -1232,6 +1243,30 @@ def main(): cht_compressible.tol = 0.00001 test_list.append(cht_compressible) + # 2D CHT case with HF BC and + sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') + sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" + sp_pinArray_cht_2d_mf_hf.test_iter = 100 + sp_pinArray_cht_2d_mf_hf.test_vals = [0.247022, -0.812199, -0.974877, -0.753315, 208.023676, 349.950000] #last 7 lines + sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pinArray_cht_2d_mf_hf.timeout = 1600 + sp_pinArray_cht_2d_mf_hf.tol = 0.00001 + sp_pinArray_cht_2d_mf_hf.multizone = True + test_list.append(sp_pinArray_cht_2d_mf_hf) + + # simple small 3D pin case massflow periodic with heatflux BC + sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') + sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" + sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" + sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.451732, -0.008477, 214.707868, 365.670000] #last 7 lines + sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 + sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 + sp_pinArray_3d_cht_mf_hf_tp.multizone = True + test_list.append(sp_pinArray_3d_cht_mf_hf_tp) + ########################## ### Python wrapper ### ########################## @@ -1585,6 +1620,20 @@ def main(): pass_list.append(sphere_ffd_def_bspline.run_def()) test_list.append(sphere_ffd_def_bspline) + # 2D FD case cht, pressure drop, heat obj function + fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') + fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" + fd_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + fd_sp_pinArray_cht_2d_dp_hf.su2_exec = "finite_differences.py -z 2 -n 2 -f" + fd_sp_pinArray_cht_2d_dp_hf.timeout = 1600 + fd_sp_pinArray_cht_2d_dp_hf.reference_file = "of_grad_findiff.csv.ref" + fd_sp_pinArray_cht_2d_dp_hf.test_file = "FINDIFF/of_grad_findiff.csv" + fd_sp_pinArray_cht_2d_dp_hf.multizone = True + + pass_list.append(fd_sp_pinArray_cht_2d_dp_hf.run_filediff()) + test_list.append(fd_sp_pinArray_cht_2d_dp_hf) + # Tests summary print('==================================================================') diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index daf5969d201b..d3e3899e7d94 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -321,8 +321,19 @@ def main(): discadj_cht.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_cht.timeout = 1600 discadj_cht.tol = 0.00001 - test_list.append(discadj_cht) - + test_list.append(discadj_cht) + + # 2D DA cht case 2 zones avg temp objective + da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') + da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" + da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.065832, -4.137121] #last 4 lines + da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" + da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 + da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 + da_sp_pinArray_cht_2d_dp_hf.multizone = True + test_list.append(da_sp_pinArray_cht_2d_dp_hf) ###################################### ### RUN TESTS ### diff --git a/TestCases/streamwise_periodic_regression.py b/TestCases/streamwise_periodic_regression.py deleted file mode 100755 index ed517940b8df..000000000000 --- a/TestCases/streamwise_periodic_regression.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python - -## \file serial_regression.py -# \brief Python script for automated regression testing of SU2 examples -# \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.0.4 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -from __future__ import print_function, division, absolute_import -import sys -from TestCase import TestCase - -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 - to make sure nothing is broken. ''' - - test_list = [] - - ################################# - ## Streamwise Periodic primal ### - ################################# - - # Laminar cylinder in channel, streamwise periodic - streamwise_periodic_cylinder = TestCase('streamwise_periodic_cylinder') - streamwise_periodic_cylinder.cfg_dir = "incomp_navierstokes/streamwise_periodic/half_cylinder_2D" - streamwise_periodic_cylinder.cfg_file = "half_cylinder_2D.cfg" - streamwise_periodic_cylinder.test_iter = 30 - streamwise_periodic_cylinder.test_vals = [30.000000, -7.819176, -6.796437, -6.969024] #last 4 lines - streamwise_periodic_cylinder.su2_exec = "mpirun -n 2 SU2_CFD" - streamwise_periodic_cylinder.timeout = 1600 - streamwise_periodic_cylinder.tol = 0.00001 - test_list.append(streamwise_periodic_cylinder) - - # 3D laminar channnel with 1 cell in flow direction, streamwise periodic - sp_pipeSlice_3d_dp_hf_tp = TestCase('sp_pipeSlice_3d_dp_hf_tp') - sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" - sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" - sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 - sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -8.694310, -0.000023] #last 4 lines - sp_pipeSlice_3d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pipeSlice_3d_dp_hf_tp.timeout = 1600 - sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 - test_list.append(sp_pipeSlice_3d_dp_hf_tp) - - # 2D pin case pressure drop periodic with heatflux BC and temperature periodicity - sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') - sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" - sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" - sp_pinArray_2d_dp_hf_tp.test_iter = 25 - sp_pinArray_2d_dp_hf_tp.test_vals = [-4.667133, 1.395801, -0.709306, 208.023676] #last 4 lines - sp_pinArray_2d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pinArray_2d_dp_hf_tp.timeout = 1600 - sp_pinArray_2d_dp_hf_tp.tol = 0.00001 - #test_list.append(sp_pinArray_2d_dp_hf_tp) - - # 2D pin case massflow periodic with heatflux BC and prescribed heat - sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') - sp_pinArray_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" - sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" - sp_pinArray_2d_mf_hf.test_iter = 25 - sp_pinArray_2d_mf_hf.test_vals = [-4.666406, 1.398210, -0.710070, 208.677550] #last 4 lines - sp_pinArray_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pinArray_2d_mf_hf.timeout = 1600 - sp_pinArray_2d_mf_hf.tol = 0.00001 - test_list.append(sp_pinArray_2d_mf_hf) - - # 2D CHT case with HF BC and - sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') - sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" - sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" - sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [0.247022, -0.812199, -0.974877, -0.753315, 208.023676, 349.950000] #last 7 lines - sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pinArray_cht_2d_mf_hf.timeout = 1600 - sp_pinArray_cht_2d_mf_hf.tol = 0.00001 - sp_pinArray_cht_2d_mf_hf.multizone = True - test_list.append(sp_pinArray_cht_2d_mf_hf) - - # simple small 3D pin case massflow periodic with heatflux BC - sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') - sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" - sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" - sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.511984, -3.063453, -0.451732, -0.008477, 214.707868, 365.670000] #last 7 lines - sp_pinArray_3d_cht_mf_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pinArray_3d_cht_mf_hf_tp.timeout = 1600 - sp_pinArray_3d_cht_mf_hf_tp.tol = 0.00001 - sp_pinArray_3d_cht_mf_hf_tp.multizone = True - test_list.append(sp_pinArray_3d_cht_mf_hf_tp) - - ################################## - ## Streamwise Periodic adjoint ### - ################################## - - # 2D DA case single zone pressure drop - da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') - da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" - da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" - da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.793283, -4.065832, -4.137121] #last 4 lines - da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" - da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 - da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 - da_sp_pinArray_cht_2d_dp_hf.multizone = True - test_list.append(da_sp_pinArray_cht_2d_dp_hf) - - ###################################### - ### RUN TESTS ### - ###################################### - - pass_list = [ test.run_test() for test in test_list ] - - # 2D DA case cht pressure drop, heat obj function - fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') - fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" - fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" - fd_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - fd_sp_pinArray_cht_2d_dp_hf.su2_exec = "finite_differences.py -z 2 -n 2 -f" - fd_sp_pinArray_cht_2d_dp_hf.timeout = 1600 - fd_sp_pinArray_cht_2d_dp_hf.reference_file = "of_grad_findiff.csv.ref" - fd_sp_pinArray_cht_2d_dp_hf.test_file = "FINDIFF/of_grad_findiff.csv" - fd_sp_pinArray_cht_2d_dp_hf.multizone = True - pass_list.append(fd_sp_pinArray_cht_2d_dp_hf.run_filediff()) - test_list.append(fd_sp_pinArray_cht_2d_dp_hf) - - # Tests summary - print('==================================================================') - print('Summary of the serial tests') - print('python version:', sys.version) - for i, test in enumerate(test_list): - if (pass_list[i]): - print(' passed - %s'%test.tag) - else: - print('* FAILED - %s'%test.tag) - - if all(pass_list): - sys.exit(0) - else: - sys.exit(1) - # done - -if __name__ == '__main__': - main() diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 27d2d6125f97..f9149b148ba6 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -42,6 +42,30 @@ def main(): ### RUN TUTORIAL CASES ### ###################################### + ### Incompressible Flow + + # 2D pin case massflow periodic with heatflux BC and prescribed extracted outlet heat + sp_pinArray_2d_mf_hf = TestCase('sp_pinArray_2d_mf_hf') + sp_pinArray_2d_mf_hf.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" + sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" + sp_pinArray_2d_mf_hf.test_iter = 25 + sp_pinArray_2d_mf_hf.test_vals = [-4.600340, 1.470386, -0.778623, 266.569743] #last 4 lines + sp_pinArray_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pinArray_2d_mf_hf.timeout = 1600 + sp_pinArray_2d_mf_hf.tol = 0.00001 + test_list.append(sp_pinArray_2d_mf_hf) + + # 2D pin case pressure drop periodic with heatflux BC and temperature periodicity + sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') + sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" + sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" + sp_pinArray_2d_dp_hf_tp.test_iter = 25 + sp_pinArray_2d_dp_hf_tp.test_vals = [-4.667133, 1.395801, -0.709306, 208.023676] #last 4 lines + sp_pinArray_2d_dp_hf_tp.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pinArray_2d_dp_hf_tp.timeout = 1600 + sp_pinArray_2d_dp_hf_tp.tol = 0.00001 + test_list.append(sp_pinArray_2d_dp_hf_tp) + ### Compressible Flow # Inviscid Bump @@ -151,7 +175,6 @@ def main(): tutorial_nicfd_nozzle.no_restart = True test_list.append(tutorial_nicfd_nozzle) - # Unsteady NACA0012 tutorial_unst_naca0012 = TestCase('unsteady_naca0012') tutorial_unst_naca0012.cfg_dir = "../Tutorials/compressible_flow/Unsteady_NACA0012" From 46bb5001d990b6def98deea758eedb027d6c62b7 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 24 Feb 2021 19:05:06 +0000 Subject: [PATCH 311/326] Fix skin friction coefficient --- .../include/solvers/CFVMFlowSolverBase.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.inl | 11 +++-- SU2_CFD/src/solvers/CNSSolver.cpp | 40 +++++++------------ 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 393cf0ed2ca0..e1673fb1fedc 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -2413,7 +2413,7 @@ class CFVMFlowSolverBase : public CSolver { */ inline su2double GetCSkinFriction(unsigned short val_marker, unsigned long val_vertex, unsigned short val_dim) const final { - return CSkinFriction[val_marker][val_dim][val_vertex]; + return CSkinFriction[val_marker](val_vertex,val_dim); } /*! diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 4b4ed6ce4ede..598d38ff636c 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -197,9 +197,7 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { /*--- Skin friction in all the markers ---*/ - CSkinFriction.resize(nMarker); - for (iMarker = 0; iMarker < nMarker; iMarker++) - CSkinFriction[iMarker].resize(nDim, nVertex[iMarker]) = su2double(0.0); + Alloc3D(nMarker, nVertex, nDim, CSkinFriction); /*--- Wall Shear Stress in all the markers ---*/ @@ -2412,8 +2410,8 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr unsigned long iVertex, iPoint, iPointNormal; unsigned short iMarker, iMarker_Monitoring, iDim, jDim; unsigned short T_INDEX = 0, TVE_INDEX = 0, VEL_INDEX = 0; - su2double Viscosity = 0.0, WallDist[3] = {0.0}, Area, TauNormal, RefVel2 = 0.0, dTn, dTven, - RefDensity = 0.0, GradTemperature, Density = 0.0, WallDistMod, FrictionVel, + su2double Viscosity = 0.0, WallDist[3] = {0.0}, Area, TauNormal, dTn, dTven, + GradTemperature, Density = 0.0, WallDistMod, FrictionVel, UnitNormal[3] = {0.0}, TauElem[3] = {0.0}, TauTangent[3] = {0.0}, Tau[3][3] = {{0.0}}, Cp, thermal_conductivity, MaxNorm = 8.0, Grad_Vel[3][3] = {{0.0}}, Grad_Temp[3] = {0.0}, AxiFactor; const su2double *Coord = nullptr, *Coord_Normal = nullptr, *Normal = nullptr; @@ -2443,6 +2441,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr } const su2double factor = 1.0 / AeroCoeffForceRef; + const su2double factorFric = config->GetRefArea() * factor; /*--- Variables initialization ---*/ @@ -2546,7 +2545,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr WallShearStress[iMarker][iVertex] = 0.0; for (iDim = 0; iDim < nDim; iDim++) { TauTangent[iDim] = TauElem[iDim] - TauNormal * UnitNormal[iDim]; - CSkinFriction[iMarker][iDim][iVertex] = TauTangent[iDim] / (0.5 * RefDensity * RefVel2); + CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric; WallShearStress[iMarker][iVertex] += TauTangent[iDim] * TauTangent[iDim]; } WallShearStress[iMarker][iVertex] = sqrt(WallShearStress[iMarker][iVertex]); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 4ac75e2874d7..915e296c0399 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -184,16 +184,11 @@ void CNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolv void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *config) { unsigned long iVertex; - unsigned short Boundary, Monitoring, iMarker, iMarker_Monitoring, iDim; + unsigned short iMarker, iMarker_Monitoring; const su2double* Vel_FS = Velocity_Inf; - su2double VelMag_FS = 0.0, SkinFrictionMag = 0.0, SkinFrictionDot = 0.0, *Normal, Area, Sref = config->GetRefArea(); - su2double k = config->GetBuffet_k(), lam = config->GetBuffet_lambda(); - string Marker_Tag, Monitoring_Tag; + const su2double k = config->GetBuffet_k(), lam = config->GetBuffet_lambda(), Sref = config->GetRefArea(); - for (iDim = 0; iDim < nDim; iDim++){ - VelMag_FS += Vel_FS[iDim]*Vel_FS[iDim]; - } - VelMag_FS = sqrt(VelMag_FS); + const su2double VelMag_FS = GeometryToolbox::Norm(nDim, Vel_FS); /*-- Variables initialization ---*/ @@ -209,10 +204,9 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf Buffet_Metric[iMarker] = 0.0; - Boundary = config->GetMarker_All_KindBC(iMarker); - Monitoring = config->GetMarker_All_Monitoring(iMarker); + const auto Monitoring = config->GetMarker_All_Monitoring(iMarker); - if ((Boundary == HEAT_FLUX) || (Boundary == ISOTHERMAL) || (Boundary == HEAT_FLUX) || (Boundary == CHT_WALL_INTERFACE)) { + if (config->GetViscous_Wall(iMarker)) { /*--- Loop over the vertices to compute the buffet sensor ---*/ @@ -220,13 +214,8 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf /*--- Perform dot product of skin friction with freestream velocity ---*/ - SkinFrictionMag = 0.0; - SkinFrictionDot = 0.0; - for(iDim = 0; iDim < nDim; iDim++){ - SkinFrictionMag += pow(CSkinFriction[iMarker][iDim][iVertex], 2); - SkinFrictionDot += CSkinFriction[iMarker][iDim][iVertex]*Vel_FS[iDim]; - } - SkinFrictionMag = sqrt(SkinFrictionMag); + const su2double SkinFrictionMag = GeometryToolbox::Norm(nDim, CSkinFriction[iMarker][iVertex]); + su2double SkinFrictionDot = GeometryToolbox::DotProduct(nDim, CSkinFriction[iMarker][iVertex], Vel_FS); /*--- Normalize the dot product ---*/ @@ -238,10 +227,10 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf /*--- Integrate buffet sensor ---*/ - if(Monitoring == YES){ + if (Monitoring == YES){ - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, Normal); + auto Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + su2double Area = GeometryToolbox::Norm(nDim, Normal); Buffet_Metric[iMarker] += Buffet_Sensor[iMarker][iVertex]*Area/Sref; @@ -249,16 +238,17 @@ void CNSSolver::Buffet_Monitoring(const CGeometry *geometry, const CConfig *conf } - if(Monitoring == YES){ + if (Monitoring == YES){ Total_Buffet_Metric += Buffet_Metric[iMarker]; /*--- Per surface buffet metric ---*/ for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { - Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); - Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if (Marker_Tag == Monitoring_Tag) Surface_Buffet_Metric[iMarker_Monitoring] = Buffet_Metric[iMarker]; + auto Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); + auto Marker_Tag = config->GetMarker_All_TagBound(iMarker); + if (Marker_Tag == Monitoring_Tag) + Surface_Buffet_Metric[iMarker_Monitoring] = Buffet_Metric[iMarker]; } } From 546725de794f045288762f780bac2c0dd1d7f184 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 25 Feb 2021 08:45:42 +0100 Subject: [PATCH 312/326] Updated config_template --- .github/workflows/regression.yml | 4 +--- config_template.cfg | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index cbeb311079a4..0120514d6bea 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -56,7 +56,7 @@ jobs: strategy: fail-fast: false matrix: - testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py','streamwise_periodic_regression.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py'] + testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py'] include: - testscript: 'tutorials.py' tag: MPI @@ -64,8 +64,6 @@ jobs: tag: MPI - testscript: 'parallel_regression_AD.py' tag: MPI - - testscript: 'streamwise_periodic_regression.py' - tag: MPI - testscript: 'serial_regression.py' tag: NoMPI - testscript: 'serial_regression_AD.py' diff --git a/config_template.cfg b/config_template.cfg index cfc5fc19adc5..6bb5d909c021 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -711,8 +711,8 @@ STREAMWISE_PERIODIC_TEMPERATURE= NO % % Prescibe integrated heat [W] extracted at the periodic "outlet". % Only active if STREAMWISE_PERIODIC_TEMPERATURE= NO. -% If set to zero, the heat is integrated by the program over the MARKER_HEATFLUX. -% Are MARKER_ISOTHERMAL possible? they should be. +% If set to zero, the heat is integrated automatically over all present MARKER_HEATFLUX. +% Upon convergence, the area averaged inlet temperature will be INC_TEMPERATURE_INIT. % Defaults to 0.0. STREAMWISE_PERIODIC_OUTLET_HEAT= 0.0 % From 19e58e26b062eb1a955125461b4c3db81e97c584 Mon Sep 17 00:00:00 2001 From: Max Sagebaum Date: Thu, 25 Feb 2021 10:45:40 +0100 Subject: [PATCH 313/326] Update of MeDiPack. --- externals/medi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/medi b/externals/medi index b84cef4272ab..6aef76912e70 160000 --- a/externals/medi +++ b/externals/medi @@ -1 +1 @@ -Subproject commit b84cef4272ab8bad981c0d0386d855daa8fbd340 +Subproject commit 6aef76912e7099c4f08c9705848797ca9e8070da From 67554857fbfb6b96f93d215e167894ebeb64f914 Mon Sep 17 00:00:00 2001 From: Max Sagebaum Date: Thu, 25 Feb 2021 12:03:35 +0100 Subject: [PATCH 314/326] Update of MeDiPack submodule hash. --- 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 e284ecc59b40..fe0cc063aa98 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -46,7 +46,7 @@ def init_submodules(method = 'auto'): # The sha tag must be maintained manually to point to the correct commit sha_version_codi = '1b8d3f5f03de560fb63a2a76ad91ab7bb3fa67d8' github_repo_codi = 'https://github.com/scicompkl/CoDiPack' - sha_version_medi = 'b84cef4272ab8bad981c0d0386d855daa8fbd340' + sha_version_medi = '6aef76912e7099c4f08c9705848797ca9e8070da' github_repo_medi = 'https://github.com/SciCompKL/MeDiPack' sha_version_meson = '29ef4478df6d3aaca40c7993f125b29409be1de2' github_repo_meson = 'https://github.com/mesonbuild/meson' From 569799380a9b678923e3f74e18225e2b738f808b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 25 Feb 2021 16:14:53 +0100 Subject: [PATCH 315/326] Adress lgtm problem of possible overflow before array eval. --- Common/src/geometry/CPhysicalGeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index e3cefb4721e8..a198e86d5dbf 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7476,7 +7476,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { su2double min_norm = 0.0; vector Buffer_Send_RefNode(nDim, 1e300), - Buffer_Recv_RefNode(size*nDim); + Buffer_Recv_RefNode(static_cast(size)*nDim); /*-------------------------------------------------------------------------------------------*/ /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ @@ -7525,7 +7525,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { for (int iRank = 0; iRank < size; iRank++) { /*--- Get the norm of the current Point. ---*/ - auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[iRank*nDim]); + auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[static_cast(iRank)*nDim]); /*--- Check if new unique reference node is found. ---*/ if (norm < min_norm || iRank == 0) { From 69a26d903f10f18db7e20f8d0bbb01f2680c50ab Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 26 Feb 2021 10:48:02 +0000 Subject: [PATCH 316/326] fix legacy build, cleanup useless code --- SU2_CFD/src/output/COutput.cpp | 83 ++++++++++++---------------------- preconfigure.py | 2 +- 2 files changed, 30 insertions(+), 55 deletions(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 30b70e83fef6..f3b8b5eacaff 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -912,34 +912,9 @@ bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) { /*--- Apply the same convergence criteria to all the processors ---*/ -#ifdef HAVE_MPI - - unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; - sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; - rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; - - /*--- Convergence criteria ---*/ - - sbuf_conv[0] = convergence; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); - - /*-- Compute global convergence criteria in the master node --*/ - - sbuf_conv[0] = 0; - if (rank == MASTER_NODE) { - if (rbuf_conv[0] == size) sbuf_conv[0] = 1; - else sbuf_conv[0] = 0; - } - - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, SU2_MPI::GetComm()); - - if (sbuf_conv[0] == 1) { convergence = true; } - else { convergence = false; } - - delete [] sbuf_conv; - delete [] rbuf_conv; - -#endif + unsigned short local = convergence, global = 0; + SU2_MPI::Allreduce(&local, &global, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); + convergence = global > 0; return convergence; } @@ -1149,49 +1124,49 @@ void COutput::SetScreen_Output(CConfig *config) { void COutput::PreprocessHistoryOutput(CConfig *config, bool wrt){ - noWriting = !wrt; - - /*--- Set the common output fields ---*/ + noWriting = !wrt; - SetCommonHistoryFields(config); + /*--- Set the common output fields ---*/ - /*--- Set the History output fields using a virtual function call to the child implementation ---*/ + SetCommonHistoryFields(config); - SetHistoryOutputFields(config); + /*--- Set the History output fields using a virtual function call to the child implementation ---*/ - /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ + SetHistoryOutputFields(config); - Postprocess_HistoryFields(config); + /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ - /*--- We use a fixed size of the file output summary table ---*/ + Postprocess_HistoryFields(config); - int total_width = 72; - fileWritingTable->AddColumn("File Writing Summary", (total_width)/2-1); - fileWritingTable->AddColumn("Filename", total_width/2-1); - fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT); + /*--- We use a fixed size of the file output summary table ---*/ - /*--- Check for consistency and remove fields that are requested but not available --- */ + int total_width = 72; + fileWritingTable->AddColumn("File Writing Summary", (total_width)/2-1); + fileWritingTable->AddColumn("Filename", total_width/2-1); + fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT); - CheckHistoryOutput(); + /*--- Check for consistency and remove fields that are requested but not available --- */ - if (rank == MASTER_NODE && !noWriting){ + CheckHistoryOutput(); - /*--- Open history file and print the header ---*/ - if (!config->GetMultizone_Problem() || config->GetWrt_ZoneHist()) - PrepareHistoryFile(config); + if (rank == MASTER_NODE && !noWriting){ - total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1); + /*--- Open history file and print the header ---*/ + if (!config->GetMultizone_Problem() || config->GetWrt_ZoneHist()) + PrepareHistoryFile(config); - /*--- Set the multizone screen header ---*/ + total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1); - if (config->GetMultizone_Problem()){ - multiZoneHeaderTable->AddColumn(multiZoneHeaderString, total_width); - multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); - multiZoneHeaderTable->SetPrintHeaderBottomLine(false); - } + /*--- Set the multizone screen header ---*/ + if (config->GetMultizone_Problem()){ + multiZoneHeaderTable->AddColumn(multiZoneHeaderString, total_width); + multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); + multiZoneHeaderTable->SetPrintHeaderBottomLine(false); } + } + } void COutput::PreprocessMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig* driver_config, bool wrt){ diff --git a/preconfigure.py b/preconfigure.py index c34638b6a2e0..639740a54d8f 100755 --- a/preconfigure.py +++ b/preconfigure.py @@ -289,7 +289,7 @@ def init_codi(argument_dict, modes, mpi_support = False, update = False): # The sha tag must be maintained manually to point to the correct commit sha_version_codi = '1b8d3f5f03de560fb63a2a76ad91ab7bb3fa67d8' github_repo_codi = 'https://github.com/scicompkl/CoDiPack' - sha_version_medi = 'b84cef4272ab8bad981c0d0386d855daa8fbd340' + sha_version_medi = '6aef76912e7099c4f08c9705848797ca9e8070da' github_repo_medi = 'https://github.com/SciCompKL/MeDiPack' medi_name = 'MeDiPack' From 5960bf1927be19e250548b9c5a56fd41ba892b8e Mon Sep 17 00:00:00 2001 From: CatarinaGarbacz Date: Fri, 26 Feb 2021 13:06:27 +0000 Subject: [PATCH 317/326] small fixes in NEMO --- SU2_CFD/include/fluid/CMutationTCLib.hpp | 3 +-- SU2_CFD/src/fluid/CMutationTCLib.cpp | 10 ++-------- SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/SU2_CFD/include/fluid/CMutationTCLib.hpp b/SU2_CFD/include/fluid/CMutationTCLib.hpp index f9449721579b..863d05ff6707 100644 --- a/SU2_CFD/include/fluid/CMutationTCLib.hpp +++ b/SU2_CFD/include/fluid/CMutationTCLib.hpp @@ -45,8 +45,7 @@ class CMutationTCLib : public CNEMOGas { vector Cv_ks, /*!< \brief Species specific heats at constant volume. */ es, /*!< \brief Species energies. */ - omega_vec, /*!< \brief Dummy vector for vibrational energy source term. */ - h_RT; /*!< \brief Enthalpy divided by R*T. */ + omega_vec; /*!< \brief Dummy vector for vibrational energy source term. */ su2double Tref; /*!< \brief Reference temperature. */ diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index 9e27e18a2c0e..4eb8d3323cf9 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -36,7 +36,6 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim): /* Allocating memory*/ Cv_ks.resize(nEnergyEq*nSpecies,0.0); - h_RT.resize(nSpecies,0.0); es.resize(nEnergyEq*nSpecies,0.0); omega_vec.resize(1,0.0); @@ -148,12 +147,7 @@ su2double CMutationTCLib::ComputeEveSourceTerm(){ vector& CMutationTCLib::ComputeSpeciesEnthalpy(su2double val_T, su2double val_Tve, su2double *val_eves){ - su2double RuSI = UNIVERSAL_GAS_CONSTANT; - su2double Ru = 1000.0*RuSI; - - mix->speciesHOverRT(val_T, val_Tve, val_T, val_Tve, val_Tve, h_RT.data(), NULL, NULL, NULL, NULL, NULL); - - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) hs[iSpecies] = h_RT[iSpecies]*(RuSI*val_T); + mix->getEnthalpiesMass(hs.data()); return hs; } @@ -213,7 +207,7 @@ vector& CMutationTCLib::GetSpeciesFormationEnthalpy() { mix->speciesHOverRT(Tref, Tref, Tref, Tref, Tref, NULL, NULL, NULL, NULL, NULL, hf_RT.data()); - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) Enthalpy_Formation[iSpecies] = hf_RT[iSpecies]*(RuSI*Tref); + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) Enthalpy_Formation[iSpecies] = hf_RT[iSpecies]*(RuSI*Tref*1000.0)/MolarMass[iSpecies]; return Enthalpy_Formation; } diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp index ec3532bff259..721672852f76 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp @@ -376,7 +376,7 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi +v*TWO3*(2*PrimVar_Grad_i[nSpecies+2][1]-PrimVar_Grad_i[nSpecies+2][0] -v*yinv+rho*turb_ke_i)) -total_conductivity_i*PrimVar_Grad_i[nSpecies][1]) - -TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][1])); + -TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][0])); residual[nSpecies+3] -= Volume*(yinv*(sumJeve_y -qy_ve)); } From 0cf63e35c1e7739ae24d82f3148a00e427a1e86f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 26 Feb 2021 14:06:37 +0100 Subject: [PATCH 318/326] Fix typos in template, changed streamwise readme a bit. --- .../streamwise_periodic/README.md | 34 +++++++++---------- config_template.cfg | 10 +++--- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/README.md index 12deef756f6d..0162663ce5c9 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/README.md +++ b/TestCases/incomp_navierstokes/streamwise_periodic/README.md @@ -1,31 +1,29 @@ # Streamwise Periodicity testcases -All Testcases use the incompressible solver implemented by Thomas Economon. -For all Testcases the respective gmsh geo file has to be provided. +This folder contains the additional Testcases for streamwise periodic flow. +A Tutorial can be found on the SU2 website. +For all Testcases a gmsh .geo file is provided which allows to recreate/modify the mesh. -## `pipe_slice_3D` +## `pipe_slice_3d` -Overview: Hagen Poiseuille flow through a 1-primal-cell thick pipe slice in 3D. +Hagen Poiseuille flow through a 1-primal-cell thick pipe slice in 3D. -Analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed, heated walls +Analytical solution of the velocity magnitude for steady laminar pipe flow in a round pipe `v_mag (r) = -1/(4*mu) * (Delta p / Delta x) * (R**2 - r**2)` therefore a pressure drop Delta p is prescribed. -`Re = rho * v * L / mu = 1.0 * ? * 5e-3 / 1.8e-5` bei v -> averaged (mass or area weighted?) velocity the critical Re ~= 2300 (v = 0.6 for now) makes Re=167 +`Re = rho * v * L / mu = 1.0 * 0.6 * 5e-3 / 1.8e-5` makes Re=167, with the critical Reynolds number being Re~=2300. -It would nice to have a Re ~= 1500 to have a better testcase (achieve that with v~5 or 6 i.e. scale Delta P by factor 10 from 0.001 to 0.01) +This testcase is a regression test. -## `half_cylinder_2D` -half cylinder massflow prescribed heated cylinder - probably discontinued +## `chtPinArray_2d` -## 2D_pinArray_dp_hf +Extension of the tutorial case to a CHT problem with 1 additional solid zone. +A gradient validation between discrete and finite differences for this setup is described in the README of that folder. -## 2D_pinArray_mf +This gradient validation is also part of the regression tests. -## 2D_pinArray_cht_dp_hf +## `chtPinArray_3d` -### Discrete Adjoint +Extension of the `chtPinArray_2d` to the 3rd dimension with again one solid zone. +The mesh provided is coarse to keep the filesize and computation time low, but using the gmsh .geo script much higher mesh resolutions can be created. -## 3D_pinArray_mf_hf - -## 3D_pinArray_cht_dp_hf - -### Discrete Adjoint +This primal simulation is part of the regression tests. diff --git a/config_template.cfg b/config_template.cfg index afe865734f14..fd9e3d4930c9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -689,10 +689,10 @@ BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) % --------------------- STREAMWISE PERIODICITY DEFINITION ---------------------% % -% Generally for streamwise periodicty one has to set MARKER_PERIODIC= (, , ...) -% appropriatley as a boundary condition. +% Generally for streamwise periodictiy one has to set MARKER_PERIODIC= (, , ...) +% appropriately as a boundary condition. % -% Specify type of streamwise periodicty (default=NONE, PRESSURE_DROP, MASSFLOW) +% Specify type of streamwise periodictiy (default=NONE, PRESSURE_DROP, MASSFLOW) KIND_STREAMWISE_PERIODIC= NONE % % Delta P [Pa] value that drives the flow as a source term in the momentum equations. @@ -705,11 +705,11 @@ STREAMWISE_PERIODIC_PRESSURE_DROP= 1.0 STREAMWISE_PERIODIC_MASSFLOW= 0.0 % % Use streamwise periodic temperature (default=NO, YES) -% If YES, the heatflux is taken out at the outlet +% If NO, the heatflux is taken out at the outlet. % This option is only necessary if INC_ENERGY_EQUATION=YES STREAMWISE_PERIODIC_TEMPERATURE= NO % -% Prescibe integrated heat [W] extracted at the periodic "outlet". +% Prescribe integrated heat [W] extracted at the periodic "outlet". % Only active if STREAMWISE_PERIODIC_TEMPERATURE= NO. % If set to zero, the heat is integrated automatically over all present MARKER_HEATFLUX. % Upon convergence, the area averaged inlet temperature will be INC_TEMPERATURE_INIT. From 4fd03b913f3587320f40de7f729245a4686a9de1 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 26 Feb 2021 22:42:58 +0100 Subject: [PATCH 319/326] Various smaller changes. Mainly spelling. --- .github/workflows/regression.yml | 2 +- Common/include/CConfig.hpp | 8 +- Common/include/geometry/CGeometry.hpp | 12 +- Common/include/geometry/CPhysicalGeometry.hpp | 14 +- Common/include/option_structure.hpp | 2 +- Common/src/CConfig.cpp | 16 +- Common/src/geometry/CPhysicalGeometry.cpp | 3 +- .../src/grid_movement/CVolumetricMovement.cpp | 2 +- .../include/numerics/flow/flow_sources.hpp | 4 +- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 4 +- .../include/variables/CIncEulerVariable.hpp | 9 +- SU2_CFD/include/variables/CVariable.hpp | 6 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 13 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 7 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 211 ++++++++---------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 26 +-- SU2_DOT/src/SU2_DOT.cpp | 4 +- SU2_PY/SU2/eval/gradients.py | 1 - SU2_PY/SU2/run/direct.py | 4 +- .../chtPinArray_2d/DA_configMaster.cfg | 2 +- .../chtPinArray_2d/FD_configMaster.cfg | 2 +- .../chtPinArray_2d/README.md | 7 +- .../chtPinArray_2d/configMaster.cfg | 2 +- .../chtPinArray_2d/configSolid.cfg | 2 +- .../chtPinArray_3d/configFluid.cfg | 10 +- .../chtPinArray_3d/configMaster.cfg | 2 +- .../chtPinArray_3d/configSolid.cfg | 10 +- .../pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg | 4 +- TestCases/parallel_regression.py | 24 +- TestCases/parallel_regression_AD.py | 2 +- TestCases/tutorials.py | 2 +- meson_scripts/init.py | 2 +- 32 files changed, 195 insertions(+), 224 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 0120514d6bea..cea9c098ee41 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -83,7 +83,7 @@ jobs: - name: Run Tests in Container uses: docker://su2code/test-su2:20200303 with: - args: -b ${{github.ref}} -t develop -c feature_periodic_streamwise -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} unit_tests: runs-on: ubuntu-latest name: Unit Tests diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 0acafde9632e..c9f73e506dc3 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -996,8 +996,8 @@ class CConfig { array kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ - unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */ - bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */ + unsigned short Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */ + bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */ su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ @@ -3095,7 +3095,7 @@ class CConfig { * has the marker val_marker. */ string GetMarker_Outlet_TagBound(unsigned short val_marker) const { return Marker_Outlet[val_marker]; } - + /*! * \brief Get the index of the surface defined in the geometry file. * \param[in] val_marker - Value of the marker in which we are interested. @@ -5179,7 +5179,7 @@ class CConfig { unsigned short GetTabular_FileFormat(void) const { return Tab_FileFormat; } /*! - * \brief Get the output precision to be used in .precision(value). + * \brief Get the output precision to be used in .precision(value) for history and SU2_DOT output. * \return Output precision. */ unsigned short GetOutput_Precision(void) const { return output_precision; } diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 132491bbfb97..9a1ee9092e13 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -735,12 +735,6 @@ class CGeometry { */ inline virtual void MatchPeriodic(CConfig *config, unsigned short val_periodic) {} - /*! - * \brief For streamwise periodicity, find a unique reference node on the designated inlet. - * \param[in] config - Definition of the particular problem. - */ - inline virtual void FindUniqueNode_PeriodicBound(CConfig *config) {} - /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. @@ -1718,6 +1712,12 @@ class CGeometry { */ unsigned long GetnNonconvexElements() const {return nNonconvexElements;} + /*! + * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. + * \param[in] config - Definition of the particular problem. + */ + inline virtual void FindUniqueNode_PeriodicBound(CConfig *config) {} + /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 4dd890d24557..eeb4ad5a1d8c 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -107,7 +107,7 @@ class CPhysicalGeometry final : public CGeometry { vector GlobalMarkerStorageDispl; vector GlobalRoughness_Height; - su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure/temperature computation only. Size nDim.*/ + su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure/temperature computation only.*/ public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ @@ -467,12 +467,6 @@ class CPhysicalGeometry final : public CGeometry { */ void MatchPeriodic(CConfig *config, unsigned short val_periodic) override; - /*! - * \brief For streamwise periodicity, find a unique reference node on the designated inlet. - * \param[in] config - Definition of the particular problem. - */ - void FindUniqueNode_PeriodicBound(CConfig *config) final; - /*! * \brief Set boundary vertex structure of the control volume. * \param[in] config - Definition of the particular problem. @@ -792,6 +786,12 @@ class CPhysicalGeometry final : public CGeometry { */ void SetGlobalMarkerRoughness(const CConfig* config); + /*! + * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. + * \param[in] config - Definition of the particular problem. + */ + void FindUniqueNode_PeriodicBound(CConfig *config) final; + /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index e1903fa70381..8e79c04ba5bb 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2257,7 +2257,7 @@ static const MapType Verification_Solution_ }; /*! - * \brief types of streamwise periodicity. + * \brief Types of streamwise periodicity. */ enum ENUM_STREAMWISE_PERIODIC { NO_STREAMWISE_PERIODIC = 0, /*!< \brief No streamwise periodic flow. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index f903b0f57808..c989fbe8afbf 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1105,15 +1105,15 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ addDoubleArrayOption("BODY_FORCE_VECTOR", 3, body_force); - /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions (NONE, PRESSURE_DROP, MASSFLOW) */ + /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions \n Options: NONE, PRESSURE_DROP, MASSFLOW \n DEFAULT: NONE \ingroup Config */ addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); - /*!\brief STREAMWISE_PERIODIC_TEMPERATURE \n DESCRIPTION: Use real periodicty for temperature: NO, YES \ingroup Config */ + /* DESCRIPTION: Use real periodicity for temperature \n Options: NO, YES \n DEFAULT: NO \ingroup Config */ addBoolOption("STREAMWISE_PERIODIC_TEMPERATURE", Streamwise_Periodic_Temperature, false); - /* DESCRIPTION: Heatflux boundary at streamwise periodic 'outlet', choose heat [W] such that net domain heatflux is zero. Only active if STREAMWISE_PERIODIC_TEMPERATURE is active. */ + /* DESCRIPTION: Heatflux boundary at streamwise periodic 'outlet', choose heat [W] such that net domain heatflux is zero. Only active if STREAMWISE_PERIODIC_TEMPERATURE is active. \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_OUTLET_HEAT", Streamwise_Periodic_OutletHeat, 0.0); - /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is chosen */ + /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is chosen. \n DEFAULT: 1.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); - /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. */ + /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ @@ -1936,7 +1936,7 @@ void CConfig::SetConfig_Options() { /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_CSV); - /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. */ + /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 6); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); @@ -4602,10 +4602,10 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Check feassbility for Streamwise Periodic flow ---*/ if (Kind_Streamwise_Periodic != NONE) { - if (Kind_Solver == INC_EULER) - SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); if (Kind_Regime != INCOMPRESSIBLE) SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for incompressible flow.", CURRENT_FUNCTION); + if (Kind_Solver == INC_EULER) + SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); if (nMarker_PerBound != 2) SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible in the moment.", CURRENT_FUNCTION); if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index a198e86d5dbf..69769eee5ec8 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7519,7 +7519,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ /*--- globally closest to the origin. Store the found node coordinates in the ---*/ - /*--- config container. ---*/ + /*--- geometry container. ---*/ /*-------------------------------------------------------------------------------------------*/ for (int iRank = 0; iRank < size; iRank++) { @@ -7533,7 +7533,6 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { for (unsigned short iDim = 0; iDim < nDim; iDim++) Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode[iRank*nDim + iDim]; } - /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } /*--- Print the reference node to screen. ---*/ diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index 782fcaa1a934..b0dd11cf8ec6 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -1641,7 +1641,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig VarIncrement = 1.0/((su2double)config->GetGridDef_Nonlinear_Iter()); /*--- As initialization, set to zero displacements of all the surfaces except the symmetry - plane (which is treated specially, see below), internal and the send-receive boundaries ---*/ + plane (which is treated specially, see below), internal and the send-receive boundaries ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (((config->GetMarker_All_KindBC(iMarker) != SYMMETRY_PLANE) && diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index b129934b2b85..fec237bde492 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -41,9 +41,9 @@ class CSourceBase_Flow : public CNumerics { su2double* residual = nullptr; su2double** jacobian = nullptr; su2double - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ + Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ /*! * \brief Constructor of the class. diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index a30db2f69aa8..7be29fd3c0fb 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -40,9 +40,9 @@ class CIncEulerSolver : public CFVMFlowSolverBase FluidModel; /*!< \brief fluid model used in the solver. */ su2double - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_InletTemperature; /*!< /brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ + Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ /*! * \brief Preprocessing actions common to the Euler and NS solvers. diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index bcb0b351c4e3..abb9d43e3129 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -378,15 +378,14 @@ class CIncEulerVariable : public CVariable { inline su2activevector& GetStrainMag() { return StrainMag; } /*! - * \brief Set the recovered pressure for streamwise periodic flow. * \param[in] iPoint - Point index. * \param[in] val_pressure - pressure value. */ inline void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint, su2double val_pressure) final { - Streamwise_Periodic_RecoveredPressure(iPoint) = val_pressure; + Streamwise_Periodic_RecoveredPressure(iPoint) = val_pressure; } - + /*! * \brief Get the recovered pressure for streamwise periodic flow. * \param[in] iPoint - Point index. @@ -395,7 +394,7 @@ class CIncEulerVariable : public CVariable { inline su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const final { return Streamwise_Periodic_RecoveredPressure(iPoint); } - + /*! * \brief Set the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. @@ -404,7 +403,7 @@ class CIncEulerVariable : public CVariable { inline void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) final { Streamwise_Periodic_RecoveredTemperature(iPoint) = val_temperature; } - + /*! * \brief Get the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index fba3d354108d..54c5e8cc18e9 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2557,21 +2557,21 @@ class CVariable { * \param[in] val_pressure - pressure value. */ inline virtual void SetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint,su2double val_pressure) { } - + /*! * \brief A virtual member: Get the recovered pressure for streamwise periodic flow. * \param[in] iPoint - Point index. * \return Recovered/Physical pressure for streamwise periodic flow. */ inline virtual su2double GetStreamwise_Periodic_RecoveredPressure(unsigned long iPoint) const { return 0.0; } - + /*! * \brief A virtual member: Set the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. * \param[in] val_temperature - temperature value. */ inline virtual void SetStreamwise_Periodic_RecoveredTemperature(unsigned long iPoint, su2double val_temperature) { } - + /*! * \brief A virtual member: Get the recovered temperature for streamwise periodic flow. * \param[in] iPoint - Point index. diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 607800447527..2a5e24de9abb 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -29,7 +29,6 @@ #include "../../../include/numerics/flow/flow_sources.hpp" #include "../../../../Common/include/toolboxes/geometry_toolbox.hpp" - CSourceBase_Flow::CSourceBase_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { residual = new su2double [nVar](); @@ -420,6 +419,7 @@ CNumerics::ResidualType<> CSourceIncBodyForce::ComputeResidual(const CConfig* co /*--- Momentum contribution. Note that this form assumes we have subtracted the operating density * gravity, i.e., removed the hydrostatic pressure component (important for pressure BCs). ---*/ + for (iDim = 0; iDim < nDim; iDim++) residual[iDim+1] = -Volume * (DensityInc_i - DensityInc_0) * Body_Force_Vector[iDim] / Force_Ref; @@ -692,7 +692,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { - /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */ + /* Value of prescribed pressure drop which results in an artificial body force vector. */ const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; @@ -713,11 +713,10 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C residual[nDim+1] = Volume * scalar_factor * dot_product; - /*--- If a RANS turbulence model ias used an additional source term, based on the eddy viscosity - gradient is added. ---*/ + /*--- If a RANS turbulence model ias used an additional source term, based on the eddy viscosity gradient is added. ---*/ if(turbulent) { - /*--- Compute the scalar factor ---*/ + /*--- Compute a scalar factor ---*/ scalar_factor = Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ @@ -728,7 +727,6 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C } // if energy return ResidualType<>(residual, jacobian, nullptr); - } CSourceIncStreamwisePeriodic_Outlet::CSourceIncStreamwisePeriodic_Outlet(unsigned short val_nDim, @@ -754,12 +752,11 @@ CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(c residual[nDim+1] -= abs(local_Massflow/Streamwise_Periodic_MassFlow) * factor; - /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual condtribution ---*/ + /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual contribution ---*/ const su2double delta_T = Streamwise_Periodic_InletTemperature - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * delta_T; return ResidualType<>(residual, jacobian, nullptr); - } CSourceRadiation::CSourceRadiation(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index a821aa668cde..d2107bff76e5 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -501,7 +501,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio"); - // Streamwise Periodicty + // Streamwise Periodicity if(streamwisePeriodic) { AddVolumeOutput("RECOVERED_PRESSURE", "Recovered_Pressure", "SOLUTION", "Recovered physical pressure"); if (heat && streamwisePeriodic_temperature) @@ -658,16 +658,13 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(&(Node_Flow->GetGradient_Primitive(iPoint)[1]))); } - // Streamwise Periodicty + // Streamwise Periodicity if(streamwisePeriodic) { SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); if (heat && streamwisePeriodic_temperature) SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } - // MPI-Rank - SetVolumeOutputValue("RANK", iPoint, rank); - // Mesh quality metrics if (config->GetWrt_MeshQuality()) { SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 1d4c19f39752..6e9d75cb0eda 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1255,9 +1255,6 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont unsigned short iVar; unsigned long iPoint; - unsigned short iMarker; - unsigned long iVertex; - const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool rotating_frame = config->GetRotating_Frame(); const bool axisymmetric = config->GetAxisymmetric(); @@ -1266,87 +1263,10 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool viscous = config->GetViscous(); const bool radiation = config->AddRadiation(); const bool vol_heat = config->GetHeatSource(); - const bool energy = config->GetEnergy_Equation(); - const bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); + const bool energy = config->GetEnergy_Equation(); + const bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); - - if (streamwise_periodic) { - numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, - Streamwise_Periodic_InletTemperature); - - /*--- Loop over all points ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Load the primitve variables ---*/ - numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); - - /*--- Set incompressible density ---*/ - numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); - - /*--- Load the volume of the dual mesh cell ---*/ - numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); - - /*--- If viscous, we need gradients for extra terms. ---*/ - if (viscous) { - /*--- Gradient of the primitive variables ---*/ - numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nullptr); - } - - /*--- Compute the streamwise periodic source residual and add to the total ---*/ - auto residual = numerics->ComputeResidual(config); - LinSysRes.AddBlock(iPoint, residual); - - /*--- Add the implicit Jacobian contribution ---*/ - if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - - }// for iPoint - - if(!streamwise_periodic_temperature && energy) { - CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; - second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, - Streamwise_Periodic_InletTemperature); - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - /*--- Only "inlet"/donor periodic marker ---*/ - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 1) { - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Load the primitive variables ---*/ - second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); - - /*--- Set the specific heat ---*/ - second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); - - /*--- Set the Point coordinates ---*/ - second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), nullptr); - - /*--- Set the area normal ---*/ - second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); - - /*--- Set incompressible density ---*/ - second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); - - /*--- Compute the streamwise periodic source residual and add to the total ---*/ - auto residual = second_numerics->ComputeResidual(config); - LinSysRes.AddBlock(iPoint, residual); - - }// if domain - }// for iVertex - }// if periodic inlet boundary - }// for iMarker - - }// if !streamwise_periodic_temperature - }// if streamwise_periodic - if (body_force) { /*--- Loop over all points ---*/ @@ -1575,6 +1495,80 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } + if (streamwise_periodic) { + numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, + Streamwise_Periodic_InletTemperature); + + /*--- Loop over all points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + + /*--- Load the primitive variables ---*/ + numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); + + /*--- Set incompressible density ---*/ + numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); + + /*--- Load the volume of the dual mesh cell ---*/ + numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); + + /*--- If viscous, we need gradients for extra terms. ---*/ + if (viscous) { + /*--- Gradient of the primitive variables ---*/ + numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nullptr); + } + + /*--- Compute the streamwise periodic source residual and add to the total ---*/ + auto residual = numerics->ComputeResidual(config); + LinSysRes.AddBlock(iPoint, residual); + + /*--- Add the implicit Jacobian contribution ---*/ + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + + }// for iPoint + + if(!streamwise_periodic_temperature && energy) { + CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; + second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, + Streamwise_Periodic_InletTemperature); + + /*--- This bit acts as a boundary condition rather than a source term. But logically it fits better here. ---*/ + for (auto iMarker = 0ul; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- Only "inlet"/donor periodic marker ---*/ + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 1) { + + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->nodes->GetDomain(iPoint)) { + + /*--- Load the primitive variables ---*/ + second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); + + /*--- Set incompressible density ---*/ + second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); + + /*--- Set the specific heat ---*/ + second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); + + /*--- Set the area normal ---*/ + second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); + + /*--- Compute the streamwise periodic source residual and add to the total ---*/ + auto residual = second_numerics->ComputeResidual(config); + LinSysRes.AddBlock(iPoint, residual); + + }// if domain + }// for iVertex + }// if periodic inlet boundary + }// for iMarker + + }// if !streamwise_periodic_temperature + }// if streamwise_periodic + /*--- Check if a verification solution is to be computed. ---*/ if (VerificationSolution) { @@ -2872,9 +2866,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge const unsigned short iMesh) { /*---------------------------------------------------------------------------------------------*/ - // 1. evaluate massflow, avg_density, Area at streamwise periodic outlet. also bulk temp at in/outlet. Loop periodic markers. Communicate and set results + // 1. Evaluate massflow, area avg density & Temperature and Area at streamwise periodic outlet. // 2. Update delta_p is target massflow is chosen. - // 3. Loop Heatflux (or all for real heatflux) markers. compute heatflux in domain via config or real heatflux, communicate and set results. only if energy equation is on. + // 3. Loop Heatflux markers and integrate heat across the boundary. Only if energy equation is on. /*---------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------*/ @@ -2908,7 +2902,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - // Is there a way to get a pointer on just the velocity to put in the Dotproduct directly? + // One could add a CVariable method to return a pointer to the first Vel element to directly plug into GeomToolbox su2double Velocity[MAXNDIM] = {0.0}; for (auto iDim = 0; iDim < nDim; iDim++) { Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); } /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ @@ -2918,7 +2912,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); - /*--- Only "inlet"/master (1 ,now 2 for testpurpose) periodic marker, as I want to meet the specified inlet temperature ---*/ + /*--- Due to periodicty temperature are euqual one the inlet(1) and outlet(2) ---*/ Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); } // if domain @@ -2926,18 +2920,17 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge } // loop periodic boundaries } // loop MarkerAll - // MPI Communication: Sum Area, Sum rho*A and divide by AreaGlobbal, sum massflow + // MPI Communication: Sum Area, Sum rho*A & T*A and divide by AreaGlobbal, sum massflow su2double Area_Global(0), Average_Density_Global(0), MassFlow_Global(0), Temperature_Global(0); SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - - // Set quantity by stringtag Average_Density_Global /= Area_Global; Temperature_Global /= Area_Global; - // What do I do with the temperature now from here on? The only way really is to pipe it through the config... + + /*--- Set solver variable ---*/ Streamwise_Periodic_InletTemperature = Temperature_Global; Streamwise_Periodic_MassFlow = MassFlow_Global; @@ -2948,12 +2941,11 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*------------------------------------------------------------------------------------------------*/ /*--- Load/define all necessary variables ---*/ - su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(), - TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()), - damping_factor = config->GetInc_Outlet_Damping(), - Pressure_Drop_new, - ddP; - + const su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + const su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); + const su2double damping_factor = config->GetInc_Outlet_Damping(); + su2double Pressure_Drop_new, ddP; + /*--- Compute update to Delta p based on massflow-difference ---*/ ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); @@ -2983,15 +2975,13 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*--- Here the Heatflux from all Bounary markers in the config-file is used. ---*/ /*---------------------------------------------------------------------------------------------*/ - su2double HeatFlux, - HeatFlow_Local = 0.0, - HeatFlow_Global = 0.0; + su2double HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; - /*--- Loop over all Marker ---*/ + /*--- Loop over all heatflux Markers ---*/ for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - // Loop over all Heatflux marker + if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { - // Add up Heatflux + /*--- Identify the boundary by string name ---*/ auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); @@ -2999,26 +2989,21 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->nodes->GetDomain(iPoint)) { + if (!geometry->nodes->GetDomain(iPoint)) continue; - const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - /*--- OPTION 1 for Heatflux calculation from config file ---*/ - HeatFlux = -config->GetWall_HeatFlux(Marker_StringTag)/config->GetHeat_Flux_Ref(); - - /*--- END OPTIONS ---*/ - HeatFlow_Local += HeatFlux * FaceArea; // /Area added due to real GradTemperature (Heatflux) computation. - } // if Domain + HeatFlow_Local += FaceArea * (-1.0) * config->GetWall_HeatFlux(Marker_StringTag)/config->GetHeat_Flux_Ref();; } // loop Vertices } // loop Heatflux marker } // loop AllMarker - // Mpi Communication sum up integrated Heatflux from all processes + /*--- MPI Communication sum up integrated Heatflux from all processes ---*/ SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - /*--- Set the Integrated Heatflux ---*/ + /*--- Set the solver variable Integrated Heatflux ---*/ Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 998fe23eed47..77fd0ce6b2ad 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -102,17 +102,15 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container if (config->GetKind_Streamwise_Periodic() != NONE) { /*--- Define and initialize helping variables ---*/ - su2double dot_product, - Pressure_Recovered, - Temperature_Recovered; + su2double dot_product, Pressure_Recovered, Temperature_Recovered; - su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ - su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); + const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); /*--- Compute recoverd pressure and temperature for all points ---*/ for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { @@ -122,11 +120,11 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container for (unsigned short iDim = 0; iDim < nDim; iDim++) dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); - /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature, TK:: added non-dimensionalization here - pres_ref=1 - how is pres_ref set? ---*/ + /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); - /*--- 'InnerIter > 0' as otherwise MassFlow in the denominator would be zero ---*/ + /*--- InnerIter > 0 as otherwise MassFlow in the denominator would be zero ---*/ if (energy && InnerIter > 0) { Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); Temperature_Recovered += Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; @@ -191,13 +189,10 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool energy = config->GetEnergy_Equation(); - /*--- Variable allocation for streamwise periodicity ---*/ - bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); - bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); - su2double Cp, - thermal_conductivity, - dot_product, - scalar_factor; + /*--- Variables for streamwise periodicity ---*/ + const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); + su2double Cp, thermal_conductivity, dot_product, scalar_factor; /*--- Identify the boundary by string name ---*/ @@ -269,8 +264,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; - /*--- With streamwise periodic flow and heatflux walls an additional - term is introduced in the boundary formulation ---*/ + /*--- With streamwise periodic flow and heatflux walls an additional term is introduced in the boundary formulation ---*/ if (streamwise_periodic && streamwise_periodic_temperature) { Cp = nodes->GetSpecificHeatCp(iPoint); diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index c2c0cde531af..c814359bb32b 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -287,7 +287,7 @@ int main(int argc, char *argv[]) { su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { - /*--- Initialze to zero ---*/ + /*--- Initialize to zero ---*/ Gradient[iDV] = new su2double[config_container[ZONE_0]->GetnDV_Value(iDV)](); } @@ -937,7 +937,7 @@ void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned shor output->SetSurface_Filename(config[iZone]->GetSurfSens_FileName()); - /*--- Set the volume filename ---*/ // Note TobiKattmann: Why would I write volume output here as this should be the surface gradient only + /*--- Set the volume filename ---*/ output->SetVolume_Filename(config[iZone]->GetVolSens_FileName()); diff --git a/SU2_PY/SU2/eval/gradients.py b/SU2_PY/SU2/eval/gradients.py index c8a7207c57bf..0ab65f504438 100644 --- a/SU2_PY/SU2/eval/gradients.py +++ b/SU2_PY/SU2/eval/gradients.py @@ -767,7 +767,6 @@ def findiff( config, state=None ): else: step = 0.001 - opt_names = [] for i in range(config['NZONES']): for key in sorted(su2io.historyOutFields): diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index c1fb54824c21..54c930a95955 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -91,8 +91,8 @@ def direct ( config ): # adapt the history_filename, if a restart solution is chosen # check for 'RESTART_ITER' is to avoid forced restart situation in "compute_polar.py"... if konfig.get('RESTART_SOL','NO') == 'YES' and konfig.get('RESTART_ITER',1) != 1: - if konfig.get('CONFIG_LIST',[]) != []: # Does this fix work for multizone cases? - konfig['CONV_FILENAME'] = 'config_CFD' # this is a hardcoded filename and therfore probably not really great + if konfig.get('CONFIG_LIST',[]) != []: + konfig['CONV_FILENAME'] = 'config_CFD' # master cfg is always config_CFD. Hardcoded names are prob nt ideal. restart_iter = '_'+str(konfig['RESTART_ITER']).zfill(5) history_filename = konfig['CONV_FILENAME'] + restart_iter + plot_extension else: diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index 7a24865407b0..936f08747a18 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 757ceb9d0d5e..9c29fb99e4e4 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md index 731e207c1329..6b5b3615d406 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/README.md @@ -1,12 +1,13 @@ # Gradient validation from start to finish -This guide steps you through the steps necessary to perform a validation of the discrete adjoint sensitivites using finite differences. +This guide steps you through the steps necessary to perform a validation of the discrete adjoint sensitivities using finite differences. All necessary config files are present and this guide steps through the different tasks to do. If you are lucky enough too have some cores to spare, 14 is a suitable substitution for the `<#cores>` placeholder. ## FFD-box creation +This step is optional as the provided mesh already contains FFD box. This is for completeness if a new mesh e.g. with different resolution is created. In `configMaster.cfg` the mentioned options have to be uncommented and others commented if they appear twice in the config. Note that (only!) for the FFD-box creation a `MARKER_HEATFLUX= ( fluid_symmetry ) is artificially is set to avoid an error. This has to be done to make the config-Postprocessing aware that this marker exists as it is used in `DV_MARKER`. Call `SU2_DEF configMaster.cfg` which creates the new mesh with the name given in 'MESH_OUT_FILENAME'. @@ -14,7 +15,7 @@ Call `SU2_DEF configMaster.cfg` which creates the new mesh with the name given i ## Primal run Run `mpirun -n <#cores> SU2_CFD configMaster.cfg` -## Discrete-Adjoint runb +## Discrete-Adjoint run Rename\copy\symlink `restart_*.dat` -> `solution_*.dat` Run `mpirun -n <#cores> SU2_CFD_AD DA_configMaster.cfg` and afterwards `SU2_DOT_AD DA_configMaster.cfg` @@ -24,4 +25,4 @@ For the full gradient validation uncomment all design variables of the `DEFINITI Run `finite_differences.py -f FD_configMaster.cfg -z 2 -n <#cores>`. ## Comparing results -Just plot the `of_grad.csv` and `FINDIFF/of_grad_findiff.csv` with your tool of choice. Paraview's `Line Chart View` is one option. \ No newline at end of file +Just plot the `of_grad.csv` and `FINDIFF/of_grad_findiff.csv` with your tool of choice. Paraview's `Line Chart View` is one option. diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 104c9b1b595a..111367a0e1a6 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 7e9b3f418150..fa52f63e3f95 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.0.8 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg index 0a1384fd02cd..7ef30f52a04f 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -1,11 +1,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (fluid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % +% Case description: Unit Cell flow around pin array 3d (fluid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 07.06.2019 % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index f290f8c908af..621ec559cd66 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.08 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index 443be0ed1c38..c4eb21b915c3 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -1,11 +1,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Unit Cell flow around pin array (solid) -% Author: T. Kattmann -% Institution: Robert Bosch GmbH -% Date: 07.06.2019 -% File Version 6.2.0 "Falcon" % +% Case description: Unit Cell flow around pin array (solid) % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 07.06.2019 % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index 35680ee28916..ffba18c797fc 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -2,10 +2,10 @@ % % % SU2 configuration file % % Case description: Poiseuille flow for testing a body force/periodicity % -% Author: T. Kattmann % +% Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.14 % -% File Version 7.0.8 "Blackbird" % +% File Version 7.1.0 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index a67518fd9580..489db0f20d5c 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1254,17 +1254,17 @@ def main(): cht_compressible.tol = 0.00001 test_list.append(cht_compressible) - # 2D CHT case with HF BC and - sp_pinArray_cht_2d_mf_hf = TestCase('sp_pinArray_cht_2d_mf_hf') - sp_pinArray_cht_2d_mf_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" - sp_pinArray_cht_2d_mf_hf.cfg_file = "configMaster.cfg" - sp_pinArray_cht_2d_mf_hf.test_iter = 100 - sp_pinArray_cht_2d_mf_hf.test_vals = [0.247022, -0.812199, -0.974877, -0.753315, 208.023676, 349.950000] #last 7 lines - sp_pinArray_cht_2d_mf_hf.su2_exec = "mpirun -n 2 SU2_CFD" - sp_pinArray_cht_2d_mf_hf.timeout = 1600 - sp_pinArray_cht_2d_mf_hf.tol = 0.00001 - sp_pinArray_cht_2d_mf_hf.multizone = True - test_list.append(sp_pinArray_cht_2d_mf_hf) + # 2D CHT case streamwise periodicity + sp_pinArray_cht_2d_dp_hf = TestCase('sp_pinArray_cht_2d_dp_hf') + sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + sp_pinArray_cht_2d_dp_hf.cfg_file = "configMaster.cfg" + sp_pinArray_cht_2d_dp_hf.test_iter = 100 + sp_pinArray_cht_2d_dp_hf.test_vals = [0.247022, -0.812199, -0.974877, -0.753315, 208.023676, 349.950000] #last 7 lines + sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD" + sp_pinArray_cht_2d_dp_hf.timeout = 1600 + sp_pinArray_cht_2d_dp_hf.tol = 0.00001 + sp_pinArray_cht_2d_dp_hf.multizone = True + test_list.append(sp_pinArray_cht_2d_dp_hf) # simple small 3D pin case massflow periodic with heatflux BC sp_pinArray_3d_cht_mf_hf_tp = TestCase('sp_pinArray_3d_cht_mf_hf_tp') @@ -1631,7 +1631,7 @@ def main(): pass_list.append(sphere_ffd_def_bspline.run_def()) test_list.append(sphere_ffd_def_bspline) - # 2D FD case cht, pressure drop, heat obj function + # 2D FD streamwise periodic cht, avg temp obj func fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf') fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" fd_sp_pinArray_cht_2d_dp_hf.cfg_file = "FD_configMaster.cfg" diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index d3e3899e7d94..6cd67b598a0d 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -323,7 +323,7 @@ def main(): discadj_cht.tol = 0.00001 test_list.append(discadj_cht) - # 2D DA cht case 2 zones avg temp objective + # 2D DA cht streamwise periodic case, 2 zones, avg temp objective da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index f9149b148ba6..6cd982fd6e21 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -57,7 +57,7 @@ def main(): # 2D pin case pressure drop periodic with heatflux BC and temperature periodicity sp_pinArray_2d_dp_hf_tp = TestCase('sp_pinArray_2d_dp_hf_tp') - sp_pinArray_2d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pinArray_2d" + sp_pinArray_2d_dp_hf_tp.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 25 sp_pinArray_2d_dp_hf_tp.test_vals = [-4.667133, 1.395801, -0.709306, 208.023676] #last 4 lines diff --git a/meson_scripts/init.py b/meson_scripts/init.py index 07d55f43d6f1..e284ecc59b40 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -158,7 +158,7 @@ def _extract_member(self, member, targetpath, pwd): if os.path.exists(alt_name) and os.listdir(alt_name): print('Directory ' + alt_name + ' is not empty') print('Maybe submodules are already cloned with git?') - #sys.exit(1) + sys.exit(1) else: print('Downloading ' + name + ' \'' + commit_sha + '\'') From f0e887fcb4ff2d08d5e8fdb05f5b87b305532ec1 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 28 Feb 2021 09:37:25 +0100 Subject: [PATCH 320/326] Address PR comments. Part 1. --- Common/include/CConfig.hpp | 6 +- Common/include/geometry/CGeometry.hpp | 2 +- Common/include/geometry/CPhysicalGeometry.hpp | 2 +- Common/src/CConfig.cpp | 2 +- Common/src/geometry/CPhysicalGeometry.cpp | 4 +- SU2_CFD/include/solvers/CIncNSSolver.hpp | 9 +++ SU2_CFD/src/output/COutput.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 12 +-- SU2_CFD/src/solvers/CIncNSSolver.cpp | 80 ++++++++++--------- SU2_CFD/src/variables/CIncEulerVariable.cpp | 8 +- SU2_DOT/src/SU2_DOT.cpp | 2 +- 11 files changed, 75 insertions(+), 54 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c9f73e506dc3..98e3d19ca6c9 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -998,9 +998,9 @@ class CConfig { unsigned short Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */ bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */ - su2double Streamwise_Periodic_PressureDrop, /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ - Streamwise_Periodic_TargetMassFlow, /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ + su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ + su2double Streamwise_Periodic_TargetMassFlow; /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 9a1ee9092e13..a01e376deed3 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1716,7 +1716,7 @@ class CGeometry { * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. * \param[in] config - Definition of the particular problem. */ - inline virtual void FindUniqueNode_PeriodicBound(CConfig *config) {} + inline virtual void FindUniqueNode_PeriodicBound(const CConfig *config) {} /*! * \brief Get a pointer to the reference node coordinate vector. diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index eeb4ad5a1d8c..55cbd8713025 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -790,7 +790,7 @@ class CPhysicalGeometry final : public CGeometry { * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. * \param[in] config - Definition of the particular problem. */ - void FindUniqueNode_PeriodicBound(CConfig *config) final; + void FindUniqueNode_PeriodicBound(const CConfig *config) final; /*! * \brief Get a pointer to the reference node coordinate vector. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index c989fbe8afbf..f1fe85e4b98a 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1937,7 +1937,7 @@ void CConfig::SetConfig_Options() { /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_CSV); /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ - addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 6); + addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 10); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 69769eee5ec8..376beea6c033 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7458,7 +7458,7 @@ void CPhysicalGeometry::MatchPeriodic(CConfig *config, delete [] Buffer_Recv_Marker; } -void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { +void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { /*-------------------------------------------------------------------------------------------*/ /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ @@ -7466,7 +7466,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) { /*--- number of ranks. This does not affect the 'correctness' of the solution as the ---*/ /*--- absolute value is arbitrary anyway, but it assures that the solution does not change---*/ /*--- with a higher number of ranks. If the periodic markers are a line\plane and the ---*/ - /*--- streamwise coordiante vector is perpendicular to that |--->|, the choice of the ---*/ + /*--- streamwise coordinate vector is perpendicular to that |--->|, the choice of the ---*/ /*--- reference node is not relevant at all. This is probably true for most streamwise ---*/ /*--- periodic cases. Other cases where it is relevant could look like this (--->( or ---*/ /*--- \--->\ . The chosen metric is the minimal distance to the origin. ---*/ diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 0b6b0b78cffb..e0d7878d23be 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -65,6 +65,15 @@ class CIncNSSolver final : public CIncEulerSolver { void Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) override; + /*! + * \brief Compute recovered pressure/temperature for streamwise periodic flow and store in CVariable. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] iMesh - current mesh level for the multigrid. + */ + void Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const CGeometry *geometry, + const unsigned short iMesh); + public: /*! * \brief Constructor of the class. diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 7037c3bedf29..39fe3145b00f 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1253,7 +1253,7 @@ void COutput::PrepareHistoryFile(CConfig *config){ historyFileTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); historyFileTable->SetPrintHeaderTopLine(false); historyFileTable->SetPrintHeaderBottomLine(false); - historyFileTable->SetPrecision(config->OptionIsSet("OUTPUT_PRECISION") ? config->GetOutput_Precision() : 10); + historyFileTable->SetPrecision(config->GetOutput_Precision()); /*--- Add the header to the history file. ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 6e9d75cb0eda..434241dbf0a1 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1528,7 +1528,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont }// for iPoint if(!streamwise_periodic_temperature && energy) { - CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM]; + CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); @@ -1539,6 +1539,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { + SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); @@ -2904,7 +2905,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge // One could add a CVariable method to return a pointer to the first Vel element to directly plug into GeomToolbox su2double Velocity[MAXNDIM] = {0.0}; - for (auto iDim = 0; iDim < nDim; iDim++) { Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); } + for (unsigned short iDim = 0; iDim < nDim; iDim++) { Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); } /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ MassFlow_Local += GeometryToolbox::DotProduct(nDim, AreaNormal, Velocity) * nodes->GetDensity(iPoint); @@ -2982,8 +2983,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { - /*--- Identify the boundary by string name ---*/ - auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); + /*--- Identify the boundary by string name and retrive heatflux from config ---*/ + const auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); + const auto Wall_HeatFlux = config->GetWall_HeatFlux(Marker_StringTag); for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -2995,7 +2997,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - HeatFlow_Local += FaceArea * (-1.0) * config->GetWall_HeatFlux(Marker_StringTag)/config->GetHeat_Flux_Ref();; + HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; } // loop Vertices } // loop Heatflux marker } // loop AllMarker diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 77fd0ce6b2ad..bc9eb4554ebd 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -62,7 +62,6 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); const bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); const bool van_albada = (config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE); - const bool energy = config->GetEnergy_Equation(); /*--- Common preprocessing steps (implemented by CEulerSolver) ---*/ @@ -99,42 +98,49 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container ComputeVorticityAndStrainMag<1>(*config, iMesh); /*--- Compute recovered pressure and temperature for streamwise periodic flow ---*/ - if (config->GetKind_Streamwise_Periodic() != NONE) { + if (config->GetKind_Streamwise_Periodic() != NONE) + Compute_Streamwise_Periodic_Recovered_Values(config, geometry, iMesh); +} - /*--- Define and initialize helping variables ---*/ - su2double dot_product, Pressure_Recovered, Temperature_Recovered; +void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const CGeometry *geometry, + const unsigned short iMesh) { - const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + const bool energy = (config->GetEnergy_Equation() && config->GetStreamwise_Periodic_Temperature()); + const auto InnerIter = config->GetInnerIter(); - /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ - const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); + const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); - /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ - const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); + /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ + const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); - /*--- Compute recoverd pressure and temperature for all points ---*/ - for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { + /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ + const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); - /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ - dot_product = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); + /*--- Compute recoverd pressure and temperature for all points ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { - /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ - Pressure_Recovered = nodes->GetSolution(iPoint, 0) - delta_p / norm2_translation * dot_product; - nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); + /*--- First, compute helping terms based on relative distance (0,l) between periodic markers ---*/ + su2double dot_product = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); - /*--- InnerIter > 0 as otherwise MassFlow in the denominator would be zero ---*/ - if (energy && InnerIter > 0) { - Temperature_Recovered = nodes->GetSolution(iPoint, nDim+1); - Temperature_Recovered += Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; - nodes->SetStreamwise_Periodic_RecoveredTemperature(iPoint, Temperature_Recovered); - } + /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ + const su2double Pressure_Recovered = nodes->GetPressure(iPoint) - delta_p / norm2_translation * dot_product; + nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); + + /*--- InnerIter > 0 as otherwise MassFlow in the denominator would be zero ---*/ + if (energy && InnerIter > 0) { + su2double Temperature_Recovered = nodes->GetTemperature(iPoint); + Temperature_Recovered += Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; + nodes->SetStreamwise_Periodic_RecoveredTemperature(iPoint, Temperature_Recovered); } + } // for iPoint - /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ - GetStreamwise_Periodic_Properties(geometry, config, iMesh); - } // if streamwise periodic + /*--- Compute the integrated Heatflux Q into the domain, and massflow over periodic markers ---*/ + SU2_OMP_MASTER + GetStreamwise_Periodic_Properties(geometry, config, iMesh); + SU2_OMP_BARRIER } void CIncNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, @@ -265,20 +271,20 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; /*--- With streamwise periodic flow and heatflux walls an additional term is introduced in the boundary formulation ---*/ - if (streamwise_periodic && streamwise_periodic_temperature) { + if (streamwise_periodic && streamwise_periodic_temperature) { - Cp = nodes->GetSpecificHeatCp(iPoint); - thermal_conductivity = nodes->GetThermalConductivity(iPoint); + Cp = nodes->GetSpecificHeatCp(iPoint); + thermal_conductivity = nodes->GetThermalConductivity(iPoint); - /*--- Scalar factor of the residual contribution ---*/ - const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); - scalar_factor = Streamwise_Periodic_IntegratedHeatFlow*thermal_conductivity / (Streamwise_Periodic_MassFlow * Cp * norm2_translation); + /*--- Scalar factor of the residual contribution ---*/ + const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); + scalar_factor = Streamwise_Periodic_IntegratedHeatFlow*thermal_conductivity / (Streamwise_Periodic_MassFlow * Cp * norm2_translation); - /*--- Dot product ---*/ - dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), Normal); + /*--- Dot product ---*/ + dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), Normal); - LinSysRes(iPoint, nDim+1) += scalar_factor*dot_product; - } // if streamwise_periodic + LinSysRes(iPoint, nDim+1) += scalar_factor*dot_product; + } // if streamwise_periodic } else { // ISOTHERMAL diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index af5561bf0d0a..cc8b01ae08a8 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -114,8 +114,12 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Delta_Time.resize(nPoint) = su2double(0.0); Lambda.resize(nPoint) = su2double(0.0); Sensor.resize(nPoint) = su2double(0.0); - Streamwise_Periodic_RecoveredPressure.resize(nPoint) = su2double(0.0); - Streamwise_Periodic_RecoveredTemperature.resize(nPoint) = su2double(0.0); + + if (config->GetKind_Streamwise_Periodic() != NONE) { + Streamwise_Periodic_RecoveredPressure.resize(nPoint) = su2double(0.0); + if (config->GetStreamwise_Periodic_Temperature()) + Streamwise_Periodic_RecoveredTemperature.resize(nPoint) = su2double(0.0); + } /* Under-relaxation parameter. */ UnderRelaxation.resize(nPoint) = su2double(1.0); diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index c814359bb32b..f57ffd18df3d 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) { } ofstream Gradient_file; - Gradient_file.precision(config_container[ZONE_0]->GetOutput_Precision()); + Gradient_file.precision(config->OptionIsSet("OUTPUT_PRECISION") ? config->GetOutput_Precision() : 6); /*--- For multizone computations the gradient contributions are summed up and written into one file. ---*/ for (iZone = 0; iZone < nZone; iZone++){ From 55df5816c5ac68b39d0bd23f202e1e1e78db7049 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 1 Mar 2021 14:16:13 +0100 Subject: [PATCH 321/326] Adress PR comments. Part 2. --- Common/include/CConfig.hpp | 6 -- Common/include/option_structure.hpp | 10 +++ Common/src/geometry/CPhysicalGeometry.cpp | 35 ++++++---- SU2_CFD/include/numerics/CNumerics.hpp | 7 +- .../include/numerics/flow/flow_sources.hpp | 14 ++-- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 14 ++-- SU2_CFD/include/solvers/CSolver.hpp | 6 ++ SU2_CFD/src/numerics/flow/flow_sources.cpp | 12 ++-- SU2_CFD/src/output/CFlowIncOutput.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 67 ++++++++++--------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 +- 11 files changed, 102 insertions(+), 75 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 98e3d19ca6c9..b5a5556bf41f 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5766,12 +5766,6 @@ class CConfig { * \return Delta Pressure for body force computation. */ su2double GetStreamwise_Periodic_PressureDrop(void) const { return Streamwise_Periodic_PressureDrop; } - - /*! - * \brief Set the value of the pressure delta from which body force vector is computed. - * \param[in] delta_p - pressure difference between in- and outlet. - */ - void SetStreamwise_Periodic_PressureDrop(su2double delta_p) { Streamwise_Periodic_PressureDrop = delta_p; } /*! * \brief Get the value of the massflow from which body force vector is computed. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 8e79c04ba5bb..52aa9e2a0079 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2270,6 +2270,16 @@ static const MapType Streamwise_Periodic_Map = MakePair("MASSFLOW", STREAMWISE_MASSFLOW) }; +/*! + * \brief Container to hold Variables for streamwise Periodic flow as they are often used together in places. + */ +struct StreamwisePeriodicValues { + su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ + su2double Streamwise_Periodic_MassFlow; /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + su2double Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ +}; + #undef MakePair /* END_CONFIG_ENUMS */ diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 376beea6c033..d9e2d20ef734 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7473,10 +7473,12 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { /*-------------------------------------------------------------------------------------------*/ /*--- Initialize/Allocate variables. ---*/ - su2double min_norm = 0.0; + su2double min_norm = numeric_limits::max(); - vector Buffer_Send_RefNode(nDim, 1e300), - Buffer_Recv_RefNode(static_cast(size)*nDim); + /*--- Communicate Coordinates plus the minimum distance, therefor the nDim+1 ---*/ + vector Buffer_Send_RefNode(nDim+1, numeric_limits::max()); + su2activematrix Buffer_Recv_RefNode(size,nDim+1); + unsigned long iPointMin; /*-------------------------------------------------------------------------------------------*/ /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ @@ -7496,14 +7498,13 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { auto iPoint = vertex[iMarker][iVertex]->GetNode(); - /*--- Get the squared norm of the current point. ---*/ + /*--- Get the squared norm of the current point. sqrt is a monotonic function in [0,R+) so for comparison we dont need Norm. ---*/ auto norm = GeometryToolbox::SquaredNorm(nDim, nodes->GetCoord(iPoint)); - /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iVertex == 0) { + /*--- Check if new unique reference node is found and store Point ID. ---*/ + if (norm < min_norm) { min_norm = norm; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = nodes->GetCoord(iPoint,iDim); + iPointMin = iPoint; } /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ } @@ -7512,9 +7513,14 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { } // periodic conditional } // marker loop + /*--- Copy the Coordinates and norm into send buffer. ---*/ + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Buffer_Send_RefNode[iDim] = nodes->GetCoord(iPointMin,iDim); + Buffer_Send_RefNode[nDim] = min_norm; + /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ - SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim, MPI_DOUBLE, - Buffer_Recv_RefNode.data(), nDim, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim+1, MPI_DOUBLE, + Buffer_Recv_RefNode.data(), nDim+1, MPI_DOUBLE, SU2_MPI::GetComm()); /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ @@ -7522,16 +7528,17 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { /*--- geometry container. ---*/ /*-------------------------------------------------------------------------------------------*/ + min_norm = numeric_limits::max(); + for (int iRank = 0; iRank < size; iRank++) { - /*--- Get the norm of the current Point. ---*/ - auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[static_cast(iRank)*nDim]); + auto norm = Buffer_Recv_RefNode(iRank,nDim); /*--- Check if new unique reference node is found. ---*/ - if (norm < min_norm || iRank == 0) { + if (norm < min_norm) { min_norm = norm; for (unsigned short iDim = 0; iDim < nDim; iDim++) - Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode[iRank*nDim + iDim]; + Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode(iRank,iDim); } } diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 10b5f1d623ed..6c8a575c6f71 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1610,9 +1610,10 @@ class CNumerics { * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. */ - virtual inline void SetStreamwise_Periodic_Values(const su2double massflow, - const su2double integratedHeat, - const su2double inletTemp) { } + virtual void SetStreamwisePeriodicValues(const su2double pressureDrop, const su2double massflow, + const su2double integratedHeat, const su2double inletTemp) { + + } }; /*! diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index fec237bde492..626cf1910bda 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -40,10 +40,7 @@ class CSourceBase_Flow : public CNumerics { protected: su2double* residual = nullptr; su2double** jacobian = nullptr; - su2double - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ + struct StreamwisePeriodicValues SPvals; /*! * \brief Constructor of the class. @@ -65,10 +62,11 @@ class CSourceBase_Flow : public CNumerics { * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. */ - void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { - Streamwise_Periodic_MassFlow = massflow; - Streamwise_Periodic_IntegratedHeatFlow = integratedHeat; - Streamwise_Periodic_InletTemperature = inletTemp; + void SetStreamwisePeriodicValues(const su2double pressureDrop, const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { + SPvals.Streamwise_Periodic_PressureDrop = pressureDrop; + SPvals.Streamwise_Periodic_MassFlow = massflow; + SPvals.Streamwise_Periodic_IntegratedHeatFlow = integratedHeat; + SPvals.Streamwise_Periodic_InletTemperature = inletTemp; } }; diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 7be29fd3c0fb..32b5ce7a2933 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -39,10 +39,10 @@ class CIncEulerSolver : public CFVMFlowSolverBase { protected: vector FluidModel; /*!< \brief fluid model used in the solver. */ - su2double - Streamwise_Periodic_MassFlow, /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ - Streamwise_Periodic_IntegratedHeatFlow, /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ + su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ + su2double Streamwise_Periodic_MassFlow; /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ + su2double Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ /*! * \brief Preprocessing actions common to the Euler and NS solvers. @@ -400,6 +400,12 @@ class CIncEulerSolver : public CFVMFlowSolverBase CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) { /* Value of prescribed pressure drop which results in an artificial body force vector. */ - const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + const su2double delta_p = SPvals.Streamwise_Periodic_PressureDrop; for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0; @@ -706,7 +706,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C /*--- Compute the periodic temperature contribution to the energy equation, if energy equation is considered ---*/ if (energy && streamwisePeriodic_temperature) { - scalar_factor = Streamwise_Periodic_IntegratedHeatFlow * DensityInc_i / (Streamwise_Periodic_MassFlow * norm2_translation); + scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow * DensityInc_i / (SPvals.Streamwise_Periodic_MassFlow * norm2_translation); /*--- Compute scalar-product dot_prod(v*t) ---*/ dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, &V_i[1]); @@ -717,7 +717,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C if(turbulent) { /*--- Compute a scalar factor ---*/ - scalar_factor = Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); + scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow / (SPvals.Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, PrimVar_Grad_i[nDim+5]); @@ -746,14 +746,14 @@ CNumerics::ResidualType<> CSourceIncStreamwisePeriodic_Outlet::ComputeResidual(c // b) a user provided quantity, especially the case for CHT cases su2double factor; if (config->GetStreamwise_Periodic_OutletHeat() == 0.0) - factor = Streamwise_Periodic_IntegratedHeatFlow; + factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow; else factor = config->GetStreamwise_Periodic_OutletHeat() / config->GetHeat_Flux_Ref(); - residual[nDim+1] -= abs(local_Massflow/Streamwise_Periodic_MassFlow) * factor; + residual[nDim+1] -= abs(local_Massflow/SPvals.Streamwise_Periodic_MassFlow) * factor; /*--- Force the area avg inlet Temp to match the Inc_Temperature_Init with additional residual contribution ---*/ - const su2double delta_T = Streamwise_Periodic_InletTemperature - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); + const su2double delta_T = SPvals.Streamwise_Periodic_InletTemperature - config->GetInc_Temperature_Init()/config->GetTemperature_Ref(); residual[nDim+1] += 0.5 * abs(local_Massflow) * SpecificHeat_i * delta_T; return ResidualType<>(residual, jacobian, nullptr); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index d2107bff76e5..64a90fabb223 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -343,7 +343,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv if(streamwisePeriodic) { SetHistoryOutputValue("STREAMWISE_MASSFLOW", flow_solver->GetStreamwise_Periodic_MassFlow()); - SetHistoryOutputValue("STREAMWISE_DP", config->GetStreamwise_Periodic_PressureDrop()); + SetHistoryOutputValue("STREAMWISE_DP", flow_solver->GetStreamwise_Periodic_PressureDrop()); SetHistoryOutputValue("STREAMWISE_HEAT", flow_solver->GetStreamwise_Periodic_IntegratedHeatFlow()); } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 434241dbf0a1..4cf9fed0a701 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1496,8 +1496,8 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } if (streamwise_periodic) { - numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, - Streamwise_Periodic_InletTemperature); + numerics->SetStreamwisePeriodicValues(Streamwise_Periodic_PressureDrop, Streamwise_Periodic_MassFlow, + Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); /*--- Loop over all points ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) @@ -1529,8 +1529,8 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(!streamwise_periodic_temperature && energy) { CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; - second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, - Streamwise_Periodic_InletTemperature); + second_numerics->SetStreamwisePeriodicValues(Streamwise_Periodic_PressureDrop, Streamwise_Periodic_MassFlow, + Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); /*--- This bit acts as a boundary condition rather than a source term. But logically it fits better here. ---*/ for (auto iMarker = 0ul; iMarker < config->GetnMarker_All(); iMarker++) { @@ -1539,30 +1539,29 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == 1) { - SU2_OMP_FOR_STAT(omp_chunk_size) - for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (auto iVertex = 0ul; iVertex < nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->nodes->GetDomain(iPoint)) { + if (!geometry->nodes->GetDomain(iPoint)) continue; - /*--- Load the primitive variables ---*/ - second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); + /*--- Load the primitive variables ---*/ + second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr); - /*--- Set incompressible density ---*/ - second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); + /*--- Set incompressible density ---*/ + second_numerics->SetDensity(nodes->GetDensity(iPoint), 0.0); - /*--- Set the specific heat ---*/ - second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); + /*--- Set the specific heat ---*/ + second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); - /*--- Set the area normal ---*/ - second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); + /*--- Set the area normal ---*/ + second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal()); - /*--- Compute the streamwise periodic source residual and add to the total ---*/ - auto residual = second_numerics->ComputeResidual(config); - LinSysRes.AddBlock(iPoint, residual); + /*--- Compute the streamwise periodic source residual and add to the total ---*/ + auto residual = second_numerics->ComputeResidual(config); + LinSysRes.AddBlock(iPoint, residual); - }// if domain }// for iVertex }// if periodic inlet boundary }// for iMarker @@ -2879,7 +2878,11 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*--- boundary terms of the energy equation. Area and the avg-density are used for the ---*/ /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ /*-------------------------------------------------------------------------------------------------*/ - + + const auto nZone = geometry->GetnZone(); + const auto InnerIter = config->GetInnerIter(); + const auto OuterIter = config->GetOuterIter(); + su2double Area_Local = 0.0, MassFlow_Local = 0.0, Average_Density_Local = 0.0, @@ -2931,9 +2934,15 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Average_Density_Global /= Area_Global; Temperature_Global /= Area_Global; - /*--- Set solver variable ---*/ - Streamwise_Periodic_InletTemperature = Temperature_Global; + /*--- Set solver variables ---*/ Streamwise_Periodic_MassFlow = MassFlow_Global; + Streamwise_Periodic_InletTemperature = Temperature_Global; + + /*--- As deltaP changes with prescribed massflow the const config value should only be used once. ---*/ + if((nZone==1 && InnerIter==0) || + (nZone>1 && OuterIter==0 && InnerIter==0)) { + Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + } if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { /*------------------------------------------------------------------------------------------------*/ @@ -2942,7 +2951,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge /*------------------------------------------------------------------------------------------------*/ /*--- Load/define all necessary variables ---*/ - const su2double Pressure_Drop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); const su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); const su2double damping_factor = config->GetInc_Outlet_Damping(); su2double Pressure_Drop_new, ddP; @@ -2951,7 +2959,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); /*--- Store updated pressure difference ---*/ - Pressure_Drop_new = Pressure_Drop + damping_factor*ddP; + Pressure_Drop_new = Streamwise_Periodic_PressureDrop + damping_factor*ddP; /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times (e.g. 4x for INC_RANS restart). Each time, the pressure drop gets updated. For INC_RANS restarts it gets called 2x before the restart files are read such that the current massflow is @@ -2960,15 +2968,14 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge iteration does not get a pressure-update but the continuing simulation would have an update here. This can be fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at best ---*/ - auto nZone = geometry->GetnZone(); - auto InnerIter = config->GetInnerIter(); - auto OuterIter = config->GetOuterIter(); - if((nZone==1 && InnerIter > 0) || - (nZone>1 && OuterIter > 0)) - config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new); + if((nZone==1 && InnerIter>0) || + (nZone>1 && OuterIter>0)) { + Streamwise_Periodic_PressureDrop = Pressure_Drop_new; + } } // if massflow + if (config->GetEnergy_Equation()) { /*---------------------------------------------------------------------------------------------*/ /*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index bc9eb4554ebd..89ed1220069a 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -108,8 +108,6 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const bool energy = (config->GetEnergy_Equation() && config->GetStreamwise_Periodic_Temperature()); const auto InnerIter = config->GetInnerIter(); - const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); - /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); @@ -126,7 +124,7 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ - const su2double Pressure_Recovered = nodes->GetPressure(iPoint) - delta_p / norm2_translation * dot_product; + const su2double Pressure_Recovered = nodes->GetPressure(iPoint) - Streamwise_Periodic_PressureDrop / norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); /*--- InnerIter > 0 as otherwise MassFlow in the denominator would be zero ---*/ From 03d11b406027d817a38f5db967b0ae12872671cd Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 1 Mar 2021 16:16:26 +0100 Subject: [PATCH 322/326] Resolve warning. --- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index d9e2d20ef734..c1021d38a142 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -7478,7 +7478,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { /*--- Communicate Coordinates plus the minimum distance, therefor the nDim+1 ---*/ vector Buffer_Send_RefNode(nDim+1, numeric_limits::max()); su2activematrix Buffer_Recv_RefNode(size,nDim+1); - unsigned long iPointMin; + unsigned long iPointMin = 0; // Initialisaton, otherwise 'may be uninitialized` warning' /*-------------------------------------------------------------------------------------------*/ /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ From 2f2e6f251cc89a1384df62b59030e9c768a8f3d2 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 1 Mar 2021 23:30:05 +0100 Subject: [PATCH 323/326] Put streamwise periodic solver vars in struct. --- SU2_CFD/include/numerics/CNumerics.hpp | 9 ++---- .../include/numerics/flow/flow_sources.hpp | 11 ++----- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 30 +++---------------- SU2_CFD/include/solvers/CSolver.hpp | 23 ++------------ SU2_CFD/src/output/CFlowIncOutput.cpp | 6 ++-- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 24 ++++++++------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 8 +++-- 7 files changed, 32 insertions(+), 79 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 6c8a575c6f71..ef0172750f59 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -1606,14 +1606,9 @@ class CNumerics { /*! * \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow. - * \param[in] massflow - massflow through periodic marker [kg/s]. - * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. - * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. + * \param[in] SolverSPvals - Struct holding the values. */ - virtual void SetStreamwisePeriodicValues(const su2double pressureDrop, const su2double massflow, - const su2double integratedHeat, const su2double inletTemp) { - - } + virtual void SetStreamwisePeriodicValues(const StreamwisePeriodicValues SolverSPvals) { } }; /*! diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 626cf1910bda..2f5d7275facf 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -58,16 +58,9 @@ class CSourceBase_Flow : public CNumerics { /*! * \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow. - * \param[in] massflow - massflow through periodic marker [kg/s]. - * \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W]. - * \param[in] inletTemp - massflow averaged periodic inlet temperature [K]. + * \param[in] SolverSPvals - Struct holding the values. */ - void SetStreamwisePeriodicValues(const su2double pressureDrop, const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { - SPvals.Streamwise_Periodic_PressureDrop = pressureDrop; - SPvals.Streamwise_Periodic_MassFlow = massflow; - SPvals.Streamwise_Periodic_IntegratedHeatFlow = integratedHeat; - SPvals.Streamwise_Periodic_InletTemperature = inletTemp; - } + void SetStreamwisePeriodicValues(const StreamwisePeriodicValues SolverSPvals) final { SPvals = SolverSPvals; } }; diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 32b5ce7a2933..1772ff41a433 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -39,10 +39,7 @@ class CIncEulerSolver : public CFVMFlowSolverBase { protected: vector FluidModel; /*!< \brief fluid model used in the solver. */ - su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ - su2double Streamwise_Periodic_MassFlow; /*!< \brief Value of current massflow [kg/s] which results in a delta p and therefore an artificial body force vector. */ - su2double Streamwise_Periodic_IntegratedHeatFlow; /*!< \brief Value of of the net sum of heatflow [W] into the domain. */ - su2double Streamwise_Periodic_InletTemperature; /*!< \brief Area avg static Temp [K] at the periodic inlet. Used for adaptive outlet heatsink. */ + StreamwisePeriodicValues SPvals; /*! * \brief Preprocessing actions common to the Euler and NS solvers. @@ -401,27 +398,8 @@ class CIncEulerSolver : public CFVMFlowSolverBaseGetAvg_CFL_Local()); if(streamwisePeriodic) { - SetHistoryOutputValue("STREAMWISE_MASSFLOW", flow_solver->GetStreamwise_Periodic_MassFlow()); - SetHistoryOutputValue("STREAMWISE_DP", flow_solver->GetStreamwise_Periodic_PressureDrop()); - SetHistoryOutputValue("STREAMWISE_HEAT", flow_solver->GetStreamwise_Periodic_IntegratedHeatFlow()); + SetHistoryOutputValue("STREAMWISE_MASSFLOW", flow_solver->GetStreamwisePeriodicValues().Streamwise_Periodic_MassFlow); + SetHistoryOutputValue("STREAMWISE_DP", flow_solver->GetStreamwisePeriodicValues().Streamwise_Periodic_PressureDrop); + SetHistoryOutputValue("STREAMWISE_HEAT", flow_solver->GetStreamwisePeriodicValues().Streamwise_Periodic_IntegratedHeatFlow); } /*--- Set the analyse surface history values --- */ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 4cf9fed0a701..70bf6214dcb8 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1496,8 +1496,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont } if (streamwise_periodic) { - numerics->SetStreamwisePeriodicValues(Streamwise_Periodic_PressureDrop, Streamwise_Periodic_MassFlow, - Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); + + /*--- Set delta_p, m_dot, inlet_T, integrated_heat ---*/ + numerics->SetStreamwisePeriodicValues(SPvals); /*--- Loop over all points ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) @@ -1529,8 +1530,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if(!streamwise_periodic_temperature && energy) { CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; - second_numerics->SetStreamwisePeriodicValues(Streamwise_Periodic_PressureDrop, Streamwise_Periodic_MassFlow, - Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature); + + /*--- Set delta_p, m_dot, inlet_T, integrated_heat ---*/ + second_numerics->SetStreamwisePeriodicValues(SPvals); /*--- This bit acts as a boundary condition rather than a source term. But logically it fits better here. ---*/ for (auto iMarker = 0ul; iMarker < config->GetnMarker_All(); iMarker++) { @@ -2916,7 +2918,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); - /*--- Due to periodicty temperature are euqual one the inlet(1) and outlet(2) ---*/ + /*--- Due to periodicty, temperatures are equal one the inlet(1) and outlet(2) ---*/ Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); } // if domain @@ -2935,13 +2937,13 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge Temperature_Global /= Area_Global; /*--- Set solver variables ---*/ - Streamwise_Periodic_MassFlow = MassFlow_Global; - Streamwise_Periodic_InletTemperature = Temperature_Global; + SPvals.Streamwise_Periodic_MassFlow = MassFlow_Global; + SPvals.Streamwise_Periodic_InletTemperature = Temperature_Global; /*--- As deltaP changes with prescribed massflow the const config value should only be used once. ---*/ if((nZone==1 && InnerIter==0) || (nZone>1 && OuterIter==0 && InnerIter==0)) { - Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + SPvals.Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); } if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { @@ -2959,7 +2961,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); /*--- Store updated pressure difference ---*/ - Pressure_Drop_new = Streamwise_Periodic_PressureDrop + damping_factor*ddP; + Pressure_Drop_new = SPvals.Streamwise_Periodic_PressureDrop + damping_factor*ddP; /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times (e.g. 4x for INC_RANS restart). Each time, the pressure drop gets updated. For INC_RANS restarts it gets called 2x before the restart files are read such that the current massflow is @@ -2970,7 +2972,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge best ---*/ if((nZone==1 && InnerIter>0) || (nZone>1 && OuterIter>0)) { - Streamwise_Periodic_PressureDrop = Pressure_Drop_new; + SPvals.Streamwise_Periodic_PressureDrop = Pressure_Drop_new; } } // if massflow @@ -3013,7 +3015,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Set the solver variable Integrated Heatflux ---*/ - Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; + SPvals.Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; } // if energy } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 89ed1220069a..4fa37ade5bd6 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -124,13 +124,15 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, dot_product += fabs( (geometry->nodes->GetCoord(iPoint,iDim) - ReferenceNode[iDim]) * config->GetPeriodic_Translation(0)[iDim]); /*--- Second, substract/add correction from reduced pressure/temperature to get recoverd pressure/temperature ---*/ - const su2double Pressure_Recovered = nodes->GetPressure(iPoint) - Streamwise_Periodic_PressureDrop / norm2_translation * dot_product; + const su2double Pressure_Recovered = nodes->GetPressure(iPoint) - SPvals.Streamwise_Periodic_PressureDrop / + norm2_translation * dot_product; nodes->SetStreamwise_Periodic_RecoveredPressure(iPoint, Pressure_Recovered); /*--- InnerIter > 0 as otherwise MassFlow in the denominator would be zero ---*/ if (energy && InnerIter > 0) { su2double Temperature_Recovered = nodes->GetTemperature(iPoint); - Temperature_Recovered += Streamwise_Periodic_IntegratedHeatFlow / (Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; + Temperature_Recovered += SPvals.Streamwise_Periodic_IntegratedHeatFlow / + (SPvals.Streamwise_Periodic_MassFlow * nodes->GetSpecificHeatCp(iPoint) * norm2_translation) * dot_product; nodes->SetStreamwise_Periodic_RecoveredTemperature(iPoint, Temperature_Recovered); } } // for iPoint @@ -276,7 +278,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Scalar factor of the residual contribution ---*/ const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); - scalar_factor = Streamwise_Periodic_IntegratedHeatFlow*thermal_conductivity / (Streamwise_Periodic_MassFlow * Cp * norm2_translation); + scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow*thermal_conductivity / (SPvals.Streamwise_Periodic_MassFlow * Cp * norm2_translation); /*--- Dot product ---*/ dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), Normal); From fe7b0de556eac7b80709984cf096d6567cc4cad4 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 2 Mar 2021 10:06:13 +0100 Subject: [PATCH 324/326] Compute mu_t grad via AuxVar. --- Common/src/CConfig.cpp | 1 + SU2_CFD/include/solvers/CSolver.hpp | 2 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 40 ++++++++++++++------- SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- SU2_CFD/src/variables/CIncNSVariable.cpp | 7 ++++ 6 files changed, 39 insertions(+), 15 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index f1fe85e4b98a..5ae576f72d09 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4616,6 +4616,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\", the nondimensionalization with source terms doesn;t work in general.", CURRENT_FUNCTION); if (Axisymmetric) SU2_MPI::Error("Streamwise Periodicity terms does not not have axisymmetric corrections.", CURRENT_FUNCTION); + if (!Energy_Equation) Streamwise_Periodic_Temperature = false; } else { /*--- Safety measure ---*/ Streamwise_Periodic_Temperature = false; diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 705ce63e715f..42af3d4ad5c3 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -4415,7 +4415,7 @@ class CSolver { * \brief Get values for streamwise periodc flow: delta P, m_dot, inlet T, integrated heat. * \return Struct holding 4 su2doubles. */ - virtual StreamwisePeriodicValues GetStreamwisePeriodicValues() const { StreamwisePeriodicValues SPvals; return SPvals; } + virtual StreamwisePeriodicValues GetStreamwisePeriodicValues() const { return StreamwisePeriodicValues(); } protected: diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index e5c670321fb4..b95e176eb6e5 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -720,7 +720,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow / (SPvals.Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); /*--- Compute scalar product between periodic translation vector and eddy viscosity gradient. ---*/ - dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, PrimVar_Grad_i[nDim+5]); + dot_product = GeometryToolbox::DotProduct(nDim, Streamwise_Coord_Vector, AuxVar_Grad_i[0]); residual[nDim+1] -= Volume * scalar_factor * dot_product; } // if turbulent diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 70bf6214dcb8..f05c7686d552 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -105,7 +105,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned nDim = geometry->GetnDim(); /*--- Make sure to align the sizes with the constructor of CIncEulerVariable. ---*/ - nVar = nDim+2; nPrimVar = nDim+9; nPrimVarGrad = nDim+6; + nVar = nDim+2; nPrimVar = nDim+9; nPrimVarGrad = nDim+4; /*--- Initialize nVarGrad for deallocation ---*/ @@ -1263,6 +1263,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool viscous = config->GetViscous(); const bool radiation = config->AddRadiation(); const bool vol_heat = config->GetHeatSource(); + const bool turbulent = (config->GetKind_Turb_Model() != NONE); const bool energy = config->GetEnergy_Equation(); const bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); @@ -1382,7 +1383,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (yCoord > EPS) AuxVar = Total_Viscosity*yVelocity/yCoord; - /*--- Set the auxilairy variable for this node. ---*/ + /*--- Set the auxiliary variable for this node. ---*/ nodes->SetAuxVar(iPoint, 0, AuxVar); @@ -1497,6 +1498,25 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont if (streamwise_periodic) { + /*--- For turbulent streamwise periodic problems w/ energy eq, we need an additional gradient of Eddy viscosity. ---*/ + if (streamwise_periodic_temperature && turbulent) { + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (iPoint = 0; iPoint < nPoint; iPoint++) { + /*--- Set the auxiliary variable, Eddy viscosity mu_t, for this node. ---*/ + nodes->SetAuxVar(iPoint, 0, nodes->GetEddyViscosity(iPoint)); + } + + /*--- Compute the auxiliary variable gradient with GG or WLS. ---*/ + if (config->GetKind_Gradient_Method() == GREEN_GAUSS) { + SetAuxVar_Gradient_GG(geometry, config); + } + if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { + SetAuxVar_Gradient_LS(geometry, config); + } + + } // if turbulent + /*--- Set delta_p, m_dot, inlet_T, integrated_heat ---*/ numerics->SetStreamwisePeriodicValues(SPvals); @@ -1513,11 +1533,9 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Load the volume of the dual mesh cell ---*/ numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); - /*--- If viscous, we need gradients for extra terms. ---*/ - if (viscous) { - /*--- Gradient of the primitive variables ---*/ - numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nullptr); - } + /*--- Load the aux variable gradient that we already computed. ---*/ + if(streamwise_periodic_temperature && turbulent) + numerics->SetAuxVarGrad(nodes->GetAuxVarGradient(iPoint), nullptr); /*--- Compute the streamwise periodic source residual and add to the total ---*/ auto residual = numerics->ComputeResidual(config); @@ -1526,9 +1544,10 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Add the implicit Jacobian contribution ---*/ if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - }// for iPoint + } // for iPoint if(!streamwise_periodic_temperature && energy) { + CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; /*--- Set delta_p, m_dot, inlet_T, integrated_heat ---*/ @@ -2908,11 +2927,8 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - // One could add a CVariable method to return a pointer to the first Vel element to directly plug into GeomToolbox - su2double Velocity[MAXNDIM] = {0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); } /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ - MassFlow_Local += GeometryToolbox::DotProduct(nDim, AreaNormal, Velocity) * nodes->GetDensity(iPoint); + MassFlow_Local += nodes->GetProjVel(iPoint, AreaNormal) * nodes->GetDensity(iPoint); Area_Local += FaceArea; diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index cc8b01ae08a8..ed632d4ac457 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -39,7 +39,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci /*--- Allocate and initialize the primitive variables and gradients. Make sure to align the sizes with the constructor of CIncEulerSolver ---*/ - nPrimVar = nDim+9; nPrimVarGrad = nDim+6; + nPrimVar = nDim+9; nPrimVarGrad = nDim+4; /*--- Allocate residual structures ---*/ diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index 008dc5457090..68fb0000ccd0 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -42,6 +42,13 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); Grad_AuxVar.resize(nPoint,nAuxVar,nDim); } + + /*--- Allocate memory for the AuxVar+gradient of eddy viscosity mu_t ---*/ + if (config->GetStreamwise_Periodic_Temperature() && (config->GetKind_Turb_Model() != NONE)) { + nAuxVar = 1; + AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); + Grad_AuxVar.resize(nPoint,nAuxVar,nDim); + } } bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel) { From 8e7e567e174c6a2c818da5cb802c2a560caa7a90 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 2 Mar 2021 10:47:14 +0100 Subject: [PATCH 325/326] Move GetStreamwisePerProp from Euler to NS solver. --- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 11 -- SU2_CFD/include/solvers/CIncNSSolver.hpp | 11 ++ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 154 -------------------- SU2_CFD/src/solvers/CIncNSSolver.cpp | 154 ++++++++++++++++++++ SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- 5 files changed, 166 insertions(+), 166 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 1772ff41a433..796d409d4381 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -119,17 +119,6 @@ class CIncEulerSolver : public CFVMFlowSolverBase void Explicit_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep); - /*! - * \brief Compute necessary quantities (massflow, integrated heatflux, avg density) - * for streamwise periodic cases. Also sets new delta P for prescribed massflow. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iMesh - current mesh level for the multigrid. - */ - void GetStreamwise_Periodic_Properties(const CGeometry *geometry, - CConfig *config, - const unsigned short iMesh); - public: /*! * \brief Constructor of the class. diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index e0d7878d23be..04f8d4286e11 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -65,6 +65,17 @@ class CIncNSSolver final : public CIncEulerSolver { void Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) override; + /*! + * \brief Compute necessary quantities (massflow, integrated heatflux, avg density) + * for streamwise periodic cases. Also sets new delta P for prescribed massflow. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - current mesh level for the multigrid. + */ + void GetStreamwise_Periodic_Properties(const CGeometry *geometry, + CConfig *config, + const unsigned short iMesh); + /*! * \brief Compute recovered pressure/temperature for streamwise periodic flow and store in CVariable. * \param[in] config - Definition of the particular problem. diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index f05c7686d552..90b3f0eab48d 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2882,160 +2882,6 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, - CConfig *config, - const unsigned short iMesh) { - - /*---------------------------------------------------------------------------------------------*/ - // 1. Evaluate massflow, area avg density & Temperature and Area at streamwise periodic outlet. - // 2. Update delta_p is target massflow is chosen. - // 3. Loop Heatflux markers and integrate heat across the boundary. Only if energy equation is on. - /*---------------------------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------------------------------*/ - /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ - /*--- (there can be only one) streamwise periodic outlet/donor marker. Massflow is obviously ---*/ - /*--- needed for prescribed massflow but also for the additional source and heatflux ---*/ - /*--- boundary terms of the energy equation. Area and the avg-density are used for the ---*/ - /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ - /*-------------------------------------------------------------------------------------------------*/ - - const auto nZone = geometry->GetnZone(); - const auto InnerIter = config->GetInnerIter(); - const auto OuterIter = config->GetOuterIter(); - - su2double Area_Local = 0.0, - MassFlow_Local = 0.0, - Average_Density_Local = 0.0, - Temperature_Local = 0.0; - - for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - /*--- Only "outlet"/donor periodic marker ---*/ - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 2) { - - for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - - const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - - /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ - MassFlow_Local += nodes->GetProjVel(iPoint, AreaNormal) * nodes->GetDensity(iPoint); - - Area_Local += FaceArea; - - Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); - - /*--- Due to periodicty, temperatures are equal one the inlet(1) and outlet(2) ---*/ - Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); - - } // if domain - } // loop vertices - } // loop periodic boundaries - } // loop MarkerAll - - // MPI Communication: Sum Area, Sum rho*A & T*A and divide by AreaGlobbal, sum massflow - su2double Area_Global(0), Average_Density_Global(0), MassFlow_Global(0), Temperature_Global(0); - SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - - Average_Density_Global /= Area_Global; - Temperature_Global /= Area_Global; - - /*--- Set solver variables ---*/ - SPvals.Streamwise_Periodic_MassFlow = MassFlow_Global; - SPvals.Streamwise_Periodic_InletTemperature = Temperature_Global; - - /*--- As deltaP changes with prescribed massflow the const config value should only be used once. ---*/ - if((nZone==1 && InnerIter==0) || - (nZone>1 && OuterIter==0 && InnerIter==0)) { - SPvals.Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); - } - - if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { - /*------------------------------------------------------------------------------------------------*/ - /*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/ - /*--- The Pressure drop is iteratively adapted to result in the prescribed Target-Massflow. ---*/ - /*------------------------------------------------------------------------------------------------*/ - - /*--- Load/define all necessary variables ---*/ - const su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); - const su2double damping_factor = config->GetInc_Outlet_Damping(); - su2double Pressure_Drop_new, ddP; - - /*--- Compute update to Delta p based on massflow-difference ---*/ - ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); - - /*--- Store updated pressure difference ---*/ - Pressure_Drop_new = SPvals.Streamwise_Periodic_PressureDrop + damping_factor*ddP; - /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times - (e.g. 4x for INC_RANS restart). Each time, the pressure drop gets updated. For INC_RANS restarts - it gets called 2x before the restart files are read such that the current massflow is - Area*inital-velocity which can be way off! - With this there is still a slight inconsitency wrt to a non-restarted simulation: The restarted "zero-th" - iteration does not get a pressure-update but the continuing simulation would have an update here. This can be - fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at - best ---*/ - if((nZone==1 && InnerIter>0) || - (nZone>1 && OuterIter>0)) { - SPvals.Streamwise_Periodic_PressureDrop = Pressure_Drop_new; - } - - } // if massflow - - - if (config->GetEnergy_Equation()) { - /*---------------------------------------------------------------------------------------------*/ - /*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/ - /*--- boundary term and recovered Temperature. The computation is not completely clear. ---*/ - /*--- Here the Heatflux from all Bounary markers in the config-file is used. ---*/ - /*---------------------------------------------------------------------------------------------*/ - - su2double HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; - - /*--- Loop over all heatflux Markers ---*/ - for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { - - /*--- Identify the boundary by string name and retrive heatflux from config ---*/ - const auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); - const auto Wall_HeatFlux = config->GetWall_HeatFlux(Marker_StringTag); - - for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (!geometry->nodes->GetDomain(iPoint)) continue; - - const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - - HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; - } // loop Vertices - } // loop Heatflux marker - } // loop AllMarker - - /*--- MPI Communication sum up integrated Heatflux from all processes ---*/ - SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - - /*--- Set the solver variable Integrated Heatflux ---*/ - SPvals.Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; - } // if energy -} - - void CIncEulerSolver::PrintVerificationError(const CConfig *config) const { if ((rank != MASTER_NODE) || (MGLevel != MESH_0)) return; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 4fa37ade5bd6..4418cef5eb53 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -102,6 +102,160 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container Compute_Streamwise_Periodic_Recovered_Values(config, geometry, iMesh); } +void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, + CConfig *config, + const unsigned short iMesh) { + + /*---------------------------------------------------------------------------------------------*/ + // 1. Evaluate massflow, area avg density & Temperature and Area at streamwise periodic outlet. + // 2. Update delta_p is target massflow is chosen. + // 3. Loop Heatflux markers and integrate heat across the boundary. Only if energy equation is on. + /*---------------------------------------------------------------------------------------------*/ + + /*-------------------------------------------------------------------------------------------------*/ + /*--- 1. Evaluate Massflow [kg/s], area-averaged density [kg/m^3] and Area [m^2] at the ---*/ + /*--- (there can be only one) streamwise periodic outlet/donor marker. Massflow is obviously ---*/ + /*--- needed for prescribed massflow but also for the additional source and heatflux ---*/ + /*--- boundary terms of the energy equation. Area and the avg-density are used for the ---*/ + /*--- Pressure-Drop update in case of a prescribed massflow. ---*/ + /*-------------------------------------------------------------------------------------------------*/ + + const auto nZone = geometry->GetnZone(); + const auto InnerIter = config->GetInnerIter(); + const auto OuterIter = config->GetOuterIter(); + + su2double Area_Local = 0.0, + MassFlow_Local = 0.0, + Average_Density_Local = 0.0, + Temperature_Local = 0.0; + + for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- Only "outlet"/donor periodic marker ---*/ + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && + config->GetMarker_All_PerBound(iMarker) == 2) { + + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->nodes->GetDomain(iPoint)) { + + /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ + + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + + /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ + MassFlow_Local += nodes->GetProjVel(iPoint, AreaNormal) * nodes->GetDensity(iPoint); + + Area_Local += FaceArea; + + Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); + + /*--- Due to periodicty, temperatures are equal one the inlet(1) and outlet(2) ---*/ + Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); + + } // if domain + } // loop vertices + } // loop periodic boundaries + } // loop MarkerAll + + // MPI Communication: Sum Area, Sum rho*A & T*A and divide by AreaGlobbal, sum massflow + su2double Area_Global(0), Average_Density_Global(0), MassFlow_Global(0), Temperature_Global(0); + SU2_MPI::Allreduce(&Area_Local, &Area_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Average_Density_Local, &Average_Density_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&MassFlow_Local, &MassFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Temperature_Local, &Temperature_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + + Average_Density_Global /= Area_Global; + Temperature_Global /= Area_Global; + + /*--- Set solver variables ---*/ + SPvals.Streamwise_Periodic_MassFlow = MassFlow_Global; + SPvals.Streamwise_Periodic_InletTemperature = Temperature_Global; + + /*--- As deltaP changes with prescribed massflow the const config value should only be used once. ---*/ + if((nZone==1 && InnerIter==0) || + (nZone>1 && OuterIter==0 && InnerIter==0)) { + SPvals.Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); + } + + if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { + /*------------------------------------------------------------------------------------------------*/ + /*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/ + /*--- The Pressure drop is iteratively adapted to result in the prescribed Target-Massflow. ---*/ + /*------------------------------------------------------------------------------------------------*/ + + /*--- Load/define all necessary variables ---*/ + const su2double TargetMassFlow = config->GetStreamwise_Periodic_TargetMassFlow() / (config->GetDensity_Ref() * config->GetVelocity_Ref()); + const su2double damping_factor = config->GetInc_Outlet_Damping(); + su2double Pressure_Drop_new, ddP; + + /*--- Compute update to Delta p based on massflow-difference ---*/ + ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2)); + + /*--- Store updated pressure difference ---*/ + Pressure_Drop_new = SPvals.Streamwise_Periodic_PressureDrop + damping_factor*ddP; + /*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times + (e.g. 4x for INC_RANS restart). Each time, the pressure drop gets updated. For INC_RANS restarts + it gets called 2x before the restart files are read such that the current massflow is + Area*inital-velocity which can be way off! + With this there is still a slight inconsitency wrt to a non-restarted simulation: The restarted "zero-th" + iteration does not get a pressure-update but the continuing simulation would have an update here. This can be + fully neglected if the pressure drop is converged. And for all other cases it should be minor difference at + best ---*/ + if((nZone==1 && InnerIter>0) || + (nZone>1 && OuterIter>0)) { + SPvals.Streamwise_Periodic_PressureDrop = Pressure_Drop_new; + } + + } // if massflow + + + if (config->GetEnergy_Equation()) { + /*---------------------------------------------------------------------------------------------*/ + /*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/ + /*--- boundary term and recovered Temperature. The computation is not completely clear. ---*/ + /*--- Here the Heatflux from all Bounary markers in the config-file is used. ---*/ + /*---------------------------------------------------------------------------------------------*/ + + su2double HeatFlow_Local = 0.0, HeatFlow_Global = 0.0; + + /*--- Loop over all heatflux Markers ---*/ + for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + if (config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) { + + /*--- Identify the boundary by string name and retrive heatflux from config ---*/ + const auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); + const auto Wall_HeatFlux = config->GetWall_HeatFlux(Marker_StringTag); + + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (!geometry->nodes->GetDomain(iPoint)) continue; + + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + + HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; + } // loop Vertices + } // loop Heatflux marker + } // loop AllMarker + + /*--- MPI Communication sum up integrated Heatflux from all processes ---*/ + SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + + /*--- Set the solver variable Integrated Heatflux ---*/ + SPvals.Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global; + } // if energy +} + + void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const CGeometry *geometry, const unsigned short iMesh) { diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index ed632d4ac457..df0e8da3737d 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -91,7 +91,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Primitive.resize(nPoint,nPrimVar) = su2double(0.0); - /*--- Incompressible flow, gradients primitive variables nDim+6, (P, vx, vy, vz, T, rho, beta, lamMu, EddyMu) ---*/ + /*--- Incompressible flow, gradients primitive variables nDim+4, (P, vx, vy, vz, T, rho, beta) ---*/ if (config->GetMUSCL_Flow() || viscous) { Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); From c1aa5d9f8f435d3b03ea9a4b37373f8d799c197e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 2 Mar 2021 16:02:12 +0000 Subject: [PATCH 326/326] Changing version number to 7.1.1 --- Common/doc/docmain.hpp | 4 +- Common/include/CConfig.hpp | 2 +- Common/include/adt/CADTBaseClass.hpp | 2 +- Common/include/adt/CADTComparePointClass.hpp | 2 +- Common/include/adt/CADTElemClass.hpp | 4 +- Common/include/adt/CADTNodeClass.hpp | 2 +- Common/include/adt/CADTPointsOnlyClass.hpp | 2 +- Common/include/adt/CBBoxTargetClass.hpp | 4 +- Common/include/basic_types/ad_structure.hpp | 2 +- .../basic_types/datatype_structure.hpp | 2 +- Common/include/containers/C2DContainer.hpp | 2 +- .../containers/CFastFindAndEraseQueue.hpp | 2 +- Common/include/containers/CVertexMap.hpp | 2 +- .../containers/container_decorators.hpp | 2 +- Common/include/fem/fem_cgns_elements.hpp | 4 +- .../fem/fem_gauss_jacobi_quadrature.hpp | 4 +- Common/include/fem/fem_geometry_structure.hpp | 24 +- Common/include/fem/fem_standard_element.hpp | 10 +- .../fem/geometry_structure_fem_part.hpp | 2 +- Common/include/geometry/CDummyGeometry.hpp | 2 +- Common/include/geometry/CGeometry.hpp | 2 +- .../include/geometry/CMultiGridGeometry.hpp | 2 +- Common/include/geometry/CMultiGridQueue.hpp | 2 +- Common/include/geometry/CPhysicalGeometry.hpp | 2 +- .../include/geometry/dual_grid/CDualGrid.hpp | 2 +- Common/include/geometry/dual_grid/CEdge.hpp | 2 +- Common/include/geometry/dual_grid/CPoint.hpp | 2 +- .../geometry/dual_grid/CTurboVertex.hpp | 2 +- Common/include/geometry/dual_grid/CVertex.hpp | 2 +- Common/include/geometry/elements/CElement.hpp | 4 +- .../geometry/elements/CElementProperty.hpp | 6 +- .../geometry/elements/CGaussVariable.hpp | 4 +- .../geometry/meshreader/CBoxMeshReaderFVM.hpp | 2 +- .../meshreader/CCGNSMeshReaderFVM.hpp | 2 +- .../geometry/meshreader/CMeshReaderFVM.hpp | 2 +- .../meshreader/CRectangularMeshReaderFVM.hpp | 2 +- .../meshreader/CSU2ASCIIMeshReaderFVM.hpp | 2 +- .../geometry/primal_grid/CHexahedron.hpp | 2 +- Common/include/geometry/primal_grid/CLine.hpp | 2 +- .../geometry/primal_grid/CPrimalGrid.hpp | 2 +- .../primal_grid/CPrimalGridBoundFEM.hpp | 4 +- .../geometry/primal_grid/CPrimalGridFEM.hpp | 4 +- .../include/geometry/primal_grid/CPrism.hpp | 2 +- .../include/geometry/primal_grid/CPyramid.hpp | 2 +- .../geometry/primal_grid/CQuadrilateral.hpp | 2 +- .../geometry/primal_grid/CTetrahedron.hpp | 2 +- .../geometry/primal_grid/CTriangle.hpp | 2 +- .../geometry/primal_grid/CVertexMPI.hpp | 2 +- Common/include/graph_coloring_structure.hpp | 4 +- .../grid_movement/CBSplineBlending.hpp | 2 +- .../include/grid_movement/CBezierBlending.hpp | 2 +- .../grid_movement/CFreeFormBlending.hpp | 2 +- .../include/grid_movement/CFreeFormDefBox.hpp | 2 +- .../include/grid_movement/CGridMovement.hpp | 2 +- .../grid_movement/CSurfaceMovement.hpp | 2 +- .../grid_movement/CVolumetricMovement.hpp | 2 +- .../interface_interpolation/CInterpolator.hpp | 2 +- .../CInterpolatorFactory.hpp | 2 +- .../CIsoparametric.hpp | 2 +- .../interface_interpolation/CMirror.hpp | 2 +- .../CNearestNeighbor.hpp | 2 +- .../CRadialBasisFunction.hpp | 2 +- .../interface_interpolation/CSlidingMesh.hpp | 2 +- .../linear_algebra/CMatrixVectorProduct.hpp | 2 +- .../include/linear_algebra/CPastixWrapper.hpp | 2 +- .../linear_algebra/CPreconditioner.hpp | 2 +- Common/include/linear_algebra/CSysMatrix.hpp | 2 +- Common/include/linear_algebra/CSysMatrix.inl | 2 +- Common/include/linear_algebra/CSysSolve.hpp | 2 +- Common/include/linear_algebra/CSysSolve_b.hpp | 2 +- Common/include/linear_algebra/CSysVector.hpp | 2 +- .../include/linear_algebra/blas_structure.hpp | 4 +- .../linear_algebra/vector_expressions.hpp | 2 +- Common/include/option_structure.hpp | 2 +- Common/include/option_structure.inl | 2 +- .../include/parallelization/mpi_structure.cpp | 2 +- .../include/parallelization/mpi_structure.hpp | 2 +- .../include/parallelization/omp_structure.hpp | 2 +- .../parallelization/special_vectorization.hpp | 2 +- .../include/parallelization/vectorization.hpp | 2 +- Common/include/toolboxes/C1DInterpolation.hpp | 2 +- .../include/toolboxes/CLinearPartitioner.hpp | 2 +- .../toolboxes/CQuasiNewtonInvLeastSquares.hpp | 2 +- Common/include/toolboxes/CSquareMatrixCM.hpp | 2 +- Common/include/toolboxes/CSymmetricMatrix.hpp | 2 +- .../include/toolboxes/MMS/CIncTGVSolution.hpp | 2 +- .../toolboxes/MMS/CInviscidVortexSolution.hpp | 2 +- .../toolboxes/MMS/CMMSIncEulerSolution.hpp | 2 +- .../toolboxes/MMS/CMMSIncNSSolution.hpp | 2 +- .../MMS/CMMSNSTwoHalfCirclesSolution.hpp | 2 +- .../MMS/CMMSNSTwoHalfSpheresSolution.hpp | 2 +- .../toolboxes/MMS/CMMSNSUnitQuadSolution.hpp | 2 +- .../MMS/CMMSNSUnitQuadSolutionWallBC.hpp | 2 +- .../toolboxes/MMS/CNSUnitQuadSolution.hpp | 2 +- .../toolboxes/MMS/CRinglebSolution.hpp | 2 +- Common/include/toolboxes/MMS/CTGVSolution.hpp | 2 +- .../toolboxes/MMS/CUserDefinedSolution.hpp | 2 +- .../toolboxes/MMS/CVerificationSolution.hpp | 2 +- .../include/toolboxes/allocation_toolbox.hpp | 2 +- Common/include/toolboxes/geometry_toolbox.hpp | 2 +- Common/include/toolboxes/graph_toolbox.hpp | 2 +- Common/include/toolboxes/printing_toolbox.hpp | 2 +- Common/include/wall_model.hpp | 4 +- Common/lib/Makefile.am | 2 +- Common/src/CConfig.cpp | 4 +- Common/src/adt/CADTBaseClass.cpp | 2 +- Common/src/adt/CADTElemClass.cpp | 2 +- Common/src/adt/CADTPointsOnlyClass.cpp | 2 +- Common/src/basic_types/ad_structure.cpp | 2 +- Common/src/fem/fem_cgns_elements.cpp | 2 +- .../src/fem/fem_gauss_jacobi_quadrature.cpp | 2 +- Common/src/fem/fem_geometry_structure.cpp | 2 +- Common/src/fem/fem_integration_rules.cpp | 2 +- Common/src/fem/fem_standard_element.cpp | 2 +- Common/src/fem/fem_wall_distance.cpp | 2 +- Common/src/fem/fem_work_estimate_metis.cpp | 2 +- .../src/fem/geometry_structure_fem_part.cpp | 2 +- Common/src/geometry/CDummyGeometry.cpp | 2 +- Common/src/geometry/CGeometry.cpp | 2 +- Common/src/geometry/CMultiGridGeometry.cpp | 2 +- Common/src/geometry/CMultiGridQueue.cpp | 2 +- Common/src/geometry/CPhysicalGeometry.cpp | 2 +- Common/src/geometry/dual_grid/CDualGrid.cpp | 2 +- Common/src/geometry/dual_grid/CEdge.cpp | 2 +- Common/src/geometry/dual_grid/CPoint.cpp | 2 +- .../src/geometry/dual_grid/CTurboVertex.cpp | 2 +- Common/src/geometry/dual_grid/CVertex.cpp | 2 +- Common/src/geometry/elements/CElement.cpp | 2 +- Common/src/geometry/elements/CHEXA8.cpp | 2 +- Common/src/geometry/elements/CPRISM6.cpp | 2 +- Common/src/geometry/elements/CPYRAM5.cpp | 2 +- Common/src/geometry/elements/CQUAD4.cpp | 2 +- Common/src/geometry/elements/CTETRA1.cpp | 2 +- Common/src/geometry/elements/CTRIA1.cpp | 2 +- .../geometry/meshreader/CBoxMeshReaderFVM.cpp | 2 +- .../meshreader/CCGNSMeshReaderFVM.cpp | 2 +- .../geometry/meshreader/CMeshReaderFVM.cpp | 2 +- .../meshreader/CRectangularMeshReaderFVM.cpp | 2 +- .../meshreader/CSU2ASCIIMeshReaderFVM.cpp | 2 +- .../src/geometry/primal_grid/CHexahedron.cpp | 2 +- Common/src/geometry/primal_grid/CLine.cpp | 2 +- .../src/geometry/primal_grid/CPrimalGrid.cpp | 2 +- .../primal_grid/CPrimalGridBoundFEM.cpp | 2 +- .../geometry/primal_grid/CPrimalGridFEM.cpp | 2 +- Common/src/geometry/primal_grid/CPrism.cpp | 2 +- Common/src/geometry/primal_grid/CPyramid.cpp | 2 +- .../geometry/primal_grid/CQuadrilateral.cpp | 2 +- .../src/geometry/primal_grid/CTetrahedron.cpp | 2 +- Common/src/geometry/primal_grid/CTriangle.cpp | 2 +- .../src/geometry/primal_grid/CVertexMPI.cpp | 2 +- Common/src/graph_coloring_structure.cpp | 2 +- Common/src/grid_movement/CBSplineBlending.cpp | 2 +- Common/src/grid_movement/CBezierBlending.cpp | 2 +- .../src/grid_movement/CFreeFormBlending.cpp | 2 +- Common/src/grid_movement/CFreeFormDefBox.cpp | 2 +- Common/src/grid_movement/CGridMovement.cpp | 2 +- Common/src/grid_movement/CSurfaceMovement.cpp | 2 +- .../src/grid_movement/CVolumetricMovement.cpp | 2 +- .../interface_interpolation/CInterpolator.cpp | 2 +- .../CInterpolatorFactory.cpp | 2 +- .../CIsoparametric.cpp | 2 +- .../src/interface_interpolation/CMirror.cpp | 2 +- .../CNearestNeighbor.cpp | 2 +- .../CRadialBasisFunction.cpp | 2 +- .../interface_interpolation/CSlidingMesh.cpp | 2 +- Common/src/linear_algebra/CPastixWrapper.cpp | 2 +- Common/src/linear_algebra/CSysMatrix.cpp | 2 +- Common/src/linear_algebra/CSysSolve.cpp | 2 +- Common/src/linear_algebra/CSysSolve_b.cpp | 2 +- Common/src/linear_algebra/CSysVector.cpp | 2 +- Common/src/toolboxes/C1DInterpolation.cpp | 2 +- Common/src/toolboxes/CLinearPartitioner.cpp | 2 +- Common/src/toolboxes/CSquareMatrixCM.cpp | 2 +- Common/src/toolboxes/CSymmetricMatrix.cpp | 2 +- Common/src/toolboxes/MMS/CIncTGVSolution.cpp | 2 +- .../toolboxes/MMS/CInviscidVortexSolution.cpp | 2 +- .../toolboxes/MMS/CMMSIncEulerSolution.cpp | 2 +- .../src/toolboxes/MMS/CMMSIncNSSolution.cpp | 2 +- .../MMS/CMMSNSTwoHalfCirclesSolution.cpp | 2 +- .../MMS/CMMSNSTwoHalfSpheresSolution.cpp | 2 +- .../toolboxes/MMS/CMMSNSUnitQuadSolution.cpp | 2 +- .../MMS/CMMSNSUnitQuadSolutionWallBC.cpp | 2 +- .../src/toolboxes/MMS/CNSUnitQuadSolution.cpp | 2 +- Common/src/toolboxes/MMS/CRinglebSolution.cpp | 2 +- Common/src/toolboxes/MMS/CTGVSolution.cpp | 2 +- .../toolboxes/MMS/CUserDefinedSolution.cpp | 2 +- .../toolboxes/MMS/CVerificationSolution.cpp | 2 +- .../CMMSIncEulerSolution.py | 2 +- .../CreateMMSSourceTerms/CMMSIncNSSolution.py | 2 +- Common/src/toolboxes/printing_toolbox.cpp | 2 +- Common/src/wall_model.cpp | 2 +- Makefile.am | 2 +- QuickStart/inv_NACA0012.cfg | 2 +- README.md | 2 +- SU2_CFD/include/CMarkerProfileReaderFVM.hpp | 2 +- SU2_CFD/include/SU2_CFD.hpp | 2 +- SU2_CFD/include/definition_structure.hpp | 2 +- .../drivers/CDiscAdjMultizoneDriver.hpp | 2 +- .../drivers/CDiscAdjSinglezoneDriver.hpp | 4 +- SU2_CFD/include/drivers/CDriver.hpp | 2 +- SU2_CFD/include/drivers/CDummyDriver.hpp | 2 +- SU2_CFD/include/drivers/CMultizoneDriver.hpp | 4 +- SU2_CFD/include/drivers/CSinglezoneDriver.hpp | 4 +- SU2_CFD/include/fluid/CConductivityModel.hpp | 2 +- .../include/fluid/CConstantConductivity.hpp | 2 +- .../fluid/CConstantConductivityRANS.hpp | 2 +- SU2_CFD/include/fluid/CConstantDensity.hpp | 2 +- SU2_CFD/include/fluid/CConstantPrandtl.hpp | 2 +- .../include/fluid/CConstantPrandtlRANS.hpp | 2 +- SU2_CFD/include/fluid/CConstantViscosity.hpp | 2 +- SU2_CFD/include/fluid/CFluidModel.hpp | 2 +- SU2_CFD/include/fluid/CIdealGas.hpp | 2 +- SU2_CFD/include/fluid/CIncIdealGas.hpp | 2 +- .../include/fluid/CIncIdealGasPolynomial.hpp | 2 +- SU2_CFD/include/fluid/CMutationTCLib.hpp | 2 +- SU2_CFD/include/fluid/CNEMOGas.hpp | 2 +- SU2_CFD/include/fluid/CPengRobinson.hpp | 2 +- .../include/fluid/CPolynomialConductivity.hpp | 2 +- .../fluid/CPolynomialConductivityRANS.hpp | 2 +- .../include/fluid/CPolynomialViscosity.hpp | 2 +- SU2_CFD/include/fluid/CSU2TCLib.hpp | 2 +- SU2_CFD/include/fluid/CSutherland.hpp | 2 +- SU2_CFD/include/fluid/CVanDerWaalsGas.hpp | 2 +- SU2_CFD/include/fluid/CViscosityModel.hpp | 2 +- .../gradients/computeGradientsGreenGauss.hpp | 2 +- .../computeGradientsLeastSquares.hpp | 2 +- .../integration/CFEM_DG_Integration.hpp | 4 +- SU2_CFD/include/integration/CIntegration.hpp | 2 +- .../integration/CMultiGridIntegration.hpp | 2 +- .../integration/CNewtonIntegration.hpp | 2 +- .../integration/CSingleGridIntegration.hpp | 2 +- .../integration/CStructuralIntegration.hpp | 2 +- SU2_CFD/include/interfaces/CInterface.hpp | 4 +- .../cfd/CConservativeVarsInterface.hpp | 2 +- .../interfaces/cfd/CMixingPlaneInterface.hpp | 2 +- .../interfaces/cfd/CSlidingInterface.hpp | 2 +- .../cht/CConjugateHeatInterface.hpp | 2 +- .../fsi/CDiscAdjFlowTractionInterface.hpp | 2 +- .../fsi/CDisplacementsInterface.hpp | 2 +- .../interfaces/fsi/CFlowTractionInterface.hpp | 2 +- .../include/iteration/CAdjFluidIteration.hpp | 2 +- .../iteration/CDiscAdjFEAIteration.hpp | 2 +- .../iteration/CDiscAdjFluidIteration.hpp | 2 +- .../iteration/CDiscAdjHeatIteration.hpp | 2 +- SU2_CFD/include/iteration/CFEAIteration.hpp | 4 +- .../include/iteration/CFEMFluidIteration.hpp | 4 +- SU2_CFD/include/iteration/CFluidIteration.hpp | 2 +- SU2_CFD/include/iteration/CHeatIteration.hpp | 2 +- SU2_CFD/include/iteration/CIteration.hpp | 2 +- .../include/iteration/CIterationFactory.hpp | 2 +- SU2_CFD/include/iteration/CTurboIteration.hpp | 2 +- SU2_CFD/include/limiters/CLimiterDetails.hpp | 2 +- SU2_CFD/include/limiters/computeLimiters.hpp | 2 +- .../include/limiters/computeLimiters_impl.hpp | 2 +- SU2_CFD/include/numerics/CNumerics.hpp | 2 +- .../include/numerics/NEMO/CNEMONumerics.hpp | 2 +- .../include/numerics/NEMO/NEMO_diffusion.hpp | 6 +- .../include/numerics/NEMO/NEMO_sources.hpp | 4 +- .../include/numerics/NEMO/convection/ausm.hpp | 2 +- .../numerics/NEMO/convection/ausmplusup2.hpp | 2 +- .../numerics/NEMO/convection/ausmpwplus.hpp | 2 +- .../include/numerics/NEMO/convection/lax.hpp | 2 +- .../include/numerics/NEMO/convection/msw.hpp | 4 +- .../include/numerics/NEMO/convection/roe.hpp | 4 +- .../continuous_adjoint/adj_convection.hpp | 2 +- .../continuous_adjoint/adj_diffusion.hpp | 2 +- .../continuous_adjoint/adj_sources.hpp | 2 +- .../numerics/elasticity/CFEAElasticity.hpp | 4 +- .../elasticity/CFEALinearElasticity.hpp | 6 +- .../elasticity/CFEANonlinearElasticity.hpp | 4 +- .../numerics/elasticity/nonlinear_models.hpp | 10 +- .../numerics/flow/convection/ausm_slau.hpp | 2 +- .../numerics/flow/convection/centered.hpp | 2 +- .../include/numerics/flow/convection/cusp.hpp | 2 +- .../include/numerics/flow/convection/fds.hpp | 2 +- .../include/numerics/flow/convection/fvs.hpp | 2 +- .../include/numerics/flow/convection/hllc.hpp | 6 +- .../include/numerics/flow/convection/roe.hpp | 6 +- .../include/numerics/flow/flow_diffusion.hpp | 2 +- .../include/numerics/flow/flow_sources.hpp | 6 +- SU2_CFD/include/numerics/heat.hpp | 10 +- SU2_CFD/include/numerics/radiation.hpp | 2 +- SU2_CFD/include/numerics/template.hpp | 2 +- SU2_CFD/include/numerics/transition.hpp | 2 +- .../numerics/turbulent/turb_convection.hpp | 2 +- .../numerics/turbulent/turb_diffusion.hpp | 2 +- .../numerics/turbulent/turb_sources.hpp | 8 +- .../include/numerics_simd/CNumericsSIMD.cpp | 2 +- .../include/numerics_simd/CNumericsSIMD.hpp | 2 +- .../flow/convection/centered.hpp | 2 +- .../numerics_simd/flow/convection/common.hpp | 2 +- .../numerics_simd/flow/convection/roe.hpp | 2 +- .../numerics_simd/flow/diffusion/common.hpp | 2 +- .../flow/diffusion/viscous_fluxes.hpp | 2 +- .../include/numerics_simd/flow/variables.hpp | 2 +- SU2_CFD/include/numerics_simd/util.hpp | 2 +- .../include/output/CAdjElasticityOutput.hpp | 2 +- SU2_CFD/include/output/CAdjFlowIncOutput.hpp | 2 +- SU2_CFD/include/output/CAdjFlowOutput.hpp | 2 +- SU2_CFD/include/output/CAdjHeatOutput.hpp | 2 +- SU2_CFD/include/output/CBaselineOutput.hpp | 2 +- SU2_CFD/include/output/CElasticityOutput.hpp | 2 +- SU2_CFD/include/output/CFlowCompFEMOutput.hpp | 2 +- SU2_CFD/include/output/CFlowCompOutput.hpp | 2 +- SU2_CFD/include/output/CFlowIncOutput.hpp | 2 +- SU2_CFD/include/output/CFlowOutput.hpp | 2 +- SU2_CFD/include/output/CHeatOutput.hpp | 2 +- SU2_CFD/include/output/CMeshOutput.hpp | 2 +- SU2_CFD/include/output/CMultizoneOutput.hpp | 2 +- SU2_CFD/include/output/CNEMOCompOutput.hpp | 2 +- SU2_CFD/include/output/COutput.hpp | 2 +- SU2_CFD/include/output/COutputFactory.hpp | 2 +- SU2_CFD/include/output/COutputLegacy.hpp | 2 +- .../output/filewriter/CCSVFileWriter.hpp | 2 +- .../output/filewriter/CFEMDataSorter.hpp | 2 +- .../output/filewriter/CFVMDataSorter.hpp | 2 +- .../include/output/filewriter/CFileWriter.hpp | 2 +- .../output/filewriter/CParallelDataSorter.hpp | 2 +- .../filewriter/CParaviewBinaryFileWriter.hpp | 2 +- .../output/filewriter/CParaviewFileWriter.hpp | 2 +- .../filewriter/CParaviewVTMFileWriter.hpp | 2 +- .../filewriter/CParaviewXMLFileWriter.hpp | 2 +- .../output/filewriter/CSTLFileWriter.hpp | 4 +- .../filewriter/CSU2BinaryFileWriter.hpp | 2 +- .../output/filewriter/CSU2FileWriter.hpp | 2 +- .../output/filewriter/CSU2MeshFileWriter.hpp | 2 +- .../filewriter/CSurfaceFEMDataSorter.hpp | 2 +- .../filewriter/CSurfaceFVMDataSorter.hpp | 2 +- .../filewriter/CTecplotBinaryFileWriter.hpp | 2 +- .../output/filewriter/CTecplotFileWriter.hpp | 2 +- .../include/output/tools/CWindowingTools.hpp | 2 +- SU2_CFD/include/sgs_model.hpp | 10 +- SU2_CFD/include/sgs_model.inl | 2 +- SU2_CFD/include/solvers/CAdjEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CAdjNSSolver.hpp | 2 +- SU2_CFD/include/solvers/CAdjTurbSolver.hpp | 2 +- SU2_CFD/include/solvers/CBaselineSolver.hpp | 2 +- .../include/solvers/CBaselineSolver_FEM.hpp | 4 +- SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp | 2 +- .../include/solvers/CDiscAdjMeshSolver.hpp | 2 +- SU2_CFD/include/solvers/CDiscAdjSolver.hpp | 2 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CFEASolver.hpp | 2 +- .../include/solvers/CFEM_DG_EulerSolver.hpp | 4 +- SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp | 4 +- .../include/solvers/CFVMFlowSolverBase.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.inl | 2 +- SU2_CFD/include/solvers/CHeatSolver.hpp | 4 +- SU2_CFD/include/solvers/CIncEulerSolver.hpp | 2 +- SU2_CFD/include/solvers/CIncNSSolver.hpp | 2 +- SU2_CFD/include/solvers/CMeshSolver.hpp | 2 +- SU2_CFD/include/solvers/CNEMOEulerSolver.hpp | 4 +- SU2_CFD/include/solvers/CNEMONSSolver.hpp | 2 +- SU2_CFD/include/solvers/CNSSolver.hpp | 2 +- SU2_CFD/include/solvers/CRadP1Solver.hpp | 2 +- SU2_CFD/include/solvers/CRadSolver.hpp | 2 +- SU2_CFD/include/solvers/CSolver.hpp | 2 +- SU2_CFD/include/solvers/CTemplateSolver.hpp | 2 +- SU2_CFD/include/solvers/CTransLMSolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSASolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 2 +- SU2_CFD/include/solvers/CTurbSolver.hpp | 2 +- SU2_CFD/include/task_definition.hpp | 4 +- SU2_CFD/include/task_definition.inl | 2 +- .../include/variables/CAdjEulerVariable.hpp | 2 +- SU2_CFD/include/variables/CAdjNSVariable.hpp | 2 +- .../include/variables/CAdjTurbVariable.hpp | 2 +- .../include/variables/CBaselineVariable.hpp | 2 +- .../variables/CDiscAdjFEABoundVariable.hpp | 4 +- .../include/variables/CDiscAdjFEAVariable.hpp | 4 +- .../variables/CDiscAdjMeshBoundVariable.hpp | 2 +- .../include/variables/CDiscAdjVariable.hpp | 2 +- SU2_CFD/include/variables/CEulerVariable.hpp | 2 +- .../include/variables/CFEABoundVariable.hpp | 4 +- SU2_CFD/include/variables/CFEAVariable.hpp | 4 +- SU2_CFD/include/variables/CHeatVariable.hpp | 4 +- .../include/variables/CIncEulerVariable.hpp | 2 +- SU2_CFD/include/variables/CIncNSVariable.hpp | 2 +- .../include/variables/CMeshBoundVariable.hpp | 2 +- SU2_CFD/include/variables/CMeshElement.hpp | 2 +- SU2_CFD/include/variables/CMeshVariable.hpp | 2 +- .../include/variables/CNEMOEulerVariable.hpp | 1176 ++++++++--------- SU2_CFD/include/variables/CNEMONSVariable.hpp | 334 ++--- SU2_CFD/include/variables/CNSVariable.hpp | 2 +- SU2_CFD/include/variables/CRadP1Variable.hpp | 2 +- SU2_CFD/include/variables/CRadVariable.hpp | 2 +- .../include/variables/CTransLMVariable.hpp | 2 +- SU2_CFD/include/variables/CTurbSAVariable.hpp | 2 +- .../include/variables/CTurbSSTVariable.hpp | 2 +- SU2_CFD/include/variables/CTurbVariable.hpp | 2 +- SU2_CFD/include/variables/CVariable.hpp | 2 +- SU2_CFD/obj/Makefile.am | 2 +- SU2_CFD/src/CMarkerProfileReaderFVM.cpp | 2 +- SU2_CFD/src/SU2_CFD.cpp | 4 +- SU2_CFD/src/definition_structure.cpp | 2 +- .../src/drivers/CDiscAdjMultizoneDriver.cpp | 2 +- .../src/drivers/CDiscAdjSinglezoneDriver.cpp | 2 +- SU2_CFD/src/drivers/CDriver.cpp | 2 +- SU2_CFD/src/drivers/CDummyDriver.cpp | 2 +- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- SU2_CFD/src/drivers/CSinglezoneDriver.cpp | 2 +- SU2_CFD/src/fluid/CFluidModel.cpp | 2 +- SU2_CFD/src/fluid/CIdealGas.cpp | 2 +- SU2_CFD/src/fluid/CMutationTCLib.cpp | 2 +- SU2_CFD/src/fluid/CNEMOGas.cpp | 2 +- SU2_CFD/src/fluid/CPengRobinson.cpp | 2 +- SU2_CFD/src/fluid/CSU2TCLib.cpp | 2 +- SU2_CFD/src/fluid/CVanDerWaalsGas.cpp | 2 +- .../src/integration/CFEM_DG_Integration.cpp | 2 +- SU2_CFD/src/integration/CIntegration.cpp | 2 +- .../src/integration/CIntegrationFactory.cpp | 2 +- .../src/integration/CMultiGridIntegration.cpp | 2 +- .../src/integration/CNewtonIntegration.cpp | 2 +- .../integration/CSingleGridIntegration.cpp | 2 +- .../integration/CStructuralIntegration.cpp | 2 +- SU2_CFD/src/interfaces/CInterface.cpp | 2 +- .../cfd/CConservativeVarsInterface.cpp | 2 +- .../interfaces/cfd/CMixingPlaneInterface.cpp | 2 +- .../src/interfaces/cfd/CSlidingInterface.cpp | 2 +- .../cht/CConjugateHeatInterface.cpp | 2 +- .../fsi/CDiscAdjFlowTractionInterface.cpp | 2 +- .../fsi/CDisplacementsInterface.cpp | 2 +- .../interfaces/fsi/CFlowTractionInterface.cpp | 2 +- SU2_CFD/src/iteration/CAdjFluidIteration.cpp | 2 +- .../src/iteration/CDiscAdjFEAIteration.cpp | 2 +- .../src/iteration/CDiscAdjFluidIteration.cpp | 2 +- .../src/iteration/CDiscAdjHeatIteration.cpp | 2 +- SU2_CFD/src/iteration/CFEAIteration.cpp | 2 +- SU2_CFD/src/iteration/CFEMFluidIteration.cpp | 2 +- SU2_CFD/src/iteration/CFluidIteration.cpp | 2 +- SU2_CFD/src/iteration/CHeatIteration.cpp | 2 +- SU2_CFD/src/iteration/CIteration.cpp | 2 +- SU2_CFD/src/iteration/CIterationFactory.cpp | 2 +- SU2_CFD/src/iteration/CTurboIteration.cpp | 2 +- SU2_CFD/src/limiters/CLimiterDetails.cpp | 2 +- SU2_CFD/src/numerics/CNumerics.cpp | 2 +- SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp | 2 +- SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp | 2 +- SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp | 2 +- SU2_CFD/src/numerics/NEMO/convection/ausm.cpp | 2 +- .../numerics/NEMO/convection/ausmplusup2.cpp | 2 +- .../numerics/NEMO/convection/ausmpwplus.cpp | 2 +- SU2_CFD/src/numerics/NEMO/convection/lax.cpp | 2 +- SU2_CFD/src/numerics/NEMO/convection/msw.cpp | 2 +- SU2_CFD/src/numerics/NEMO/convection/roe.cpp | 2 +- .../continuous_adjoint/adj_convection.cpp | 2 +- .../continuous_adjoint/adj_diffusion.cpp | 2 +- .../continuous_adjoint/adj_sources.cpp | 2 +- .../numerics/elasticity/CFEAElasticity.cpp | 2 +- .../elasticity/CFEALinearElasticity.cpp | 2 +- .../elasticity/CFEANonlinearElasticity.cpp | 2 +- .../numerics/elasticity/nonlinear_models.cpp | 2 +- .../numerics/flow/convection/ausm_slau.cpp | 2 +- .../src/numerics/flow/convection/centered.cpp | 2 +- SU2_CFD/src/numerics/flow/convection/cusp.cpp | 2 +- SU2_CFD/src/numerics/flow/convection/fds.cpp | 2 +- SU2_CFD/src/numerics/flow/convection/fvs.cpp | 2 +- SU2_CFD/src/numerics/flow/convection/hllc.cpp | 2 +- SU2_CFD/src/numerics/flow/convection/roe.cpp | 2 +- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 2 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- SU2_CFD/src/numerics/heat.cpp | 2 +- SU2_CFD/src/numerics/radiation.cpp | 2 +- SU2_CFD/src/numerics/template.cpp | 2 +- SU2_CFD/src/numerics/transition.cpp | 2 +- .../numerics/turbulent/turb_convection.cpp | 2 +- .../src/numerics/turbulent/turb_diffusion.cpp | 2 +- .../src/numerics/turbulent/turb_sources.cpp | 2 +- SU2_CFD/src/output/CAdjElasticityOutput.cpp | 2 +- SU2_CFD/src/output/CAdjFlowCompOutput.cpp | 2 +- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 2 +- SU2_CFD/src/output/CAdjHeatOutput.cpp | 2 +- SU2_CFD/src/output/CBaselineOutput.cpp | 2 +- SU2_CFD/src/output/CElasticityOutput.cpp | 2 +- SU2_CFD/src/output/CFlowCompFEMOutput.cpp | 2 +- SU2_CFD/src/output/CFlowCompOutput.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 2 +- SU2_CFD/src/output/CFlowOutput.cpp | 4 +- SU2_CFD/src/output/CHeatOutput.cpp | 2 +- SU2_CFD/src/output/CMeshOutput.cpp | 2 +- SU2_CFD/src/output/CMultizoneOutput.cpp | 2 +- SU2_CFD/src/output/COutput.cpp | 2 +- SU2_CFD/src/output/COutputFactory.cpp | 2 +- .../src/output/filewriter/CCSVFileWriter.cpp | 2 +- .../src/output/filewriter/CFEMDataSorter.cpp | 2 +- .../src/output/filewriter/CFVMDataSorter.cpp | 2 +- .../output/filewriter/CParallelDataSorter.cpp | 2 +- .../output/filewriter/CParallelFileWriter.cpp | 2 +- .../filewriter/CParaviewBinaryFileWriter.cpp | 2 +- .../output/filewriter/CParaviewFileWriter.cpp | 2 +- .../filewriter/CParaviewVTMFileWriter.cpp | 2 +- .../filewriter/CParaviewXMLFileWriter.cpp | 2 +- .../src/output/filewriter/CSTLFileWriter.cpp | 2 +- .../filewriter/CSU2BinaryFileWriter.cpp | 2 +- .../src/output/filewriter/CSU2FileWriter.cpp | 2 +- .../output/filewriter/CSU2MeshFileWriter.cpp | 2 +- .../filewriter/CSurfaceFEMDataSorter.cpp | 2 +- .../filewriter/CSurfaceFVMDataSorter.cpp | 2 +- .../filewriter/CTecplotBinaryFileWriter.cpp | 2 +- .../output/filewriter/CTecplotFileWriter.cpp | 2 +- SU2_CFD/src/output/output_physics.cpp | 2 +- .../src/output/output_structure_legacy.cpp | 2 +- SU2_CFD/src/output/tools/CWindowingTools.cpp | 2 +- SU2_CFD/src/python_wrapper_structure.cpp | 2 +- SU2_CFD/src/solvers/CAdjEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CAdjTurbSolver.cpp | 2 +- SU2_CFD/src/solvers/CBaselineSolver.cpp | 2 +- SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp | 2 +- SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp | 2 +- SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp | 2 +- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CFEASolver.cpp | 2 +- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp | 2 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CMeshSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 2 +- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CRadP1Solver.cpp | 2 +- SU2_CFD/src/solvers/CRadSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolverFactory.cpp | 2 +- SU2_CFD/src/solvers/CTemplateSolver.cpp | 2 +- SU2_CFD/src/solvers/CTransLMSolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSASolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSolver.cpp | 2 +- SU2_CFD/src/variables/CAdjEulerVariable.cpp | 2 +- SU2_CFD/src/variables/CAdjNSVariable.cpp | 2 +- SU2_CFD/src/variables/CAdjTurbVariable.cpp | 2 +- SU2_CFD/src/variables/CBaselineVariable.cpp | 2 +- .../variables/CDiscAdjFEABoundVariable.cpp | 2 +- SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp | 2 +- .../variables/CDiscAdjMeshBoundVariable.cpp | 2 +- SU2_CFD/src/variables/CDiscAdjVariable.cpp | 2 +- SU2_CFD/src/variables/CEulerVariable.cpp | 2 +- SU2_CFD/src/variables/CFEABoundVariable.cpp | 2 +- SU2_CFD/src/variables/CFEAVariable.cpp | 2 +- SU2_CFD/src/variables/CHeatVariable.cpp | 2 +- SU2_CFD/src/variables/CIncEulerVariable.cpp | 2 +- SU2_CFD/src/variables/CIncNSVariable.cpp | 2 +- SU2_CFD/src/variables/CMeshBoundVariable.cpp | 2 +- SU2_CFD/src/variables/CMeshElement.cpp | 2 +- SU2_CFD/src/variables/CMeshVariable.cpp | 2 +- SU2_CFD/src/variables/CNEMOEulerVariable.cpp | 702 +++++----- SU2_CFD/src/variables/CNEMONSVariable.cpp | 284 ++-- SU2_CFD/src/variables/CNSVariable.cpp | 2 +- SU2_CFD/src/variables/CRadP1Variable.cpp | 2 +- SU2_CFD/src/variables/CRadVariable.cpp | 2 +- SU2_CFD/src/variables/CTransLMVariable.cpp | 2 +- SU2_CFD/src/variables/CTurbSAVariable.cpp | 2 +- SU2_CFD/src/variables/CTurbSSTVariable.cpp | 2 +- SU2_CFD/src/variables/CTurbVariable.cpp | 2 +- SU2_CFD/src/variables/CVariable.cpp | 2 +- SU2_DEF/include/SU2_DEF.hpp | 2 +- SU2_DEF/obj/Makefile.am | 2 +- SU2_DEF/src/SU2_DEF.cpp | 2 +- SU2_DOT/include/SU2_DOT.hpp | 2 +- SU2_DOT/obj/Makefile.am | 2 +- SU2_DOT/src/SU2_DOT.cpp | 2 +- SU2_GEO/include/SU2_GEO.hpp | 2 +- SU2_GEO/obj/Makefile.am | 2 +- SU2_GEO/src/SU2_GEO.cpp | 2 +- SU2_PY/FSI_tools/FSIInterface.py | 2 +- SU2_PY/FSI_tools/FSI_config.py | 2 +- SU2_PY/Makefile.am | 2 +- SU2_PY/OptimalPropeller.py | 2 +- SU2_PY/SU2/eval/design.py | 2 +- SU2_PY/SU2/eval/functions.py | 2 +- SU2_PY/SU2/eval/gradients.py | 2 +- SU2_PY/SU2/io/config.py | 2 +- SU2_PY/SU2/io/config_options.py | 2 +- SU2_PY/SU2/io/data.py | 2 +- SU2_PY/SU2/io/filelock.py | 2 +- SU2_PY/SU2/io/redirect.py | 2 +- SU2_PY/SU2/io/state.py | 2 +- SU2_PY/SU2/io/tools.py | 2 +- SU2_PY/SU2/opt/project.py | 2 +- SU2_PY/SU2/opt/scipy_tools.py | 2 +- SU2_PY/SU2/run/adjoint.py | 2 +- SU2_PY/SU2/run/deform.py | 2 +- SU2_PY/SU2/run/direct.py | 2 +- SU2_PY/SU2/run/geometry.py | 2 +- SU2_PY/SU2/run/interface.py | 2 +- SU2_PY/SU2/run/merge.py | 2 +- SU2_PY/SU2/run/projection.py | 2 +- SU2_PY/SU2/util/filter_adjoint.py | 2 +- SU2_PY/SU2/util/plot.py | 2 +- SU2_PY/SU2/util/polarSweepLib.py | 2 +- SU2_PY/SU2/util/which.py | 2 +- SU2_PY/SU2_CFD.py | 2 +- SU2_PY/SU2_Nastran/pysu2_nastran.py | 2 +- SU2_PY/change_version_number.py | 6 +- SU2_PY/compute_multipoint.py | 2 +- SU2_PY/compute_polar.py | 2 +- SU2_PY/compute_stability.py | 2 +- SU2_PY/compute_uncertainty.py | 2 +- SU2_PY/config_gui.py | 2 +- SU2_PY/continuous_adjoint.py | 2 +- SU2_PY/direct_differentiation.py | 2 +- SU2_PY/discrete_adjoint.py | 2 +- SU2_PY/finite_differences.py | 2 +- SU2_PY/fsi_computation.py | 2 +- SU2_PY/merge_solution.py | 2 +- SU2_PY/mesh_deformation.py | 2 +- SU2_PY/package_tests.py | 2 +- SU2_PY/parallel_computation.py | 2 +- SU2_PY/parallel_computation_fsi.py | 2 +- SU2_PY/parse_config.py | 2 +- SU2_PY/profiling.py | 2 +- SU2_PY/pySU2/Makefile.am | 2 +- SU2_PY/pySU2/pySU2.i | 2 +- SU2_PY/set_ffd_design_var.py | 2 +- SU2_PY/shape_optimization.py | 4 +- SU2_PY/topology_optimization.py | 2 +- SU2_SOL/include/SU2_SOL.hpp | 2 +- SU2_SOL/obj/Makefile.am | 2 +- SU2_SOL/src/SU2_SOL.cpp | 2 +- TestCases/TestCase.py | 2 +- .../aeroelastic/aeroelastic_NACA64A010.cfg | 2 +- .../cont_adj_euler/naca0012/inv_NACA0012.cfg | 2 +- .../naca0012/inv_NACA0012_FD.cfg | 2 +- .../naca0012/inv_NACA0012_discadj.cfg | 2 +- .../cont_adj_euler/oneram6/inv_ONERAM6.cfg | 2 +- .../cont_adj_euler/wedge/inv_wedge_ROE.cfg | 2 +- .../wedge/inv_wedge_ROE_multiobj.cfg | 2 +- .../cylinder/lam_cylinder.cfg | 2 +- .../naca0012_sub/lam_NACA0012.cfg | 2 +- .../naca0012_trans/lam_NACA0012.cfg | 2 +- .../cont_adj_rans/naca0012/turb_nasa.cfg | 2 +- .../naca0012/turb_nasa_binary.cfg | 2 +- .../cont_adj_rans/oneram6/turb_ONERAM6.cfg | 2 +- .../cont_adj_rans/rae2822/turb_SA_RAE2822.cfg | 2 +- .../control_surface/inv_ONERAM6_moving.cfg | 2 +- .../control_surface/inv_ONERAM6_setting.cfg | 2 +- TestCases/ddes/flatplate/ddes_flatplate.cfg | 2 +- .../cylindrical_ffd/def_cylindrical.cfg | 2 +- .../deformation/naca0012/def_NACA0012.cfg | 2 +- .../naca0012/surface_file_NACA0012.cfg | 2 +- .../deformation/naca4412/def_NACA4412.cfg | 2 +- TestCases/deformation/rae2822/def_RAE2822.cfg | 2 +- .../spherical_ffd/def_spherical.cfg | 2 +- .../spherical_ffd/def_spherical_bspline.cfg | 2 +- .../cylinder3D/inv_cylinder3D.cfg | 2 +- .../disc_adj_euler/oneram6/inv_ONERAM6.cfg | 2 +- TestCases/disc_adj_fea/configAD_fem.cfg | 2 +- TestCases/disc_adj_fsi/configFEA.cfg | 2 +- TestCases/disc_adj_fsi/configFlow.cfg | 2 +- TestCases/disc_adj_heat/disc_adj_heat.cfg | 2 +- .../naca0012/incomp_NACA0012_disc.cfg | 2 +- .../cylinder/heated_cylinder.cfg | 2 +- .../naca0012/turb_naca0012_sa.cfg | 2 +- .../naca0012/turb_naca0012_sst.cfg | 2 +- TestCases/disc_adj_rans/naca0012/naca0012.cfg | 2 +- TestCases/euler/CRM/inv_CRM_JST.cfg | 2 +- TestCases/euler/biparabolic/BIPARABOLIC.cfg | 2 +- TestCases/euler/channel/inv_channel.cfg | 2 +- TestCases/euler/channel/inv_channel_RK.cfg | 2 +- TestCases/euler/naca0012/inv_NACA0012.cfg | 2 +- TestCases/euler/naca0012/inv_NACA0012_Roe.cfg | 2 +- TestCases/euler/oneram6/inv_ONERAM6.cfg | 2 +- TestCases/euler/wedge/inv_wedge_HLLC.cfg | 2 +- TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg | 2 +- TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg | 2 +- .../fea_fsi/DynBeam_2d/configBeam_2d.cfg | 2 +- TestCases/fea_fsi/MixElemsKnowles/config.cfg | 2 +- .../fea_fsi/StatBeam_3d/configBeam_3d.cfg | 2 +- TestCases/fea_topology/config.cfg | 2 +- TestCases/gust/inv_gust_NACA0012.cfg | 2 +- TestCases/harmonic_balance/HB.cfg | 2 +- .../hb_rans_preconditioning/davis.cfg | 2 +- .../fem_NACA0012.cfg | 2 +- .../NACA0012_5thOrder/fem_NACA0012.cfg | 2 +- .../NACA0012_5thOrder/fem_NACA0012_reg.cfg | 2 +- .../Sphere_4thOrder_Hexa/fem_Sphere.cfg | 2 +- .../Sphere_4thOrder_Tet/fem_Sphere.cfg | 2 +- .../nPoly1/fem_SubsonicChannel.cfg | 2 +- .../nPoly1/fem_SubsonicChannel_Farfield.cfg | 2 +- .../nPoly2/fem_SubsonicChannel.cfg | 2 +- .../nPoly2/fem_SubsonicChannel_Farfield.cfg | 2 +- .../nPoly4/fem_SubsonicChannel.cfg | 2 +- .../nPoly4/fem_SubsonicChannel_Farfield.cfg | 2 +- .../nPoly3/fem_Cylinder_reg.cfg | 2 +- .../FlatPlate/nPoly4/lam_flatplate_reg.cfg | 2 +- .../nPoly3_QuadDominant/fem_Sphere_reg.cfg | 2 +- .../fem_Sphere_reg_ADER.cfg | 2 +- .../nPoly4/fem_unst_cylinder.cfg | 2 +- .../nPoly4/fem_unst_cylinder_ADER.cfg | 2 +- TestCases/hybrid_regression.py | 2 +- .../incomp_euler/naca0012/incomp_NACA0012.cfg | 2 +- TestCases/incomp_euler/nozzle/inv_nozzle.cfg | 2 +- .../buoyancy_cavity/lam_buoyancy_cavity.cfg | 2 +- .../cylinder/incomp_cylinder.cfg | 2 +- .../cylinder/poly_cylinder.cfg | 2 +- .../chtPinArray_2d/DA_configMaster.cfg | 2 +- .../chtPinArray_2d/FD_configMaster.cfg | 2 +- .../chtPinArray_2d/configMaster.cfg | 2 +- .../chtPinArray_2d/configSolid.cfg | 2 +- .../chtPinArray_3d/configFluid.cfg | 2 +- .../chtPinArray_3d/configMaster.cfg | 2 +- .../chtPinArray_3d/configSolid.cfg | 2 +- .../pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg | 2 +- TestCases/incomp_rans/naca0012/naca0012.cfg | 2 +- .../naca0012/naca0012_SST_SUST.cfg | 2 +- .../mms/fvm_incomp_euler/inv_mms_jst.cfg | 2 +- .../fvm_incomp_navierstokes/lam_mms_fds.cfg | 2 +- .../mms/fvm_navierstokes/lam_mms_roe.cfg | 2 +- TestCases/moving_wall/cavity/lam_cavity.cfg | 2 +- .../spinning_cylinder/spinning_cylinder.cfg | 2 +- .../naca0012/inv_NACA0012_ffd.cfg | 2 +- .../cylinder/cylinder_lowmach.cfg | 2 +- .../navierstokes/cylinder/lam_cylinder.cfg | 2 +- .../navierstokes/flatplate/lam_flatplate.cfg | 2 +- .../navierstokes/naca0012/lam_NACA0012.cfg | 2 +- .../poiseuille/lam_poiseuille.cfg | 2 +- TestCases/nicf/edge/edge_PPR.cfg | 2 +- TestCases/nicf/edge/edge_VW.cfg | 2 +- .../nonequilibrium/invwedge/invwedge.cfg | 2 +- .../nonequilibrium/viscwedge/viscwedge.cfg | 2 +- .../viscwedge_mpp/viscwedge_mpp.cfg | 2 +- .../inv_wedge_ROE_2surf_1obj.cfg | 2 +- .../inv_wedge_ROE_multiobj.cfg | 2 +- .../inv_wedge_ROE_multiobj_1surf.cfg | 2 +- .../inv_wedge_ROE_multiobj_combo.cfg | 2 +- .../inv_NACA0012_multipoint.cfg | 2 +- .../pitching_NACA64A010.cfg | 2 +- .../pitching_oneram6/pitching_ONERAM6.cfg | 2 +- .../rotating_naca0012/rotating_NACA0012.cfg | 2 +- .../steady_naca0012/inv_NACA0012_adv.cfg | 2 +- .../steady_naca0012/inv_NACA0012_basic.cfg | 2 +- .../steady_oneram6/inv_ONERAM6_adv.cfg | 2 +- .../steady_oneram6/inv_ONERAM6_basic.cfg | 2 +- .../optimization_rans/naca0012/naca0012.cfg | 2 +- .../pitching_naca64a010/turb_NACA64A010.cfg | 2 +- .../pitching_oneram6/turb_ONERAM6.cfg | 2 +- .../steady_oneram6/turb_ONERAM6.cfg | 2 +- .../steady_rae2822/turb_SA_RAE2822.cfg | 2 +- TestCases/parallel_regression.py | 2 +- TestCases/parallel_regression_AD.py | 2 +- TestCases/pastix_support/config.cfg | 2 +- TestCases/pastix_support/readme.txt | 2 +- TestCases/polar/naca0012/inv_NACA0012.cfg | 2 +- .../flow_load_sens/run_adjoint.py | 2 +- .../mesh_disp_sens/run_adjoint.py | 2 +- .../flatPlate_rigidMotion_Conf.cfg | 2 +- .../launch_flatPlate_rigidMotion.py | 2 +- .../launch_unsteady_CHT_FlatPlate.py | 2 +- .../unsteady_CHT_FlatPlate_Conf.cfg | 2 +- .../radiation/p1adjoint/configp1adjoint.cfg | 2 +- TestCases/radiation/p1model/configp1.cfg | 2 +- .../propeller_variable_load.cfg | 474 +++---- .../rans/flatplate/turb_SA_flatplate.cfg | 2 +- .../rans/flatplate/turb_SST_flatplate.cfg | 2 +- .../turb_NACA0012_sst_multigrid_restart.cfg | 2 +- TestCases/rans/oneram6/turb_ONERAM6.cfg | 2 +- TestCases/rans/oneram6/turb_ONERAM6_nk.cfg | 2 +- TestCases/rans/propeller/propeller.cfg | 2 +- TestCases/rans/rae2822/turb_SA_RAE2822.cfg | 2 +- TestCases/rans/rae2822/turb_SST_RAE2822.cfg | 2 +- .../rans/rae2822/turb_SST_SUST_RAE2822.cfg | 2 +- .../rans/restart_directdiff_naca/naca0012.cfg | 2 +- TestCases/rans/s809/trans_s809.cfg | 2 +- TestCases/rans/s809/turb_S809.cfg | 2 +- TestCases/rans/vki_turbine/turb_vki.cfg | 2 +- .../caradonna_tung/rot_caradonna_tung.cfg | 2 +- TestCases/rotating/naca0012/rot_NACA0012.cfg | 2 +- TestCases/serial_regression.py | 2 +- TestCases/serial_regression_AD.py | 2 +- .../sliding_interface/bars_SST_2D/bars.cfg | 2 +- .../sliding_interface/bars_SST_2D/zone_1.cfg | 2 +- .../sliding_interface/bars_SST_2D/zone_2.cfg | 2 +- .../sliding_interface/bars_SST_2D/zone_3.cfg | 2 +- .../sliding_interface/channel_2D/zone_2.cfg | 2 +- .../sliding_interface/channel_2D/zone_3.cfg | 2 +- .../transitional_BC_model_ConfigFile.cfg | 2 +- .../transitional_BC_model_ConfigFile.cfg | 2 +- .../transitional_BC_model_ConfigFile.cfg | 2 +- TestCases/tutorials.py | 2 +- .../pitching_NACA64A010.cfg | 2 +- .../turb_NACA64A010.cfg | 2 +- .../plunging_naca0012/plunging_NACA0012.cfg | 2 +- .../unsteady/square_cylinder/turb_square.cfg | 2 +- UnitTests/Common/geometry/CGeometry_test.cpp | 2 +- .../geometry/dual_grid/CDualGrid_tests.cpp | 2 +- .../primal_grid/CPrimalGrid_tests.cpp | 2 +- UnitTests/Common/simple_ad_test.cpp | 2 +- UnitTests/Common/simple_directdiff_test.cpp | 2 +- .../CQuasiNewtonInvLeastSquares_tests.cpp | 2 +- UnitTests/Common/vectorization.cpp | 2 +- UnitTests/SU2_CFD/gradients.cpp | 2 +- .../SU2_CFD/numerics/CNumerics_tests.cpp | 2 +- UnitTests/UnitQuadTestCase.hpp | 2 +- config_template.cfg | 2 +- configure.ac | 2 +- externals/Makefile.am | 2 +- meson.build | 4 +- meson.py | 2 +- meson_scripts/init.py | 2 +- preconfigure.py | 2 +- 804 files changed, 2369 insertions(+), 2369 deletions(-) diff --git a/Common/doc/docmain.hpp b/Common/doc/docmain.hpp index 4a915ae58e0b..885bafeba5b8 100644 --- a/Common/doc/docmain.hpp +++ b/Common/doc/docmain.hpp @@ -2,7 +2,7 @@ * \file docmain.hpp * \brief This file contains documentation for Doxygen and does not have any significance with respect to C++. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * The current SU2 release has been coordinated by the * SU2 International Developers Society @@ -33,7 +33,7 @@ */ /*! - * \mainpage SU2 version 7.1.0 "Blackbird" + * \mainpage SU2 version 7.1.1 "Blackbird" * SU2 suite is an open-source collection of C++ based software tools * to perform PDE analysis and PDE constrained optimization problems. The toolset is designed with * computational fluid dynamics and aerodynamic shape optimization in mind, but is extensible to diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index b5a5556bf41f..d46efb245478 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -3,7 +3,7 @@ * \brief All the information about the definition of the physical problem. * The subroutines and functions are in the CConfig.cpp file. * \author F. Palacios, T. Economon, B. Tracey - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/adt/CADTBaseClass.hpp b/Common/include/adt/CADTBaseClass.hpp index d2f88d38c9e4..9cf778354921 100644 --- a/Common/include/adt/CADTBaseClass.hpp +++ b/Common/include/adt/CADTBaseClass.hpp @@ -2,7 +2,7 @@ * \file CADTBaseClass.hpp * \brief Base class for storing an ADT in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/adt/CADTComparePointClass.hpp b/Common/include/adt/CADTComparePointClass.hpp index a8b8572eef35..2b7663e2086e 100644 --- a/Common/include/adt/CADTComparePointClass.hpp +++ b/Common/include/adt/CADTComparePointClass.hpp @@ -2,7 +2,7 @@ * \file CADTComparePointClass.hpp * \brief subroutines for comparing two points in an alternating digital tree (ADT). * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/adt/CADTElemClass.hpp b/Common/include/adt/CADTElemClass.hpp index 1cdfce581fed..07a61555c9ca 100644 --- a/Common/include/adt/CADTElemClass.hpp +++ b/Common/include/adt/CADTElemClass.hpp @@ -2,7 +2,7 @@ * \file CADTElemClass.hpp * \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \class CADTElemClass * \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CADTElemClass : public CADTBaseClass { private: diff --git a/Common/include/adt/CADTNodeClass.hpp b/Common/include/adt/CADTNodeClass.hpp index 1bb848ae2471..f572cb36fc95 100644 --- a/Common/include/adt/CADTNodeClass.hpp +++ b/Common/include/adt/CADTNodeClass.hpp @@ -2,7 +2,7 @@ * \file CADTNodeClass.hpp * \brief Class for storing the information needed in a node of an ADT. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/adt/CADTPointsOnlyClass.hpp b/Common/include/adt/CADTPointsOnlyClass.hpp index f3131588a943..5370054f5124 100644 --- a/Common/include/adt/CADTPointsOnlyClass.hpp +++ b/Common/include/adt/CADTPointsOnlyClass.hpp @@ -2,7 +2,7 @@ * \file CADTPointsOnlyClass.hpp * \brief Class for storing an ADT of only points in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/adt/CBBoxTargetClass.hpp b/Common/include/adt/CBBoxTargetClass.hpp index 0bd62b861d76..4c6be23da997 100644 --- a/Common/include/adt/CBBoxTargetClass.hpp +++ b/Common/include/adt/CBBoxTargetClass.hpp @@ -3,7 +3,7 @@ * \brief Class for storing the information of a possible bounding box candidate during a minimum distance search. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for storing the information of a possible bounding box candidate during a minimum distance search. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CBBoxTargetClass { diff --git a/Common/include/basic_types/ad_structure.hpp b/Common/include/basic_types/ad_structure.hpp index 6353ec3046c2..6875896bad45 100644 --- a/Common/include/basic_types/ad_structure.hpp +++ b/Common/include/basic_types/ad_structure.hpp @@ -2,7 +2,7 @@ * \file ad_structure.hpp * \brief Main routines for the algorithmic differentiation (AD) structure. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/basic_types/datatype_structure.hpp b/Common/include/basic_types/datatype_structure.hpp index 58bc9920c3bd..f806c5f6cc46 100644 --- a/Common/include/basic_types/datatype_structure.hpp +++ b/Common/include/basic_types/datatype_structure.hpp @@ -2,7 +2,7 @@ * \file datatype_structure.hpp * \brief Headers for generalized datatypes, defines an interface for AD types. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/containers/C2DContainer.hpp b/Common/include/containers/C2DContainer.hpp index bd7efbf75cc2..4ef2bf1b4ae5 100644 --- a/Common/include/containers/C2DContainer.hpp +++ b/Common/include/containers/C2DContainer.hpp @@ -2,7 +2,7 @@ * \file C2DContainer.hpp * \brief A templated vector/matrix object. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/containers/CFastFindAndEraseQueue.hpp b/Common/include/containers/CFastFindAndEraseQueue.hpp index 90965f39ecbc..d6ffc0db6ef2 100644 --- a/Common/include/containers/CFastFindAndEraseQueue.hpp +++ b/Common/include/containers/CFastFindAndEraseQueue.hpp @@ -3,7 +3,7 @@ * \brief A queue-type container (push back, pop front), but with * fast deletion of arbitrary items (possibly in the middle). * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/containers/CVertexMap.hpp b/Common/include/containers/CVertexMap.hpp index 80afd30d7246..166a3ae2251f 100644 --- a/Common/include/containers/CVertexMap.hpp +++ b/Common/include/containers/CVertexMap.hpp @@ -2,7 +2,7 @@ * \file CVertexMap.hpp * \brief An index to index lookup vector. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/containers/container_decorators.hpp b/Common/include/containers/container_decorators.hpp index 14910d941683..a129ff51e8ae 100644 --- a/Common/include/containers/container_decorators.hpp +++ b/Common/include/containers/container_decorators.hpp @@ -3,7 +3,7 @@ * \brief Collection of small classes that decorate C2DContainer to * augment its functionality, e.g. give it extra dimensions. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/fem/fem_cgns_elements.hpp b/Common/include/fem/fem_cgns_elements.hpp index 511580eb0430..9bd1bde737a9 100644 --- a/Common/include/fem/fem_cgns_elements.hpp +++ b/Common/include/fem/fem_cgns_elements.hpp @@ -4,7 +4,7 @@ * with high order elements. * The functions are in the cgns_elements.cpp file. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -47,7 +47,7 @@ class CBoundaryFace; * \class CCGNSElementType * \brief Class which stores the CGNS element type info for a connectivity section. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CCGNSElementType { diff --git a/Common/include/fem/fem_gauss_jacobi_quadrature.hpp b/Common/include/fem/fem_gauss_jacobi_quadrature.hpp index 2b3413a11050..c8dfeb55f857 100644 --- a/Common/include/fem/fem_gauss_jacobi_quadrature.hpp +++ b/Common/include/fem/fem_gauss_jacobi_quadrature.hpp @@ -6,7 +6,7 @@ All the functions in this class are based on the program JACOBI_RULE of John Burkardt. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -95,7 +95,7 @@ using namespace std; * \brief Class used to determine the quadrature points of the Gauss Jacobi integration rules. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CGaussJacobiQuadrature { public: diff --git a/Common/include/fem/fem_geometry_structure.hpp b/Common/include/fem/fem_geometry_structure.hpp index a719e8134195..a2c9b13a65a2 100644 --- a/Common/include/fem/fem_geometry_structure.hpp +++ b/Common/include/fem/fem_geometry_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for creating the geometrical structure for the FEM solver. * The subroutines and functions are in the fem_geometry_structure.cpp file. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -41,7 +41,7 @@ using namespace std; /*! * \class CLong3T * \brief Help class used to store three longs as one entity. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CLong3T { long long0 = 0; /*!< \brief First long to store in this class. */ @@ -59,7 +59,7 @@ struct CLong3T { * \class CReorderElements * \brief Class, used to reorder the owned elements after the partitioning. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CReorderElements { private: @@ -131,7 +131,7 @@ class CReorderElements { * \brief Functor, used for a different sorting of the faces than the < operator * of CFaceOfElement. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CVolumeElementFEM; // Forward declaration to avoid problems. class CSortFaces { @@ -172,7 +172,7 @@ class CSortFaces { * \brief Functor, used for a different sorting of the faces than the < operator * of CSurfaceElementFEM. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CSurfaceElementFEM; // Forward declaration to avoid problems. struct CSortBoundaryFaces { @@ -189,7 +189,7 @@ struct CSortBoundaryFaces { * \class CVolumeElementFEM * \brief Class to store a volume element for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CVolumeElementFEM { public: @@ -283,7 +283,7 @@ class CVolumeElementFEM { * \class CPointFEM * \brief Class to a point for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CPointFEM { unsigned long globalID; /*!< \brief The global ID of this point in the grid. */ @@ -308,7 +308,7 @@ struct CPointFEM { * \class CInternalFaceElementFEM * \brief Class to store an internal face for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CInternalFaceElementFEM { unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ @@ -353,7 +353,7 @@ struct CInternalFaceElementFEM { * \class CSurfaceElementFEM * \brief Class to store a surface element for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CSurfaceElementFEM { unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ @@ -415,7 +415,7 @@ struct CSurfaceElementFEM { * \class CBoundaryFEM * \brief Class to store a boundary for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ struct CBoundaryFEM { string markerTag; /*!< \brief Marker tag of this boundary. */ @@ -438,7 +438,7 @@ struct CBoundaryFEM { * \class CMeshFEM * \brief Base class for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CMeshFEM: public CGeometry { protected: @@ -712,7 +712,7 @@ class CMeshFEM: public CGeometry { * \class CMeshFEM_DG * \brief Class which contains all the variables for the DG FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CMeshFEM_DG: public CMeshFEM { protected: diff --git a/Common/include/fem/fem_standard_element.hpp b/Common/include/fem/fem_standard_element.hpp index 549d2b7b8bc0..28622a6b9c6b 100644 --- a/Common/include/fem/fem_standard_element.hpp +++ b/Common/include/fem/fem_standard_element.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main functions for the FEM standard elements. * The functions are in the fem_standard_element.cpp file. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -40,7 +40,7 @@ using namespace std; * \class CFEMStandardElementBase * \brief Base class for a FEM standard element. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEMStandardElementBase { protected: @@ -781,7 +781,7 @@ class CFEMStandardElementBase { * \class CFEMStandardElement * \brief Class to define a FEM standard element. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEMStandardElement : public CFEMStandardElementBase { private: @@ -1220,7 +1220,7 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \class CFEMStandardInternalFace * \brief Class to define a FEM standard internal face. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEMStandardInternalFace : public CFEMStandardElementBase { private: @@ -1546,7 +1546,7 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { * \class CFEMStandardBoundaryFace * \brief Class to define a FEM standard boundary face. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { private: diff --git a/Common/include/fem/geometry_structure_fem_part.hpp b/Common/include/fem/geometry_structure_fem_part.hpp index c0aef4985290..72d2e76c1301 100644 --- a/Common/include/fem/geometry_structure_fem_part.hpp +++ b/Common/include/fem/geometry_structure_fem_part.hpp @@ -2,7 +2,7 @@ * \file geometry_structure_fem_part.hpp * \brief Helper classes for the Fluid FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/CDummyGeometry.hpp b/Common/include/geometry/CDummyGeometry.hpp index 4a6b29dfe0d2..a179257ead3b 100644 --- a/Common/include/geometry/CDummyGeometry.hpp +++ b/Common/include/geometry/CDummyGeometry.hpp @@ -2,7 +2,7 @@ * \file CDummyGeometry.hpp * \brief Headers of the dummy geometry class used in "dry run" mode. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index a01e376deed3..a8549d18d435 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for creating the geometrical structure. * The subroutines and functions are in the CGeometry.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/CMultiGridGeometry.hpp b/Common/include/geometry/CMultiGridGeometry.hpp index e0883b6d5ae9..516460cccc54 100644 --- a/Common/include/geometry/CMultiGridGeometry.hpp +++ b/Common/include/geometry/CMultiGridGeometry.hpp @@ -2,7 +2,7 @@ * \file CMultiGridGeometry.hpp * \brief Headers of the multigrid geometry class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/CMultiGridQueue.hpp b/Common/include/geometry/CMultiGridQueue.hpp index d521e7f853af..ca16e62a9248 100644 --- a/Common/include/geometry/CMultiGridQueue.hpp +++ b/Common/include/geometry/CMultiGridQueue.hpp @@ -3,7 +3,7 @@ * \brief Header of the multigrid queue class for the FVM solver. * The subroutines and functions are in the CMultiGridQueue.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 55cbd8713025..b231ef8579e7 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -2,7 +2,7 @@ * \file CPhysicalGeometry.hpp * \brief Headers of the physical geometry class used to read meshes from file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/dual_grid/CDualGrid.hpp b/Common/include/geometry/dual_grid/CDualGrid.hpp index 7f51ee3f57b3..052449b277f2 100644 --- a/Common/include/geometry/dual_grid/CDualGrid.hpp +++ b/Common/include/geometry/dual_grid/CDualGrid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CDualGrid.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/dual_grid/CEdge.hpp b/Common/include/geometry/dual_grid/CEdge.hpp index 9a9808db4078..f09878a7c4d7 100644 --- a/Common/include/geometry/dual_grid/CEdge.hpp +++ b/Common/include/geometry/dual_grid/CEdge.hpp @@ -2,7 +2,7 @@ * \file CEdge.hpp * \brief Declaration of the edge class CEdge.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/dual_grid/CPoint.hpp b/Common/include/geometry/dual_grid/CPoint.hpp index 2fe1a51a34a4..a7227d4fe7af 100644 --- a/Common/include/geometry/dual_grid/CPoint.hpp +++ b/Common/include/geometry/dual_grid/CPoint.hpp @@ -3,7 +3,7 @@ * \brief Declaration of the point class that stores geometric and adjacency * information for dual control volumes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/dual_grid/CTurboVertex.hpp b/Common/include/geometry/dual_grid/CTurboVertex.hpp index 166ece7e998a..436c7888aced 100644 --- a/Common/include/geometry/dual_grid/CTurboVertex.hpp +++ b/Common/include/geometry/dual_grid/CTurboVertex.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CTurboVertex.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/dual_grid/CVertex.hpp b/Common/include/geometry/dual_grid/CVertex.hpp index b27ecfc24aea..c7d2e2f0a613 100644 --- a/Common/include/geometry/dual_grid/CVertex.hpp +++ b/Common/include/geometry/dual_grid/CVertex.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CVertex.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/elements/CElement.hpp b/Common/include/geometry/elements/CElement.hpp index fd585c985e81..dec7fa99c8f0 100644 --- a/Common/include/geometry/elements/CElement.hpp +++ b/Common/include/geometry/elements/CElement.hpp @@ -3,7 +3,7 @@ * \brief Main header of the Finite Element structure declaring the abstract * interface and the available finite element types. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -749,7 +749,7 @@ class CPYRAM5 final : public CElementWithKnownSizes<5,5,3> { * \class CPRISM6 * \brief Prism element with 6 Gauss Points * \author R. Sanchez, F. Palacios, A. Bueno, T. Economon, S. Padron. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CPRISM6 final : public CElementWithKnownSizes<6,6,3> { private: diff --git a/Common/include/geometry/elements/CElementProperty.hpp b/Common/include/geometry/elements/CElementProperty.hpp index 071681f4360a..7f067e0f6af8 100644 --- a/Common/include/geometry/elements/CElementProperty.hpp +++ b/Common/include/geometry/elements/CElementProperty.hpp @@ -2,7 +2,7 @@ * \file CElementProperty.hpp * \brief Light classes to define finite element properties. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ * \class CProperty * \brief Base class for defining element properties. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CProperty { protected: @@ -106,7 +106,7 @@ class CProperty { * \class CElementProperty * \brief Class for defining element properties for the structural solver. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CElementProperty final : public CProperty { private: diff --git a/Common/include/geometry/elements/CGaussVariable.hpp b/Common/include/geometry/elements/CGaussVariable.hpp index e80782ad2e7b..b54f9716ef0e 100644 --- a/Common/include/geometry/elements/CGaussVariable.hpp +++ b/Common/include/geometry/elements/CGaussVariable.hpp @@ -2,7 +2,7 @@ * \file CGaussVariable.hpp * \brief Light-weight class to store Gaussian point information. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ /*! * \class CGaussVariable * \brief Main class for defining the gaussian points. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CGaussVariable { protected: diff --git a/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp index 3c73b9307641..462c99b9d904 100644 --- a/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CBoxMeshReaderFVM. * The implementations are in the CBoxMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp index 1c8da185d696..3e334b69b308 100644 --- a/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CCGNSMeshReaderFVM. * The implementations are in the CCGNSMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/meshreader/CMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CMeshReaderFVM.hpp index bde5bf2d6e32..75f609e449cf 100644 --- a/Common/include/geometry/meshreader/CMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CMeshReaderFVM.hpp @@ -4,7 +4,7 @@ * \brief Header file for the class CMeshReaderFVM. * The implementations are in the CMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp index 8c56b1407cac..80cd4007cd3b 100644 --- a/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CRectangularMeshReaderFVM. * The implementations are in the CRectangularMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp index cdd895ed3405..55547d97625e 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CSU2ASCIIMeshReaderFVM. * The implementations are in the CSU2ASCIIMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CHexahedron.hpp b/Common/include/geometry/primal_grid/CHexahedron.hpp index 6311fde85383..8c0f4ecbe82d 100644 --- a/Common/include/geometry/primal_grid/CHexahedron.hpp +++ b/Common/include/geometry/primal_grid/CHexahedron.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CHexahedron.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CLine.hpp b/Common/include/geometry/primal_grid/CLine.hpp index 7254535436a5..01abde6ca4b8 100644 --- a/Common/include/geometry/primal_grid/CLine.hpp +++ b/Common/include/geometry/primal_grid/CLine.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CLine.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CPrimalGrid.hpp b/Common/include/geometry/primal_grid/CPrimalGrid.hpp index f99d7ffde477..41fe4b07d387 100644 --- a/Common/include/geometry/primal_grid/CPrimalGrid.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGrid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the primal_grid_structure.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp index b784607f3f6f..e24acc3ae9a1 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrimalGridBoundFEM.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ /*! * \class CPrimalGridBoundFEM * \brief Class to define primal grid boundary element for the FEM solver. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CPrimalGridBoundFEM final: public CPrimalGrid { private: diff --git a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp index 06e0f73ad0a9..f271f55b398c 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrimalGridFEM.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ /*! * \class CPrimalGridFEM * \brief Class to define primal grid element for the FEM solver. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CPrimalGridFEM final: public CPrimalGrid { private: diff --git a/Common/include/geometry/primal_grid/CPrism.hpp b/Common/include/geometry/primal_grid/CPrism.hpp index 3968c87c8fd4..bfc59dd07193 100644 --- a/Common/include/geometry/primal_grid/CPrism.hpp +++ b/Common/include/geometry/primal_grid/CPrism.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrism.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CPyramid.hpp b/Common/include/geometry/primal_grid/CPyramid.hpp index b34a8cd7fd33..180266557f90 100644 --- a/Common/include/geometry/primal_grid/CPyramid.hpp +++ b/Common/include/geometry/primal_grid/CPyramid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPyramid.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CQuadrilateral.hpp b/Common/include/geometry/primal_grid/CQuadrilateral.hpp index 3e828977060b..23c2d301a667 100644 --- a/Common/include/geometry/primal_grid/CQuadrilateral.hpp +++ b/Common/include/geometry/primal_grid/CQuadrilateral.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CQuadrilateral.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CTetrahedron.hpp b/Common/include/geometry/primal_grid/CTetrahedron.hpp index 95a11b9394ae..508d937236f0 100644 --- a/Common/include/geometry/primal_grid/CTetrahedron.hpp +++ b/Common/include/geometry/primal_grid/CTetrahedron.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CTetrahedron.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CTriangle.hpp b/Common/include/geometry/primal_grid/CTriangle.hpp index ab333e162db2..a2a0e7b9be4b 100644 --- a/Common/include/geometry/primal_grid/CTriangle.hpp +++ b/Common/include/geometry/primal_grid/CTriangle.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CTriangle.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/geometry/primal_grid/CVertexMPI.hpp b/Common/include/geometry/primal_grid/CVertexMPI.hpp index fa1b9b779b90..e6c5c04355a4 100644 --- a/Common/include/geometry/primal_grid/CVertexMPI.hpp +++ b/Common/include/geometry/primal_grid/CVertexMPI.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the primal_grid_structure.cpp file. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/graph_coloring_structure.hpp b/Common/include/graph_coloring_structure.hpp index f6179507738a..aeea3385eb91 100644 --- a/Common/include/graph_coloring_structure.hpp +++ b/Common/include/graph_coloring_structure.hpp @@ -4,7 +4,7 @@ * coloring of a given graph. The functions are in the * graph_coloring_structure.cpp file. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -40,7 +40,7 @@ using namespace std; * \class CGraphColoringStructure * \brief Class, which provides graph coloring algorithms. * \author: E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CGraphColoringStructure { public: diff --git a/Common/include/grid_movement/CBSplineBlending.hpp b/Common/include/grid_movement/CBSplineBlending.hpp index bc829b3be099..a67b0367ba06 100644 --- a/Common/include/grid_movement/CBSplineBlending.hpp +++ b/Common/include/grid_movement/CBSplineBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CBSplineBlending class. * Defines blending using uniform BSplines * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CBezierBlending.hpp b/Common/include/grid_movement/CBezierBlending.hpp index 137e2b9247b3..b2ee0712b48b 100644 --- a/Common/include/grid_movement/CBezierBlending.hpp +++ b/Common/include/grid_movement/CBezierBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CBezierBlending class. * Defines blending using Bernsteinpolynomials (Bezier Curves) * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CFreeFormBlending.hpp b/Common/include/grid_movement/CFreeFormBlending.hpp index a54366b834b9..3e46b5485999 100644 --- a/Common/include/grid_movement/CFreeFormBlending.hpp +++ b/Common/include/grid_movement/CFreeFormBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CFreeFormBlending class. * It is the parent class for the FFD blending function * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CFreeFormDefBox.hpp b/Common/include/grid_movement/CFreeFormDefBox.hpp index aa914da34087..fabbe85dab69 100644 --- a/Common/include/grid_movement/CFreeFormDefBox.hpp +++ b/Common/include/grid_movement/CFreeFormDefBox.hpp @@ -2,7 +2,7 @@ * \file CFreeFormDefBox.hpp * \brief Headers of the CFreeFormDefBox class. * \author F. Palacios & A. Galdran. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CGridMovement.hpp b/Common/include/grid_movement/CGridMovement.hpp index b3ad2d7a1ff2..b88b151c997b 100644 --- a/Common/include/grid_movement/CGridMovement.hpp +++ b/Common/include/grid_movement/CGridMovement.hpp @@ -2,7 +2,7 @@ * \file CGridMovement.hpp * \brief Headers of the CGridMovement class * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CSurfaceMovement.hpp b/Common/include/grid_movement/CSurfaceMovement.hpp index 09cf4d6514b7..c1ecf20c78f9 100644 --- a/Common/include/grid_movement/CSurfaceMovement.hpp +++ b/Common/include/grid_movement/CSurfaceMovement.hpp @@ -2,7 +2,7 @@ * \file CSurfaceMovement.hpp * \brief Headers of the CSurfaceMovement class. * \author F. Palacios, T. Economon. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/grid_movement/CVolumetricMovement.hpp b/Common/include/grid_movement/CVolumetricMovement.hpp index 8de7f01c30fa..78137e3362fe 100644 --- a/Common/include/grid_movement/CVolumetricMovement.hpp +++ b/Common/include/grid_movement/CVolumetricMovement.hpp @@ -2,7 +2,7 @@ * \file CVolumetricMovement.hpp * \brief Headers of the CVolumetricMovement class. * \author F. Palacios, A. Bueno, T. Economon, S. Padron. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CInterpolator.hpp b/Common/include/interface_interpolation/CInterpolator.hpp index 3404f32688b4..9065a18e9519 100644 --- a/Common/include/interface_interpolation/CInterpolator.hpp +++ b/Common/include/interface_interpolation/CInterpolator.hpp @@ -2,7 +2,7 @@ * \file CInterpolator.hpp * \brief Base class for multiphysics interpolation. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CInterpolatorFactory.hpp b/Common/include/interface_interpolation/CInterpolatorFactory.hpp index c1a77bfc5021..cf7498b2aff7 100644 --- a/Common/include/interface_interpolation/CInterpolatorFactory.hpp +++ b/Common/include/interface_interpolation/CInterpolatorFactory.hpp @@ -1,7 +1,7 @@ /*! * \file CInterpolatorFactory.hpp * \brief Factory to generate interpolator objects. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CIsoparametric.hpp b/Common/include/interface_interpolation/CIsoparametric.hpp index d1205c744b72..b3517b078c9c 100644 --- a/Common/include/interface_interpolation/CIsoparametric.hpp +++ b/Common/include/interface_interpolation/CIsoparametric.hpp @@ -2,7 +2,7 @@ * \file CIsoparametric.hpp * \brief Isoparametric interpolation using FE shape functions. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CMirror.hpp b/Common/include/interface_interpolation/CMirror.hpp index 36e8c78664cb..9908a45f6ca4 100644 --- a/Common/include/interface_interpolation/CMirror.hpp +++ b/Common/include/interface_interpolation/CMirror.hpp @@ -2,7 +2,7 @@ * \file CMirror.hpp * \brief Mirror interpolation for the conservative (work-wise) approach in FSI problems. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CNearestNeighbor.hpp b/Common/include/interface_interpolation/CNearestNeighbor.hpp index c9b17e5585d5..33e74a7dc882 100644 --- a/Common/include/interface_interpolation/CNearestNeighbor.hpp +++ b/Common/include/interface_interpolation/CNearestNeighbor.hpp @@ -2,7 +2,7 @@ * \file CNearestNeighbor.hpp * \brief Nearest Neighbor interpolation class. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CRadialBasisFunction.hpp b/Common/include/interface_interpolation/CRadialBasisFunction.hpp index 6a3d96d252c7..bc50ad1c23ed 100644 --- a/Common/include/interface_interpolation/CRadialBasisFunction.hpp +++ b/Common/include/interface_interpolation/CRadialBasisFunction.hpp @@ -2,7 +2,7 @@ * \file CRadialBasisFunction.hpp * \brief Radial basis function interpolation. * \author Joel Ho, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/interface_interpolation/CSlidingMesh.hpp b/Common/include/interface_interpolation/CSlidingMesh.hpp index b9bc8ef2557d..8adcc4a79e94 100644 --- a/Common/include/interface_interpolation/CSlidingMesh.hpp +++ b/Common/include/interface_interpolation/CSlidingMesh.hpp @@ -2,7 +2,7 @@ * \file CSlidingMesh.hpp * \brief Sliding mesh interpolation. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CMatrixVectorProduct.hpp b/Common/include/linear_algebra/CMatrixVectorProduct.hpp index e3e9e9f60d74..53cf338570fd 100644 --- a/Common/include/linear_algebra/CMatrixVectorProduct.hpp +++ b/Common/include/linear_algebra/CMatrixVectorProduct.hpp @@ -3,7 +3,7 @@ * \brief Headers for the classes related to sparse matrix-vector product wrappers. * The actual operations are currently implemented mostly by CSysMatrix. * \author F. Palacios, J. Hicken, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CPastixWrapper.hpp b/Common/include/linear_algebra/CPastixWrapper.hpp index bb42f4a4f0ba..e494053c845a 100644 --- a/Common/include/linear_algebra/CPastixWrapper.hpp +++ b/Common/include/linear_algebra/CPastixWrapper.hpp @@ -3,7 +3,7 @@ * \brief An interface to the INRIA solver PaStiX * (http://pastix.gforge.inria.fr/files/README-txt.html) * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CPreconditioner.hpp b/Common/include/linear_algebra/CPreconditioner.hpp index b79dcc916ee4..d2ca29cb45b5 100644 --- a/Common/include/linear_algebra/CPreconditioner.hpp +++ b/Common/include/linear_algebra/CPreconditioner.hpp @@ -3,7 +3,7 @@ * \brief Classes related to linear preconditioner wrappers. * The actual operations are currently implemented mostly by CSysMatrix. * \author F. Palacios, J. Hicken, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index 0abbc3e663a3..cf26885d2fa2 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -3,7 +3,7 @@ * \brief Declaration of the block-sparse matrix class. * The implemtation is in CSysMatrix.cpp. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CSysMatrix.inl b/Common/include/linear_algebra/CSysMatrix.inl index 04d84b724cb3..e0738cc9daa8 100644 --- a/Common/include/linear_algebra/CSysMatrix.inl +++ b/Common/include/linear_algebra/CSysMatrix.inl @@ -5,7 +5,7 @@ * of the .cpp file and so they are hidden to avoid triggering * recompilation of other units when changes are made here. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CSysSolve.hpp b/Common/include/linear_algebra/CSysSolve.hpp index bf13a200abe5..ecfb4a3a789e 100644 --- a/Common/include/linear_algebra/CSysSolve.hpp +++ b/Common/include/linear_algebra/CSysSolve.hpp @@ -3,7 +3,7 @@ * \brief Headers for the classes related to linear solvers (CG, FGMRES, etc) * The subroutines and functions are in the CSysSolve.cpp file. * \author J. Hicken, F. Palacios, T. Economon, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CSysSolve_b.hpp b/Common/include/linear_algebra/CSysSolve_b.hpp index 87455c5d5657..f37e110845c8 100644 --- a/Common/include/linear_algebra/CSysSolve_b.hpp +++ b/Common/include/linear_algebra/CSysSolve_b.hpp @@ -2,7 +2,7 @@ * \file CSysSolve_b.hpp * \brief Routines for the linear solver used in the reverse sweep of AD. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/CSysVector.hpp b/Common/include/linear_algebra/CSysVector.hpp index 7540cfb94941..6a54b84efa17 100644 --- a/Common/include/linear_algebra/CSysVector.hpp +++ b/Common/include/linear_algebra/CSysVector.hpp @@ -3,7 +3,7 @@ * \brief Declararion and inlines of the vector class used in the * solution of large, distributed, sparse linear systems. * \author P. Gomes, F. Palacios, J. Hicken, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/linear_algebra/blas_structure.hpp b/Common/include/linear_algebra/blas_structure.hpp index 49e131bc54db..0aea97ce64c2 100644 --- a/Common/include/linear_algebra/blas_structure.hpp +++ b/Common/include/linear_algebra/blas_structure.hpp @@ -4,7 +4,7 @@ operations, which are typically found in the BLAS libraries. The functions are in the blass_structure.cpp file. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -40,7 +40,7 @@ class CConfig; * \class CBlasStructure * \brief Class, which serves as an interface to the BLAS functionalities needed. * \author: E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CBlasStructure { public: diff --git a/Common/include/linear_algebra/vector_expressions.hpp b/Common/include/linear_algebra/vector_expressions.hpp index 3f1b6ed80a66..0df23094f62a 100644 --- a/Common/include/linear_algebra/vector_expressions.hpp +++ b/Common/include/linear_algebra/vector_expressions.hpp @@ -2,7 +2,7 @@ * \file vector_expressions.hpp * \brief Expression templates for vector types with coefficient-wise operations. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 52aa9e2a0079..49c75bbfad22 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2,7 +2,7 @@ * \file option_structure.hpp * \brief Defines classes for referencing options for easy input in CConfig * \author J. Hicken, B. Tracey - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index b78035d6f45a..669419b1f5ec 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -3,7 +3,7 @@ * \brief Template derived classes from COption, defined here as we * only include them where needed to reduce compilation time. * \author J. Hicken, B. Tracey - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/parallelization/mpi_structure.cpp b/Common/include/parallelization/mpi_structure.cpp index 3c7aa9c57479..72a06917cbd9 100644 --- a/Common/include/parallelization/mpi_structure.cpp +++ b/Common/include/parallelization/mpi_structure.cpp @@ -2,7 +2,7 @@ * \file mpi_structure.cpp * \brief Main subroutines for the mpi structures. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/parallelization/mpi_structure.hpp b/Common/include/parallelization/mpi_structure.hpp index 09d8a10fd561..1ee14c7d2fb7 100644 --- a/Common/include/parallelization/mpi_structure.hpp +++ b/Common/include/parallelization/mpi_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the mpi interface for generalized datatypes. * The subroutines and functions are in the mpi_structure.cpp file. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/parallelization/omp_structure.hpp b/Common/include/parallelization/omp_structure.hpp index d12f450219b7..09721e414b4b 100644 --- a/Common/include/parallelization/omp_structure.hpp +++ b/Common/include/parallelization/omp_structure.hpp @@ -13,7 +13,7 @@ * defined here with suitable fallback versions to limit the spread of * compiler tricks in other areas of the code. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/parallelization/special_vectorization.hpp b/Common/include/parallelization/special_vectorization.hpp index 1f49bfa0f187..b435632abc4a 100644 --- a/Common/include/parallelization/special_vectorization.hpp +++ b/Common/include/parallelization/special_vectorization.hpp @@ -2,7 +2,7 @@ * \file special_vectorization.hpp * \brief Code generator header to create specializations of simd::Array. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/parallelization/vectorization.hpp b/Common/include/parallelization/vectorization.hpp index 1a232844ee6a..aaa601a25af1 100644 --- a/Common/include/parallelization/vectorization.hpp +++ b/Common/include/parallelization/vectorization.hpp @@ -2,7 +2,7 @@ * \file vectorization.hpp * \brief Implementation of a portable SIMD type. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/C1DInterpolation.hpp b/Common/include/toolboxes/C1DInterpolation.hpp index f7a577c83a53..13f7dbf68cf9 100644 --- a/Common/include/toolboxes/C1DInterpolation.hpp +++ b/Common/include/toolboxes/C1DInterpolation.hpp @@ -2,7 +2,7 @@ * \file C1DInterpolation.hpp * \brief Inlet_interpolation_functions * \author Aman Baig - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/CLinearPartitioner.hpp b/Common/include/toolboxes/CLinearPartitioner.hpp index 8c937932d9b6..783c0e792675 100644 --- a/Common/include/toolboxes/CLinearPartitioner.hpp +++ b/Common/include/toolboxes/CLinearPartitioner.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CLinearPartitioner. * The implementations are in the CLinearPartitioner.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp index 645616b62740..49a8fce74fec 100644 --- a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp +++ b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp @@ -7,7 +7,7 @@ * \note Based on the IQN-ILS method, see DOI 10.1007/s11831-013-9085-5 and * references therein. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/CSquareMatrixCM.hpp b/Common/include/toolboxes/CSquareMatrixCM.hpp index adb4094199cb..0e17144a54f1 100644 --- a/Common/include/toolboxes/CSquareMatrixCM.hpp +++ b/Common/include/toolboxes/CSquareMatrixCM.hpp @@ -3,7 +3,7 @@ * \brief Dense general square matrix, used for example in DG standard elements * in Column Major order storage. * \author Edwin van der Weide, Pedro Gomes. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/CSymmetricMatrix.hpp b/Common/include/toolboxes/CSymmetricMatrix.hpp index 9d7f158c0486..fac98cb8ddae 100644 --- a/Common/include/toolboxes/CSymmetricMatrix.hpp +++ b/Common/include/toolboxes/CSymmetricMatrix.hpp @@ -2,7 +2,7 @@ * \file CSymmetricMatrix.hpp * \brief Dense symmetric matrix, used for example in RBF interpolation. * \author Joel Ho, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CIncTGVSolution.hpp b/Common/include/toolboxes/MMS/CIncTGVSolution.hpp index c9dc9c24ef7a..de7c108ab27a 100644 --- a/Common/include/toolboxes/MMS/CIncTGVSolution.hpp +++ b/Common/include/toolboxes/MMS/CIncTGVSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CIncTGVSolution. * The implementations are in the CIncTGVSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp b/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp index 7521402cbd17..c32da19c91ab 100644 --- a/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp +++ b/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CInviscidVortexSolution. * The implementations are in the CInviscidVortexSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp b/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp index 39b73aeb9752..8b290bedde60 100644 --- a/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSIncEulerSolution. * The implementations are in the CMMSIncEulerSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp b/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp index 3664007e538c..b5b8063739ad 100644 --- a/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSIncNSSolution. * The implementations are in the CMMSIncNSSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp index 74048c8a0eb1..1e9e090bf7da 100644 --- a/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSTwoHalfCirclesSolution. * The implementations are in the CMMSNSTwoHalfCirclesSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp index 3b37fff112c7..747b15957c57 100644 --- a/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSTwoHalfSpheresSolution. * The implementations are in the CMMSNSTwoHalfSpheresSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp index 4108157fb2fc..a9647ffe9d98 100644 --- a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSUnitQuadSolution. * The implementations are in the CMMSNSUnitQuadSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp index e0fca4c310df..31ba4471d126 100644 --- a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSUnitQuadSolutionWallBC. * The implementations are in the CMMSNSUnitQuadSolutionWallBC.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp b/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp index 9029824f4e06..cd4a8708b5b2 100644 --- a/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp +++ b/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CNSUnitQuadSolution.hpp. * The implementations are in the CNSUnitQuadSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CRinglebSolution.hpp b/Common/include/toolboxes/MMS/CRinglebSolution.hpp index a0edf62cf958..1262cc4b22bd 100644 --- a/Common/include/toolboxes/MMS/CRinglebSolution.hpp +++ b/Common/include/toolboxes/MMS/CRinglebSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CRinglebSolution.hpp. * The implementations are in the CRinglebSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CTGVSolution.hpp b/Common/include/toolboxes/MMS/CTGVSolution.hpp index 9a41a30dc037..10fb86405d7c 100644 --- a/Common/include/toolboxes/MMS/CTGVSolution.hpp +++ b/Common/include/toolboxes/MMS/CTGVSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CTGVSolution. * The implementations are in the CTGVSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp b/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp index 4c9b52f2e012..d17e143919a1 100644 --- a/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp +++ b/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CUserDefinedSolution. * The implementations are in the CUserDefinedSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/MMS/CVerificationSolution.hpp b/Common/include/toolboxes/MMS/CVerificationSolution.hpp index ce7cabd37eff..1ce3d0d0e2c1 100644 --- a/Common/include/toolboxes/MMS/CVerificationSolution.hpp +++ b/Common/include/toolboxes/MMS/CVerificationSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the base class CVerificationSolution. * The implementations are in the CVerificationSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/allocation_toolbox.hpp b/Common/include/toolboxes/allocation_toolbox.hpp index 9754217d3a7d..fa2a18bdeaa8 100644 --- a/Common/include/toolboxes/allocation_toolbox.hpp +++ b/Common/include/toolboxes/allocation_toolbox.hpp @@ -5,7 +5,7 @@ * \note These are "kernel" functions, only to be used with good reason, * always try to use higher level container classes. * \author P. Gomes, D. Kavolis - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/geometry_toolbox.hpp b/Common/include/toolboxes/geometry_toolbox.hpp index 594e79fd9b34..051119515109 100644 --- a/Common/include/toolboxes/geometry_toolbox.hpp +++ b/Common/include/toolboxes/geometry_toolbox.hpp @@ -1,7 +1,7 @@ /*! * \file geometry_toolbox.hpp * \brief Collection of common lightweight geometry-oriented methods. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/graph_toolbox.hpp b/Common/include/toolboxes/graph_toolbox.hpp index 3ad0721ab10d..a33e7d431170 100644 --- a/Common/include/toolboxes/graph_toolbox.hpp +++ b/Common/include/toolboxes/graph_toolbox.hpp @@ -2,7 +2,7 @@ * \file graph_toolbox.hpp * \brief Functions and classes to build/represent sparse graphs or sparse patterns. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/toolboxes/printing_toolbox.hpp b/Common/include/toolboxes/printing_toolbox.hpp index 4b243b77d653..fe9d75b9e5db 100644 --- a/Common/include/toolboxes/printing_toolbox.hpp +++ b/Common/include/toolboxes/printing_toolbox.hpp @@ -2,7 +2,7 @@ * \file printing_toolbox.hpp * \brief Header file for the printing toolbox. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/include/wall_model.hpp b/Common/include/wall_model.hpp index 72b1fce03efb..8571cfe90793 100644 --- a/Common/include/wall_model.hpp +++ b/Common/include/wall_model.hpp @@ -2,7 +2,7 @@ * \file wall_model.hpp * \brief Headers for the wall model functions for large eddy simulations. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -42,7 +42,7 @@ class CFluidModel; * \class CWallModel * \brief Base class for defining the LES wall model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CWallModel { diff --git a/Common/lib/Makefile.am b/Common/lib/Makefile.am index 3b88976007f3..2e698b723360 100644 --- a/Common/lib/Makefile.am +++ b/Common/lib/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for the SU2 common library # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 5ae576f72d09..c693a48338dd 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2,7 +2,7 @@ * \file CConfig.cpp * \brief Main file for managing the config file * \author F. Palacios, T. Economon, B. Tracey, H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -3046,7 +3046,7 @@ void CConfig::SetHeader(unsigned short val_software) const{ if ((iZone == 0) && (rank == MASTER_NODE)){ cout << endl << "-------------------------------------------------------------------------" << endl; cout << "| ___ _ _ ___ |" << endl; - cout << "| / __| | | |_ ) Release 7.1.0 \"Blackbird\" |" << endl; + cout << "| / __| | | |_ ) Release 7.1.1 \"Blackbird\" |" << endl; cout << "| \\__ \\ |_| |/ / |" << endl; switch (val_software) { case SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break; diff --git a/Common/src/adt/CADTBaseClass.cpp b/Common/src/adt/CADTBaseClass.cpp index d42d86d0ea04..6439e73aee51 100644 --- a/Common/src/adt/CADTBaseClass.cpp +++ b/Common/src/adt/CADTBaseClass.cpp @@ -2,7 +2,7 @@ * \file CADTBaseClass.cpp * \brief Base class for storing an ADT in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/adt/CADTElemClass.cpp b/Common/src/adt/CADTElemClass.cpp index 7e6ff76af009..270863ed0089 100644 --- a/Common/src/adt/CADTElemClass.cpp +++ b/Common/src/adt/CADTElemClass.cpp @@ -2,7 +2,7 @@ * \file CADTElemClass.cpp * \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/adt/CADTPointsOnlyClass.cpp b/Common/src/adt/CADTPointsOnlyClass.cpp index 0a2555e21fa2..d8c5448059be 100644 --- a/Common/src/adt/CADTPointsOnlyClass.cpp +++ b/Common/src/adt/CADTPointsOnlyClass.cpp @@ -2,7 +2,7 @@ * \file CADTPointsOnlyClass.cpp * \brief Class for storing an ADT of only points in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/basic_types/ad_structure.cpp b/Common/src/basic_types/ad_structure.cpp index 6d3a99c43750..cd4381c67610 100644 --- a/Common/src/basic_types/ad_structure.cpp +++ b/Common/src/basic_types/ad_structure.cpp @@ -2,7 +2,7 @@ * \file ad_structure.cpp * \brief Main subroutines for the algorithmic differentiation (AD) structure. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_cgns_elements.cpp b/Common/src/fem/fem_cgns_elements.cpp index 22c6a5549214..50956b5629d1 100644 --- a/Common/src/fem/fem_cgns_elements.cpp +++ b/Common/src/fem/fem_cgns_elements.cpp @@ -2,7 +2,7 @@ * \file fem_cgns_elements.cpp * \brief CGNS element definitions and conversions to the SU2 standard. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_gauss_jacobi_quadrature.cpp b/Common/src/fem/fem_gauss_jacobi_quadrature.cpp index 7ba621f36409..c6ee5266b2ba 100644 --- a/Common/src/fem/fem_gauss_jacobi_quadrature.cpp +++ b/Common/src/fem/fem_gauss_jacobi_quadrature.cpp @@ -4,7 +4,7 @@ quadrature rules. All the functions in this file are based on the program JACOBI_RULE of John Burkardt. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_geometry_structure.cpp b/Common/src/fem/fem_geometry_structure.cpp index e0119ac2ada4..45e5f6e02bb8 100644 --- a/Common/src/fem/fem_geometry_structure.cpp +++ b/Common/src/fem/fem_geometry_structure.cpp @@ -2,7 +2,7 @@ * \file fem_geometry_structure.cpp * \brief Functions for creating the primal grid for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_integration_rules.cpp b/Common/src/fem/fem_integration_rules.cpp index fd56a4863906..f455c6698b82 100644 --- a/Common/src/fem/fem_integration_rules.cpp +++ b/Common/src/fem/fem_integration_rules.cpp @@ -2,7 +2,7 @@ * \file fem_integration_rules.cpp * \brief FEM integration rules for the standard elements. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_standard_element.cpp b/Common/src/fem/fem_standard_element.cpp index 143ee58e9467..f4698bc49505 100644 --- a/Common/src/fem/fem_standard_element.cpp +++ b/Common/src/fem/fem_standard_element.cpp @@ -2,7 +2,7 @@ * \file fem_standard_element.cpp * \brief Functions for the FEM standard elements. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_wall_distance.cpp b/Common/src/fem/fem_wall_distance.cpp index 8ff30688ae68..8cb687a2ab96 100644 --- a/Common/src/fem/fem_wall_distance.cpp +++ b/Common/src/fem/fem_wall_distance.cpp @@ -2,7 +2,7 @@ * \file fem_wall_distance.cpp * \brief Main subroutines for computing the wall distance for the FEM solver. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/fem_work_estimate_metis.cpp b/Common/src/fem/fem_work_estimate_metis.cpp index 54ab466069d7..af4b1d031b94 100644 --- a/Common/src/fem/fem_work_estimate_metis.cpp +++ b/Common/src/fem/fem_work_estimate_metis.cpp @@ -3,7 +3,7 @@ * \brief This file contains the implementation of the member functions WorkEstimateMetis for the FEM standard elements. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/fem/geometry_structure_fem_part.cpp b/Common/src/fem/geometry_structure_fem_part.cpp index caf47fbe223c..0c82404e186d 100644 --- a/Common/src/fem/geometry_structure_fem_part.cpp +++ b/Common/src/fem/geometry_structure_fem_part.cpp @@ -2,7 +2,7 @@ * \file geometry_structure_fem_part.cpp * \brief Main subroutines for distributin the grid for the Fluid FEM solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/CDummyGeometry.cpp b/Common/src/geometry/CDummyGeometry.cpp index a4ff312d54ae..9419bda7386c 100644 --- a/Common/src/geometry/CDummyGeometry.cpp +++ b/Common/src/geometry/CDummyGeometry.cpp @@ -2,7 +2,7 @@ * \file CDummyGeometry.hpp * \brief Implementation of the dummy geometry class used in "dry run" mode. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 735477a7bd56..69f337368dea 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -2,7 +2,7 @@ * \file CGeometry.cpp * \brief Implementation of the base geometry class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/CMultiGridGeometry.cpp b/Common/src/geometry/CMultiGridGeometry.cpp index 6e09d81b9cf7..f6ba9222211e 100644 --- a/Common/src/geometry/CMultiGridGeometry.cpp +++ b/Common/src/geometry/CMultiGridGeometry.cpp @@ -2,7 +2,7 @@ * \file CMultiGridGeometry.cpp * \brief Implementation of the multigrid geometry class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/CMultiGridQueue.cpp b/Common/src/geometry/CMultiGridQueue.cpp index 10bf0e29c03b..114550207de8 100644 --- a/Common/src/geometry/CMultiGridQueue.cpp +++ b/Common/src/geometry/CMultiGridQueue.cpp @@ -2,7 +2,7 @@ * \file CMultiGridQueue.cpp * \brief Implementation of the multigrid queue class for the FVM solver. * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index c1021d38a142..6ede288f986a 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -2,7 +2,7 @@ * \file CPhysicalGeometry.cpp * \brief Implementation of the physical geometry class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/dual_grid/CDualGrid.cpp b/Common/src/geometry/dual_grid/CDualGrid.cpp index 9e92d133b044..b09df0e32117 100644 --- a/Common/src/geometry/dual_grid/CDualGrid.cpp +++ b/Common/src/geometry/dual_grid/CDualGrid.cpp @@ -2,7 +2,7 @@ * \file CDualGrid.cpp * \brief Main classes for defining the dual grid * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/dual_grid/CEdge.cpp b/Common/src/geometry/dual_grid/CEdge.cpp index 18d38e9cab52..f0aecede3fa0 100644 --- a/Common/src/geometry/dual_grid/CEdge.cpp +++ b/Common/src/geometry/dual_grid/CEdge.cpp @@ -2,7 +2,7 @@ * \file CEdge.cpp * \brief Implementation of the edge class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/dual_grid/CPoint.cpp b/Common/src/geometry/dual_grid/CPoint.cpp index 08ad55cf1fc9..e4fb9944e81f 100644 --- a/Common/src/geometry/dual_grid/CPoint.cpp +++ b/Common/src/geometry/dual_grid/CPoint.cpp @@ -2,7 +2,7 @@ * \file CPoint.cpp * \brief Main classes for defining the points of the dual grid * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/dual_grid/CTurboVertex.cpp b/Common/src/geometry/dual_grid/CTurboVertex.cpp index 1f485d8da1af..429dfc17b456 100644 --- a/Common/src/geometry/dual_grid/CTurboVertex.cpp +++ b/Common/src/geometry/dual_grid/CTurboVertex.cpp @@ -2,7 +2,7 @@ * \file CTurboVertex.cpp * \brief Main classes for defining the turbo vertices of the dual grid * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/dual_grid/CVertex.cpp b/Common/src/geometry/dual_grid/CVertex.cpp index a60dc9bb122f..76e9a518b4a8 100644 --- a/Common/src/geometry/dual_grid/CVertex.cpp +++ b/Common/src/geometry/dual_grid/CVertex.cpp @@ -2,7 +2,7 @@ * \file CVertex.cpp * \brief Main classes for defining the vertices of the dual grid * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CElement.cpp b/Common/src/geometry/elements/CElement.cpp index adc36c439cc6..d49f13e0839e 100644 --- a/Common/src/geometry/elements/CElement.cpp +++ b/Common/src/geometry/elements/CElement.cpp @@ -2,7 +2,7 @@ * \file CElement.cpp * \brief Definition of the Finite Element structure (elements) * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CHEXA8.cpp b/Common/src/geometry/elements/CHEXA8.cpp index bf354132841a..815d9628c79c 100644 --- a/Common/src/geometry/elements/CHEXA8.cpp +++ b/Common/src/geometry/elements/CHEXA8.cpp @@ -2,7 +2,7 @@ * \file CHEXA8.cpp * \brief Definition of 8-node hexa element with 8 Gauss points. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CPRISM6.cpp b/Common/src/geometry/elements/CPRISM6.cpp index cc38c7c9e255..799c43c8e863 100644 --- a/Common/src/geometry/elements/CPRISM6.cpp +++ b/Common/src/geometry/elements/CPRISM6.cpp @@ -2,7 +2,7 @@ * \file CPRISM6.cpp * \brief Definition of the 6-node triangular prism element with 6 Gauss points. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CPYRAM5.cpp b/Common/src/geometry/elements/CPYRAM5.cpp index 8f82241d68fc..d31aed690124 100644 --- a/Common/src/geometry/elements/CPYRAM5.cpp +++ b/Common/src/geometry/elements/CPYRAM5.cpp @@ -2,7 +2,7 @@ * \file CPYRAM5.cpp * \brief Definition of 5-node pyramid element with 5 Gauss points. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CQUAD4.cpp b/Common/src/geometry/elements/CQUAD4.cpp index 433c90279089..8d6c98221161 100644 --- a/Common/src/geometry/elements/CQUAD4.cpp +++ b/Common/src/geometry/elements/CQUAD4.cpp @@ -2,7 +2,7 @@ * \file CQUAD4.cpp * \brief Definition of the 4-node quadrilateral element with 4 Gauss points. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CTETRA1.cpp b/Common/src/geometry/elements/CTETRA1.cpp index 4fd754222d1b..9cb9454c51f8 100644 --- a/Common/src/geometry/elements/CTETRA1.cpp +++ b/Common/src/geometry/elements/CTETRA1.cpp @@ -2,7 +2,7 @@ * \file CTETRA1.cpp * \brief Definition of 4-node tetra element with 1 Gauss point. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/elements/CTRIA1.cpp b/Common/src/geometry/elements/CTRIA1.cpp index 2b33b3857627..5f383fcf364f 100644 --- a/Common/src/geometry/elements/CTRIA1.cpp +++ b/Common/src/geometry/elements/CTRIA1.cpp @@ -2,7 +2,7 @@ * \file CTRIA1.cpp * \brief Definition of the 3-node triangular element with one Gauss point. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp index 90ede660f4df..54076dbd8d2a 100644 --- a/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a 3D box grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp index c81244c54cd9..b23616979a4a 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Class that reads a single zone of a CGNS mesh file from disk into * linear partitions across all ranks. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/meshreader/CMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CMeshReaderFVM.cpp index 3274e8203a97..ce5b53f5dd6d 100644 --- a/Common/src/geometry/meshreader/CMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Helper class that provides the counts for each rank in a linear * partitioning given the global count as input. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp index ec59f1730d8d..2d89f9f92449 100644 --- a/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a 2D rectangular grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index ed9855fa543a..480450a87e6b 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a native SU2 ASCII grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CHexahedron.cpp b/Common/src/geometry/primal_grid/CHexahedron.cpp index b24caa18f2d3..e71536990f29 100644 --- a/Common/src/geometry/primal_grid/CHexahedron.cpp +++ b/Common/src/geometry/primal_grid/CHexahedron.cpp @@ -2,7 +2,7 @@ * \file CHexahedron.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CLine.cpp b/Common/src/geometry/primal_grid/CLine.cpp index 3cdddbe178e3..7eb589cbd2bc 100644 --- a/Common/src/geometry/primal_grid/CLine.cpp +++ b/Common/src/geometry/primal_grid/CLine.cpp @@ -2,7 +2,7 @@ * \file CLine.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CPrimalGrid.cpp b/Common/src/geometry/primal_grid/CPrimalGrid.cpp index 077923502db9..7593048a17d9 100644 --- a/Common/src/geometry/primal_grid/CPrimalGrid.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGrid.cpp @@ -2,7 +2,7 @@ * \file CPrimalGrid.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp index ed26eabbcc32..9e07c168c9d3 100644 --- a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp @@ -2,7 +2,7 @@ * \file CPrimalGridBoundFEM.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CPrimalGridFEM.cpp b/Common/src/geometry/primal_grid/CPrimalGridFEM.cpp index 4d5a15f9f7f5..665b14dbafd7 100644 --- a/Common/src/geometry/primal_grid/CPrimalGridFEM.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGridFEM.cpp @@ -2,7 +2,7 @@ * \file CPrimalGridFEM.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CPrism.cpp b/Common/src/geometry/primal_grid/CPrism.cpp index d2a6bbfb1f54..62230e783f63 100644 --- a/Common/src/geometry/primal_grid/CPrism.cpp +++ b/Common/src/geometry/primal_grid/CPrism.cpp @@ -2,7 +2,7 @@ * \file CPrism.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CPyramid.cpp b/Common/src/geometry/primal_grid/CPyramid.cpp index c8048e67e22c..bf1d69087db2 100644 --- a/Common/src/geometry/primal_grid/CPyramid.cpp +++ b/Common/src/geometry/primal_grid/CPyramid.cpp @@ -2,7 +2,7 @@ * \file CPyramid.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CQuadrilateral.cpp b/Common/src/geometry/primal_grid/CQuadrilateral.cpp index 6691474092c7..3e332c9aad06 100644 --- a/Common/src/geometry/primal_grid/CQuadrilateral.cpp +++ b/Common/src/geometry/primal_grid/CQuadrilateral.cpp @@ -2,7 +2,7 @@ * \file CQuadrilateral.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CTetrahedron.cpp b/Common/src/geometry/primal_grid/CTetrahedron.cpp index ef8e8311bba7..612ed31bc273 100644 --- a/Common/src/geometry/primal_grid/CTetrahedron.cpp +++ b/Common/src/geometry/primal_grid/CTetrahedron.cpp @@ -2,7 +2,7 @@ * \file CTetrahedron.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CTriangle.cpp b/Common/src/geometry/primal_grid/CTriangle.cpp index 464de22f4181..421e4739a46f 100644 --- a/Common/src/geometry/primal_grid/CTriangle.cpp +++ b/Common/src/geometry/primal_grid/CTriangle.cpp @@ -2,7 +2,7 @@ * \file CTriangle.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/geometry/primal_grid/CVertexMPI.cpp b/Common/src/geometry/primal_grid/CVertexMPI.cpp index a615d91adfb7..2dcf2446faad 100644 --- a/Common/src/geometry/primal_grid/CVertexMPI.cpp +++ b/Common/src/geometry/primal_grid/CVertexMPI.cpp @@ -2,7 +2,7 @@ * \file CVertexMPI.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/graph_coloring_structure.cpp b/Common/src/graph_coloring_structure.cpp index e26f462659ad..d6e85a739f74 100644 --- a/Common/src/graph_coloring_structure.cpp +++ b/Common/src/graph_coloring_structure.cpp @@ -2,7 +2,7 @@ * \file graph_coloring_structure.cpp * \brief Functions used to carry out the coloring of a given graph. * \author E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CBSplineBlending.cpp b/Common/src/grid_movement/CBSplineBlending.cpp index 06494cec4c1d..9792d7c178a5 100644 --- a/Common/src/grid_movement/CBSplineBlending.cpp +++ b/Common/src/grid_movement/CBSplineBlending.cpp @@ -2,7 +2,7 @@ * \file CBSplineBlending.cpp * \brief Subroutines for B-Spline blening for FFDs * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CBezierBlending.cpp b/Common/src/grid_movement/CBezierBlending.cpp index 79fcac17b623..04248de06fec 100644 --- a/Common/src/grid_movement/CBezierBlending.cpp +++ b/Common/src/grid_movement/CBezierBlending.cpp @@ -2,7 +2,7 @@ * \file CBezierBlending.cpp * \brief Subroutines for Bezier blending for FFDs * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CFreeFormBlending.cpp b/Common/src/grid_movement/CFreeFormBlending.cpp index a2bf378af84f..c1312de02a7f 100644 --- a/Common/src/grid_movement/CFreeFormBlending.cpp +++ b/Common/src/grid_movement/CFreeFormBlending.cpp @@ -2,7 +2,7 @@ * \file CFreeFormBlending.cpp * \brief Parent class for FFD Blending functions * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CFreeFormDefBox.cpp b/Common/src/grid_movement/CFreeFormDefBox.cpp index 850c1533a24d..0e54fbfec76d 100644 --- a/Common/src/grid_movement/CFreeFormDefBox.cpp +++ b/Common/src/grid_movement/CFreeFormDefBox.cpp @@ -2,7 +2,7 @@ * \file CFreeFormDefBox.cpp * \brief Subroutines for handling Free-Form Deformation Boxes * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CGridMovement.cpp b/Common/src/grid_movement/CGridMovement.cpp index acf668b0d79a..fdbc3c194afc 100644 --- a/Common/src/grid_movement/CGridMovement.cpp +++ b/Common/src/grid_movement/CGridMovement.cpp @@ -2,7 +2,7 @@ * \file CGridMovement.cpp * \brief Parent class for grid movement classes * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index 9f71401e3e23..7041dbebf4c4 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -2,7 +2,7 @@ * \file CSurfaceMovement.cpp * \brief Subroutines for moving mesh surface elements * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index b0dd11cf8ec6..bf448631c6a8 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -2,7 +2,7 @@ * \file CVolumetricMovement.cpp * \brief Subroutines for moving mesh volume elements * \author F. Palacios, T. Economon, S. Padron - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CInterpolator.cpp b/Common/src/interface_interpolation/CInterpolator.cpp index afb3c2fff17c..95b5eb2c79e7 100644 --- a/Common/src/interface_interpolation/CInterpolator.cpp +++ b/Common/src/interface_interpolation/CInterpolator.cpp @@ -2,7 +2,7 @@ * \file CInterpolator.cpp * \brief Definition of the base class for interface interpolation. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CInterpolatorFactory.cpp b/Common/src/interface_interpolation/CInterpolatorFactory.cpp index 625294274beb..8bf2ea30cf6d 100644 --- a/Common/src/interface_interpolation/CInterpolatorFactory.cpp +++ b/Common/src/interface_interpolation/CInterpolatorFactory.cpp @@ -1,7 +1,7 @@ /*! * \file CInterpolatorFactory.cpp * \brief Factory to generate interpolator objects. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CIsoparametric.cpp b/Common/src/interface_interpolation/CIsoparametric.cpp index 92e5aef651fe..c0589a2a88e8 100644 --- a/Common/src/interface_interpolation/CIsoparametric.cpp +++ b/Common/src/interface_interpolation/CIsoparametric.cpp @@ -2,7 +2,7 @@ * \file CIsoparametric.cpp * \brief Implementation isoparametric interpolation (using FE shape functions). * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CMirror.cpp b/Common/src/interface_interpolation/CMirror.cpp index ed42afb51ff5..0ef8a55d7511 100644 --- a/Common/src/interface_interpolation/CMirror.cpp +++ b/Common/src/interface_interpolation/CMirror.cpp @@ -2,7 +2,7 @@ * \file CMirror.cpp * \brief Implementation of mirror interpolation (conservative approach in FSI problems). * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CNearestNeighbor.cpp b/Common/src/interface_interpolation/CNearestNeighbor.cpp index c4cdd7830876..e29d893c1fe0 100644 --- a/Common/src/interface_interpolation/CNearestNeighbor.cpp +++ b/Common/src/interface_interpolation/CNearestNeighbor.cpp @@ -2,7 +2,7 @@ * \file CNearestNeighbor.cpp * \brief Implementation of nearest neighbor interpolation. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CRadialBasisFunction.cpp b/Common/src/interface_interpolation/CRadialBasisFunction.cpp index 82bd1ebef0d0..2b88464dea71 100644 --- a/Common/src/interface_interpolation/CRadialBasisFunction.cpp +++ b/Common/src/interface_interpolation/CRadialBasisFunction.cpp @@ -2,7 +2,7 @@ * \file CRadialBasisFunction.cpp * \brief Implementation of RBF interpolation. * \author Joel Ho, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/interface_interpolation/CSlidingMesh.cpp b/Common/src/interface_interpolation/CSlidingMesh.cpp index fb856382b7a7..0df50ec2fd42 100644 --- a/Common/src/interface_interpolation/CSlidingMesh.cpp +++ b/Common/src/interface_interpolation/CSlidingMesh.cpp @@ -2,7 +2,7 @@ * \file CSlidingMesh.cpp * \brief Implementation of sliding mesh interpolation. * \author H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/linear_algebra/CPastixWrapper.cpp b/Common/src/linear_algebra/CPastixWrapper.cpp index 9797e750ad08..af199bd8eff5 100644 --- a/Common/src/linear_algebra/CPastixWrapper.cpp +++ b/Common/src/linear_algebra/CPastixWrapper.cpp @@ -3,7 +3,7 @@ * \brief An interface to the INRIA solver PaStiX * (http://pastix.gforge.inria.fr/files/README-txt.html) * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index e71afd5144bb..5acf31fac080 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -2,7 +2,7 @@ * \file CSysMatrix.cpp * \brief Implementation of the sparse matrix class. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index 2f4907f00cda..43b1fffe92d5 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -2,7 +2,7 @@ * \file CSysSolve.cpp * \brief Main classes required for solving linear systems of equations * \author J. Hicken, F. Palacios, T. Economon, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/linear_algebra/CSysSolve_b.cpp b/Common/src/linear_algebra/CSysSolve_b.cpp index 062708f9dc7c..977c1ab0d0a1 100644 --- a/Common/src/linear_algebra/CSysSolve_b.cpp +++ b/Common/src/linear_algebra/CSysSolve_b.cpp @@ -2,7 +2,7 @@ * \file CSysSolve_b.cpp * \brief Routines for the linear solver used in the reverse sweep of AD. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/linear_algebra/CSysVector.cpp b/Common/src/linear_algebra/CSysVector.cpp index 0c941c5c8000..42aec4517e6f 100644 --- a/Common/src/linear_algebra/CSysVector.cpp +++ b/Common/src/linear_algebra/CSysVector.cpp @@ -2,7 +2,7 @@ * \file CSysVector.cpp * \brief Implementation and explicit instantiations of CSysVector. * \author P. Gomes, F. Palacios, J. Hicken, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/C1DInterpolation.cpp b/Common/src/toolboxes/C1DInterpolation.cpp index d91759517147..00c0ae5f2883 100644 --- a/Common/src/toolboxes/C1DInterpolation.cpp +++ b/Common/src/toolboxes/C1DInterpolation.cpp @@ -2,7 +2,7 @@ * \file C1DInterpolation.cpp * \brief Inlet_interpolation_functions * \author Aman Baig - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/CLinearPartitioner.cpp b/Common/src/toolboxes/CLinearPartitioner.cpp index 4fde525bd848..5c48abc15ee7 100644 --- a/Common/src/toolboxes/CLinearPartitioner.cpp +++ b/Common/src/toolboxes/CLinearPartitioner.cpp @@ -3,7 +3,7 @@ * \brief Helper class that provides the counts for each rank in a linear * partitioning given the global count as input. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/CSquareMatrixCM.cpp b/Common/src/toolboxes/CSquareMatrixCM.cpp index a5da8779b195..a4a538bfdcd4 100644 --- a/Common/src/toolboxes/CSquareMatrixCM.cpp +++ b/Common/src/toolboxes/CSquareMatrixCM.cpp @@ -2,7 +2,7 @@ * \file CSquareMatrixCM.cpp * \brief Implementation of dense matrix helper class in Column Major order (see hpp). * \author Edwin van der Weide, Pedro Gomes. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/CSymmetricMatrix.cpp b/Common/src/toolboxes/CSymmetricMatrix.cpp index 9aa9a682cf3b..fa4b7abee6a1 100644 --- a/Common/src/toolboxes/CSymmetricMatrix.cpp +++ b/Common/src/toolboxes/CSymmetricMatrix.cpp @@ -2,7 +2,7 @@ * \file CSymmetricMatrix.cpp * \brief Implementation of dense symmetric matrix helper class (see hpp). * \author Joel Ho, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp index 6dcfb0c3a57e..5f7c9a786d22 100644 --- a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp @@ -2,7 +2,7 @@ * \file CIncTGVSolution.cpp * \brief Implementations of the member functions of CIncTGVSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp index 73fb08f638f8..c437bf4a542d 100644 --- a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp +++ b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp @@ -2,7 +2,7 @@ * \file CInviscidVortexSolution.cpp * \brief Implementations of the member functions of CInviscidVortexSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp index c3b04d5adafd..847ef0bbcd27 100644 --- a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSIncEulerSolution.cpp * \brief Implementations of the member functions of CMMSIncEulerSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp index 6b49e2275387..7f411dbe6a09 100644 --- a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSIncNSSolution.cpp * \brief Implementations of the member functions of CMMSIncNSSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp index c5a6fcb6771d..cc8f546d1d2d 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSTwoHalfCirclesSolution.cpp * \brief Implementations of the member functions of CMMSNSTwoHalfCirclesSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp index 2350d0014afb..ac2e2cf71641 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSTwoHalfSpheresSolution.cpp * \brief Implementations of the member functions of CMMSNSTwoHalfSpheresSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp index 5004b8584fbd..a49a7782d55b 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSUnitQuadSolution.cpp * \brief Implementations of the member functions of CMMSNSUnitQuadSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp index e6bf87a6679e..66ebdbb8322f 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp @@ -2,7 +2,7 @@ * \file CMMSNSUnitQuadSolutionWallBC.cpp * \brief Implementations of the member functions of CMMSNSUnitQuadSolutionWallBC. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp index 250282bf9cc9..9ea6741b9e48 100644 --- a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp @@ -2,7 +2,7 @@ * \file CNSUnitQuadSolution.cpp * \brief Implementations of the member functions of CNSUnitQuadSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CRinglebSolution.cpp b/Common/src/toolboxes/MMS/CRinglebSolution.cpp index 0b0e4d4d45b9..c7710624bea2 100644 --- a/Common/src/toolboxes/MMS/CRinglebSolution.cpp +++ b/Common/src/toolboxes/MMS/CRinglebSolution.cpp @@ -2,7 +2,7 @@ * \file CRinglebSolution.cpp * \brief Implementations of the member functions of CRinglebSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CTGVSolution.cpp b/Common/src/toolboxes/MMS/CTGVSolution.cpp index 86cd097873ca..b9e399d4e121 100644 --- a/Common/src/toolboxes/MMS/CTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CTGVSolution.cpp @@ -2,7 +2,7 @@ * \file CTGVSolution.cpp * \brief Implementations of the member functions of CTGVSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp b/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp index 85a81a43b579..4ab8cbfcb6b5 100644 --- a/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp +++ b/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp @@ -2,7 +2,7 @@ * \file CUserDefinedSolution.cpp * \brief Implementations of the member functions of CUserDefinedSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CVerificationSolution.cpp b/Common/src/toolboxes/MMS/CVerificationSolution.cpp index 5fb39ef9ae3f..6d56a733766c 100644 --- a/Common/src/toolboxes/MMS/CVerificationSolution.cpp +++ b/Common/src/toolboxes/MMS/CVerificationSolution.cpp @@ -2,7 +2,7 @@ * \file CVerificationSolution.cpp * \brief Implementations of the member functions of CVerificationSolution. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncEulerSolution.py b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncEulerSolution.py index 95b1afd698a1..cbf999f412e6 100755 --- a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncEulerSolution.py +++ b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncEulerSolution.py @@ -4,7 +4,7 @@ # \brief Python script that generates the source terms for a # manufactured solution for the incompressible Euler eqns. # \author T. Economon -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncNSSolution.py b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncNSSolution.py index ac585bddf054..614c458c1037 100755 --- a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncNSSolution.py +++ b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSIncNSSolution.py @@ -4,7 +4,7 @@ # \brief Python script that generates the source terms for a # manufactured solution for the incompressible Navier-Stokes eqns. # \author T. Economon -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/Common/src/toolboxes/printing_toolbox.cpp b/Common/src/toolboxes/printing_toolbox.cpp index ae1db824d51b..306395f06907 100644 --- a/Common/src/toolboxes/printing_toolbox.cpp +++ b/Common/src/toolboxes/printing_toolbox.cpp @@ -2,7 +2,7 @@ * \file printing_toolbox.cpp * \brief Printing tools * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Common/src/wall_model.cpp b/Common/src/wall_model.cpp index efb291835bd9..c90aaa9ccc45 100644 --- a/Common/src/wall_model.cpp +++ b/Common/src/wall_model.cpp @@ -3,7 +3,7 @@ * \brief File, which contains the implementation for the wall model functions * for large eddy simulations. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/Makefile.am b/Makefile.am index 33ff29ba5c79..dbdc2b34bee8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Global makefile for the SU2 project # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/QuickStart/inv_NACA0012.cfg b/QuickStart/inv_NACA0012.cfg index 2f9d6db35ed7..10bcc036c34c 100644 --- a/QuickStart/inv_NACA0012.cfg +++ b/QuickStart/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/README.md b/README.md index 05f5d0bddb0c..e6280ae7b200 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

-# SU2 (ver. 7.1.0 "Blackbird"): The Open-Source CFD Code +# SU2 (ver. 7.1.1 "Blackbird"): The Open-Source CFD Code Computational analysis tools have revolutionized the way we design engineering systems, but most established codes are proprietary, unavailable, or prohibitively expensive for many users. The SU2 team is changing this, making multiphysics analysis and design optimization freely available as open-source software and involving everyone in its creation and development. diff --git a/SU2_CFD/include/CMarkerProfileReaderFVM.hpp b/SU2_CFD/include/CMarkerProfileReaderFVM.hpp index c80e7c2d30aa..7fe5a46dd472 100644 --- a/SU2_CFD/include/CMarkerProfileReaderFVM.hpp +++ b/SU2_CFD/include/CMarkerProfileReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMarkerProfileReaderFVM. * The implementations are in the CMarkerProfileReaderFVM.cpp file. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * The current SU2 release has been coordinated by the * SU2 International Developers Society diff --git a/SU2_CFD/include/SU2_CFD.hpp b/SU2_CFD/include/SU2_CFD.hpp index 8261344a4b5c..0df25eb4af5a 100644 --- a/SU2_CFD/include/SU2_CFD.hpp +++ b/SU2_CFD/include/SU2_CFD.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_CFD. * The subroutines and functions are in the SU2_CFD.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/definition_structure.hpp b/SU2_CFD/include/definition_structure.hpp index c64c601919d7..325b35182ba0 100644 --- a/SU2_CFD/include/definition_structure.hpp +++ b/SU2_CFD/include/definition_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines used by SU2_CFD. * The subroutines and functions are in the definition_structure.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index b5856f49e829..6a0d0034f1cf 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -2,7 +2,7 @@ * \class CDiscAdjMultizoneDriver.hpp * \brief Class for driving adjoint multi-zone problems. * \author O. Burghardt, P. Gomes, T. Albring, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp index b8ac1335c8b9..93954bde7be6 100644 --- a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CDiscAdjSinglezoneDriver * \brief Class for driving single-zone adjoint solvers. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { protected: diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 954f943036fd..30c37ec9e273 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CDummyDriver.hpp b/SU2_CFD/include/drivers/CDummyDriver.hpp index d29036224879..4a0f168cadf4 100644 --- a/SU2_CFD/include/drivers/CDummyDriver.hpp +++ b/SU2_CFD/include/drivers/CDummyDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CMultizoneDriver.hpp b/SU2_CFD/include/drivers/CMultizoneDriver.hpp index 079d91ea7f15..a938c1a50ec6 100644 --- a/SU2_CFD/include/drivers/CMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CMultizoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \class CMultizoneDriver * \brief Class for driving zone-specific iterations. * \author R. Sanchez, O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CMultizoneDriver : public CDriver { protected: diff --git a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp index 82360bd0cc04..a46e799370ff 100644 --- a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CSinglezoneDriver * \brief Class for driving single-zone solvers. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSinglezoneDriver : public CDriver { protected: diff --git a/SU2_CFD/include/fluid/CConductivityModel.hpp b/SU2_CFD/include/fluid/CConductivityModel.hpp index 676d7a5047dd..ecf1157130de 100644 --- a/SU2_CFD/include/fluid/CConductivityModel.hpp +++ b/SU2_CFD/include/fluid/CConductivityModel.hpp @@ -2,7 +2,7 @@ * \file CConductivityModel.hpp * \brief Defines an interface class for thermal conductivity models. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantConductivity.hpp b/SU2_CFD/include/fluid/CConstantConductivity.hpp index a4b2dbb4d554..7f957887b18c 100644 --- a/SU2_CFD/include/fluid/CConstantConductivity.hpp +++ b/SU2_CFD/include/fluid/CConstantConductivity.hpp @@ -2,7 +2,7 @@ * \file CConstantConductivity.hpp * \brief Defines a constant laminar thermal conductivity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp b/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp index aede30be6250..d67035e67b96 100644 --- a/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp +++ b/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp @@ -2,7 +2,7 @@ * \file CConstantConductivityRANS.hpp * \brief Defines a constant conductivity model for RANS problems. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantDensity.hpp b/SU2_CFD/include/fluid/CConstantDensity.hpp index 0bb57d88908c..eca3b95c0a24 100644 --- a/SU2_CFD/include/fluid/CConstantDensity.hpp +++ b/SU2_CFD/include/fluid/CConstantDensity.hpp @@ -2,7 +2,7 @@ * \file CConstantDensity.hpp * \brief Defines the incompressible constant density model. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantPrandtl.hpp b/SU2_CFD/include/fluid/CConstantPrandtl.hpp index 46ce24d3292b..bb4bc5fd422b 100644 --- a/SU2_CFD/include/fluid/CConstantPrandtl.hpp +++ b/SU2_CFD/include/fluid/CConstantPrandtl.hpp @@ -2,7 +2,7 @@ * \file CConstantPrandtl.hpp * \brief Defines a non-constant laminar Prandtl number thermal conductivity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp b/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp index 172a58e5bcca..7cb7439b676e 100644 --- a/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp +++ b/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp @@ -2,7 +2,7 @@ * \file CConstantPrandtlRANS.hpp * \brief Defines a non-constant effective thermal conductivity for RANS problems using Prandtl numbers. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantViscosity.hpp b/SU2_CFD/include/fluid/CConstantViscosity.hpp index be47ab89fc23..548a2baa7bc5 100644 --- a/SU2_CFD/include/fluid/CConstantViscosity.hpp +++ b/SU2_CFD/include/fluid/CConstantViscosity.hpp @@ -2,7 +2,7 @@ * \file CConstantViscosity.hpp * \brief Defines a constant laminar viscosity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CFluidModel.hpp b/SU2_CFD/include/fluid/CFluidModel.hpp index aafe78197d9a..a521a3cac838 100644 --- a/SU2_CFD/include/fluid/CFluidModel.hpp +++ b/SU2_CFD/include/fluid/CFluidModel.hpp @@ -2,7 +2,7 @@ * \file CFluidModel.hpp * \brief Defines the main fluid model class for thermophysical properties. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CIdealGas.hpp b/SU2_CFD/include/fluid/CIdealGas.hpp index 487c2197807a..1282552203a6 100644 --- a/SU2_CFD/include/fluid/CIdealGas.hpp +++ b/SU2_CFD/include/fluid/CIdealGas.hpp @@ -2,7 +2,7 @@ * \file CIdealGas.hpp * \brief Defines the ideal gas model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CIncIdealGas.hpp b/SU2_CFD/include/fluid/CIncIdealGas.hpp index d9d8193de177..548d0269dd6a 100644 --- a/SU2_CFD/include/fluid/CIncIdealGas.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGas.hpp @@ -2,7 +2,7 @@ * \file CIncIdealGas.hpp * \brief Defines the incompressible Ideal Gas model. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp index 1407a0e4bc03..b789d9b2f921 100644 --- a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp @@ -2,7 +2,7 @@ * \file CIncIdealGasPolynomial.hpp * \brief Defines the incompressible Ideal Gas model with polynomial Cp. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CMutationTCLib.hpp b/SU2_CFD/include/fluid/CMutationTCLib.hpp index 863d05ff6707..9820eeb164f9 100644 --- a/SU2_CFD/include/fluid/CMutationTCLib.hpp +++ b/SU2_CFD/include/fluid/CMutationTCLib.hpp @@ -2,7 +2,7 @@ * \file CMutationTCLib.hpp * \brief Defines the class for the link to Mutation++ ThermoChemistry library. * \author C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CNEMOGas.hpp b/SU2_CFD/include/fluid/CNEMOGas.hpp index 0cc9b06c97a6..734ac565c3cd 100644 --- a/SU2_CFD/include/fluid/CNEMOGas.hpp +++ b/SU2_CFD/include/fluid/CNEMOGas.hpp @@ -2,7 +2,7 @@ * \file CNEMOGas.hpp * \brief Defines the nonequilibrium gas model. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPengRobinson.hpp b/SU2_CFD/include/fluid/CPengRobinson.hpp index 59d125735985..66061aaf378a 100644 --- a/SU2_CFD/include/fluid/CPengRobinson.hpp +++ b/SU2_CFD/include/fluid/CPengRobinson.hpp @@ -2,7 +2,7 @@ * \file CPengRobinson.hpp * \brief Defines the Peng-Robinson model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp index d0d4f56aef88..5626cfc7147d 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp @@ -2,7 +2,7 @@ * \file CPolynomialConductivity.hpp * \brief Defines a non-constant laminar thermal conductivity using a polynomial function of temperature. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp index 3ef741328340..02fdd35fae3b 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp @@ -3,7 +3,7 @@ * \brief Defines a non-constant thermal conductivity using a polynomial function of temperature * for RANS problems with the addition of a turbulent component based on a turbulent Prandtl number. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp index f69c021fe717..31ae31304219 100644 --- a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp @@ -2,7 +2,7 @@ * \file CPolynomialViscosity.hpp * \brief Defines a laminar viscosity model as a polynomial function of temperature. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CSU2TCLib.hpp b/SU2_CFD/include/fluid/CSU2TCLib.hpp index b08a03acdb19..0a42773582ab 100644 --- a/SU2_CFD/include/fluid/CSU2TCLib.hpp +++ b/SU2_CFD/include/fluid/CSU2TCLib.hpp @@ -2,7 +2,7 @@ * \file CSU2TCLib.hpp * \brief Defines the classes for different user defined ThermoChemistry libraries. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CSutherland.hpp b/SU2_CFD/include/fluid/CSutherland.hpp index a47ab501c555..204c230efa35 100644 --- a/SU2_CFD/include/fluid/CSutherland.hpp +++ b/SU2_CFD/include/fluid/CSutherland.hpp @@ -2,7 +2,7 @@ * \file CSutherland.hpp * \brief Defines Sutherland's Law for laminar viscosity. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp b/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp index 9167076a90a4..5a9448cc9816 100644 --- a/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp +++ b/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp @@ -2,7 +2,7 @@ * \file CVanDerWaalsGas.hpp * \brief Declaration of the Polytropic Van der Waals model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CViscosityModel.hpp b/SU2_CFD/include/fluid/CViscosityModel.hpp index 04aa7adefb93..7a5b75c102c0 100644 --- a/SU2_CFD/include/fluid/CViscosityModel.hpp +++ b/SU2_CFD/include/fluid/CViscosityModel.hpp @@ -2,7 +2,7 @@ * \file CViscosityModel.hpp * \brief Interface class for defining laminar viscosity models. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp index 89bd45f8c3a7..0233daa886cb 100644 --- a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp +++ b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp @@ -4,7 +4,7 @@ * \note This allows the same implementation to be used for conservative * and primitive variables of any solver. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp b/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp index c706a2b6f3b9..6cf2e739a7be 100644 --- a/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp +++ b/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp @@ -3,7 +3,7 @@ * \brief Generic implementation of Least-Squares gradient computation. * \note This allows the same implementation to be used for conservative * and primitive variables of any solver. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CFEM_DG_Integration.hpp b/SU2_CFD/include/integration/CFEM_DG_Integration.hpp index 8d3fff4a2afa..13e1c32473c4 100644 --- a/SU2_CFD/include/integration/CFEM_DG_Integration.hpp +++ b/SU2_CFD/include/integration/CFEM_DG_Integration.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_Integration.hpp * \brief Declaration of class for integration with the FEM DG solver. * \author E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ * \class CFEM_DG_Integration * \brief Class for integration with the FEM DG solver. * \author E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_DG_Integration final : public CIntegration { public: diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 72bf34b512d4..34d31f00fb3d 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -2,7 +2,7 @@ * \file CIntegration.hpp * \brief Declaration of the main routines to orchestrate space and time integration. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CMultiGridIntegration.hpp b/SU2_CFD/include/integration/CMultiGridIntegration.hpp index f268190c1e9d..b69342f55ce2 100644 --- a/SU2_CFD/include/integration/CMultiGridIntegration.hpp +++ b/SU2_CFD/include/integration/CMultiGridIntegration.hpp @@ -2,7 +2,7 @@ * \file CMultiGridIntegration.hpp * \brief Declaration of class for time integration using a multigrid method. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index c25e47e701de..86626b7629e6 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -2,7 +2,7 @@ * \file CNewtonIntegration.hpp * \brief Newton-Krylov integration. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CSingleGridIntegration.hpp b/SU2_CFD/include/integration/CSingleGridIntegration.hpp index 02c364b8eefc..53bd4f5966e3 100644 --- a/SU2_CFD/include/integration/CSingleGridIntegration.hpp +++ b/SU2_CFD/include/integration/CSingleGridIntegration.hpp @@ -2,7 +2,7 @@ * \file CSingleGridIntegration.hpp * \brief Declaration of class for numerical integration of fine grid-only problems. * \author A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CStructuralIntegration.hpp b/SU2_CFD/include/integration/CStructuralIntegration.hpp index bcd446935803..0977f6fe64c0 100644 --- a/SU2_CFD/include/integration/CStructuralIntegration.hpp +++ b/SU2_CFD/include/integration/CStructuralIntegration.hpp @@ -2,7 +2,7 @@ * \file CStructuralIntegration.hpp * \brief Declaration of class for numerical integration of structural problems. * \author R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/CInterface.hpp b/SU2_CFD/include/interfaces/CInterface.hpp index d8911e393338..6c9c66edf24a 100644 --- a/SU2_CFD/include/interfaces/CInterface.hpp +++ b/SU2_CFD/include/interfaces/CInterface.hpp @@ -3,7 +3,7 @@ * \brief Declarations and inlines of the transfer structure. * The subroutines and functions are in the physics folders. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -50,7 +50,7 @@ using namespace std; * \class CInterface * \brief Main class for defining the physical transfer of information. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CInterface { diff --git a/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp b/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp index 8388c30dcc06..8d53bce25868 100644 --- a/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another one. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp b/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp index 7d427134d80e..e758813762dc 100644 --- a/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer average variables * needed for MixingPlane computation from a generic zone into another one. * \author S. Vitale - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp b/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp index 3c675b87d6b7..9e4b8fdf8c60 100644 --- a/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another * \author G. Gori Politecnico di Milano - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp index 0db18d0d6cab..0aceee454035 100644 --- a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp +++ b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer temperature and heatflux * density for conjugate heat interfaces between structure and fluid zones. * \author O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp b/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp index b0d419c2264e..7f527ebdb633 100644 --- a/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone in a discrete adjoint simulation. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp b/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp index 4c16621b94e7..f0594f470d21 100644 --- a/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer boundary displacements * from a structural zone into a fluid zone. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp b/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp index b0fcce25defe..d7025943bd52 100644 --- a/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CAdjFluidIteration.hpp b/SU2_CFD/include/iteration/CAdjFluidIteration.hpp index 620dda7bd5b1..88672922358e 100644 --- a/SU2_CFD/include/iteration/CAdjFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CAdjFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp index fdd23c0040e2..3f1697c9ebe9 100644 --- a/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp index b1fa772908bc..c7da838c79ab 100644 --- a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp index 0736fe0a1fc4..933ad64ca651 100644 --- a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CFEAIteration.hpp b/SU2_CFD/include/iteration/CFEAIteration.hpp index aadc86fd22b4..1998b19cfa06 100644 --- a/SU2_CFD/include/iteration/CFEAIteration.hpp +++ b/SU2_CFD/include/iteration/CFEAIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \class CFEAIteration * \brief Class for driving an iteration of structural analysis. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEAIteration : public CIteration { public: diff --git a/SU2_CFD/include/iteration/CFEMFluidIteration.hpp b/SU2_CFD/include/iteration/CFEMFluidIteration.hpp index f89896550cf0..aa147b1b1714 100644 --- a/SU2_CFD/include/iteration/CFEMFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFEMFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \class CFEMFluidIteration * \brief Class for driving an iteration of the finite element flow system. * \author T. Economon, E. van der Weide - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEMFluidIteration : public CFluidIteration { public: diff --git a/SU2_CFD/include/iteration/CFluidIteration.hpp b/SU2_CFD/include/iteration/CFluidIteration.hpp index 9271ef475a16..2e5029d0dd7e 100644 --- a/SU2_CFD/include/iteration/CFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CHeatIteration.hpp b/SU2_CFD/include/iteration/CHeatIteration.hpp index 54b81aae79a8..6490c30c466c 100644 --- a/SU2_CFD/include/iteration/CHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CHeatIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CIteration.hpp b/SU2_CFD/include/iteration/CIteration.hpp index f4691250b97a..7a75eadf213d 100644 --- a/SU2_CFD/include/iteration/CIteration.hpp +++ b/SU2_CFD/include/iteration/CIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CIterationFactory.hpp b/SU2_CFD/include/iteration/CIterationFactory.hpp index e731134fffb3..af39692f5e6d 100644 --- a/SU2_CFD/include/iteration/CIterationFactory.hpp +++ b/SU2_CFD/include/iteration/CIterationFactory.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CTurboIteration.hpp b/SU2_CFD/include/iteration/CTurboIteration.hpp index e93ff07325b2..aab0cd598bfa 100644 --- a/SU2_CFD/include/iteration/CTurboIteration.hpp +++ b/SU2_CFD/include/iteration/CTurboIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index 7c9dbb1fe62d..2b82e80351c4 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -3,7 +3,7 @@ * \brief A class template that allows defining limiters via * specialization of particular details. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/limiters/computeLimiters.hpp b/SU2_CFD/include/limiters/computeLimiters.hpp index 5b0b2bbfc2e1..a54832af6b97 100644 --- a/SU2_CFD/include/limiters/computeLimiters.hpp +++ b/SU2_CFD/include/limiters/computeLimiters.hpp @@ -2,7 +2,7 @@ * \file computeLimiters.hpp * \brief Compute limiters wrapper function. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/limiters/computeLimiters_impl.hpp b/SU2_CFD/include/limiters/computeLimiters_impl.hpp index f15ebe681093..ae43d10e07a3 100644 --- a/SU2_CFD/include/limiters/computeLimiters_impl.hpp +++ b/SU2_CFD/include/limiters/computeLimiters_impl.hpp @@ -4,7 +4,7 @@ * \note Common methods are derived by defining small details * via specialization of CLimiterDetails. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index ef0172750f59..b3e20801e843 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -3,7 +3,7 @@ * \brief Delaration of the base numerics class, the * implementation is in the CNumerics.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp b/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp index 0590231b4e3d..510e755d0837 100644 --- a/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp +++ b/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp @@ -2,7 +2,7 @@ * \file CNEMONumerics.hpp * \brief Base class template NEMO numerics. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp b/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp index f8fc6c01cb86..a44dbe598b6f 100644 --- a/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp +++ b/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp @@ -2,7 +2,7 @@ * \file NEMO_diffusion.hpp * \brief Declarations of numerics classes for viscous flux computation. * \author S.R. Copeland, W. Maier, C. Garbacz. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for computing viscous term using the average of gradients. * \ingroup ViscDiscr * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CAvgGrad_NEMO : public CNEMONumerics { private: @@ -89,7 +89,7 @@ class CAvgGrad_NEMO : public CNEMONumerics { * \brief Class for computing viscous term using the average of gradients. * \ingroup ViscDiscr * \author C. Garbacz, W. Maier, S.R. Copeland. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CAvgGradCorrected_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp b/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp index 7db036298bd4..c94cc1620c75 100644 --- a/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp +++ b/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp @@ -2,7 +2,7 @@ * \file NEMO_sources.hpp * \brief Delarations of numerics classes for source-term integration. * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for two-temperature model source terms. * \ingroup SourceDiscr * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSource_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/NEMO/convection/ausm.hpp b/SU2_CFD/include/numerics/NEMO/convection/ausm.hpp index 4f1e2e1a3feb..3a6c15c2211b 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/ausm.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/ausm.hpp @@ -2,7 +2,7 @@ * \file ausm.hpp * \brief Declaration of numerics classes for the AUSM family of schemes in NEMO. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/ausmplusup2.hpp b/SU2_CFD/include/numerics/NEMO/convection/ausmplusup2.hpp index e2efa3c47461..4ae5a51c5043 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/ausmplusup2.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/ausmplusup2.hpp @@ -2,7 +2,7 @@ * \file ausmplusup2.hpp * \brief Declaration of numerics classes for the AUSM family of schemes in NEMO - AUSM+UP2. * \author W. Maier, A. Sachedeva, C. Garbacz. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/ausmpwplus.hpp b/SU2_CFD/include/numerics/NEMO/convection/ausmpwplus.hpp index 8796f07ae109..e906b912ea35 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/ausmpwplus.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/ausmpwplus.hpp @@ -2,7 +2,7 @@ * \file ausmpwplus.hpp * \brief Declaration of numerics classes for the AUSM family of schemes in NEMO - AUSMPWPLUS. * \author F. Palacios, W.Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/lax.hpp b/SU2_CFD/include/numerics/NEMO/convection/lax.hpp index 7c89fb579b91..8356749a0a33 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/lax.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/lax.hpp @@ -2,7 +2,7 @@ * \file lax.hpp * \brief Declaration of numerics classes for Lax centered scheme. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/msw.hpp b/SU2_CFD/include/numerics/NEMO/convection/msw.hpp index a5c587c1f58f..de280e98038d 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/msw.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/msw.hpp @@ -2,7 +2,7 @@ * \file msw.hpp * \brief Declaration of numerics classes for modified Steger-Warming scheme. * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for solving a flux-vector splitting method by Steger & Warming, modified version. * \ingroup ConvDiscr * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwMSW_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/NEMO/convection/roe.hpp b/SU2_CFD/include/numerics/NEMO/convection/roe.hpp index 89393c25e3fa..306901c570e0 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/roe.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/roe.hpp @@ -2,7 +2,7 @@ * \file roe.hpp * \brief Delarations of numerics classes for Roe-type schemes in NEMO. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for evaluating the Riemann problem using Roe's scheme for a two-temperature model. * \ingroup ConvDiscr * \author S. R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwRoe_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp index 43ec863a17fe..0cad6e0a41b5 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for continuous adjoint * convective discretization. Implemented in adj_convection.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp index 07b566bd69d5..9e3bb4619831 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for continuous adjoint * diffusion discretization. Implemented in adj_diffusion.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp index 4cca49fc667b..c8e7be9b98b4 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for continuous adjoint * source term integration. Implemented in adj_sources.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp index bf3c352dedd6..dd777faea78a 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEAElasticity.hpp * \brief Declaration and inlines of the base class for elasticity problems. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -38,7 +38,7 @@ * document the public interface of this class hierarchy. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEAElasticity : public CNumerics { diff --git a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp index c4c07580c8d0..e896c04258aa 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEALinearElasticity.hpp * \brief Declaration and inlines of the linear elasticity FE numerics class. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Class for computing the stiffness matrix of a linear, elastic problem. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEALinearElasticity : public CFEAElasticity { protected: @@ -90,7 +90,7 @@ class CFEALinearElasticity : public CFEAElasticity { * \brief Particular case of linear elasticity used for mesh deformation. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEAMeshElasticity final : public CFEALinearElasticity { diff --git a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp index 6457b104d9e3..afffa5351b35 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEANonlinearElasticity.hpp * \brief Declaration and inlines of the nonlinear elasticity FE numerics class. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ * Compute_Plane_Stress_Term and Compute_Stress_Tensor. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEANonlinearElasticity : public CFEAElasticity { diff --git a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp index e3fa2b0de109..db14e4c9fa13 100644 --- a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp +++ b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp @@ -2,7 +2,7 @@ * \file nonlinear_models.hpp * \brief Declarations of nonlinear constitutive models. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Class for computing the constitutive and stress tensors for a neo-Hookean material model, compressible. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_NeoHookean_Comp final : public CFEANonlinearElasticity { @@ -83,7 +83,7 @@ class CFEM_NeoHookean_Comp final : public CFEANonlinearElasticity { * \brief Constitutive and stress tensors for a Knowles stored-energy function, nearly incompressible. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_Knowles_NearInc final : public CFEANonlinearElasticity { @@ -134,7 +134,7 @@ class CFEM_Knowles_NearInc final : public CFEANonlinearElasticity { * \brief Class for computing the constitutive and stress tensors for a dielectric elastomer. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_DielectricElastomer final : public CFEANonlinearElasticity { @@ -182,7 +182,7 @@ class CFEM_DielectricElastomer final : public CFEANonlinearElasticity { * \brief Class for computing the constitutive and stress tensors for a nearly-incompressible ideal DE. * \ingroup FEM_Discr * \author R.Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_IdealDE final : public CFEANonlinearElasticity { diff --git a/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp b/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp index 5728634b36d2..e1b6a59f6f78 100644 --- a/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp +++ b/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp @@ -3,7 +3,7 @@ * \brief Declaration of numerics classes for the AUSM family of schemes, * including SLAU. The implementation is in ausm.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/centered.hpp b/SU2_CFD/include/numerics/flow/convection/centered.hpp index 3f808c4aa88b..2b140b168a50 100644 --- a/SU2_CFD/include/numerics/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics/flow/convection/centered.hpp @@ -3,7 +3,7 @@ * \brief Delaration of numerics classes for centered schemes, * the implementation is in centered.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/cusp.hpp b/SU2_CFD/include/numerics/flow/convection/cusp.hpp index 25cc60588764..eed2403cc7fe 100644 --- a/SU2_CFD/include/numerics/flow/convection/cusp.hpp +++ b/SU2_CFD/include/numerics/flow/convection/cusp.hpp @@ -2,7 +2,7 @@ * \file cusp.hpp * \brief Declaration of the CUSP numerics class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/fds.hpp b/SU2_CFD/include/numerics/flow/convection/fds.hpp index 0ac74986d4c1..1cfeed942e18 100644 --- a/SU2_CFD/include/numerics/flow/convection/fds.hpp +++ b/SU2_CFD/include/numerics/flow/convection/fds.hpp @@ -3,7 +3,7 @@ * \brief Declarations of classes for Flux-Difference-Spliting schemes, * the implementations are in fds.cpp * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/fvs.hpp b/SU2_CFD/include/numerics/flow/convection/fvs.hpp index c8f98d6d5f25..da8d27da1527 100644 --- a/SU2_CFD/include/numerics/flow/convection/fvs.hpp +++ b/SU2_CFD/include/numerics/flow/convection/fvs.hpp @@ -3,7 +3,7 @@ * \brief Delarations of classes for Flux-Vector-Spliting schemes, * the implementations are in fvs.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index 6507ef06df44..9f3914851916 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -2,7 +2,7 @@ * \file hllc.hpp * \brief Declaration of HLLC numerics classes, implemented in hllc.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for solving an approximate Riemann HLLC. * \ingroup ConvDiscr * \author G. Gori, Politecnico di Milano - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwHLLC_Flow final : public CNumerics { private: @@ -86,7 +86,7 @@ class CUpwHLLC_Flow final : public CNumerics { * \brief Class for solving an approximate Riemann HLLC. * \ingroup ConvDiscr * \author G. Gori, Politecnico di Milano - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwGeneralHLLC_Flow final : public CNumerics { private: diff --git a/SU2_CFD/include/numerics/flow/convection/roe.hpp b/SU2_CFD/include/numerics/flow/convection/roe.hpp index af53bc18c93c..7de952680d3b 100644 --- a/SU2_CFD/include/numerics/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics/flow/convection/roe.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for Roe-type schemes, * implemented in roe.cpp. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -119,7 +119,7 @@ class CUpwRoe_Flow final : public CUpwRoeBase_Flow { * \brief Class for solving an approximate Riemann solver of L2Roe for the flow equations. * \ingroup ConvDiscr * \author E. Molina, A. Bueno, F. Palacios, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwL2Roe_Flow final : public CUpwRoeBase_Flow { private: @@ -149,7 +149,7 @@ class CUpwL2Roe_Flow final : public CUpwRoeBase_Flow { * \brief Class for solving an approximate Riemann solver of LMRoe for the flow equations. * \ingroup ConvDiscr * \author E. Molina, A. Bueno, F. Palacios, P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwLMRoe_Flow final : public CUpwRoeBase_Flow { private: diff --git a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp index f72677c78e9f..b58a91c7d677 100644 --- a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp +++ b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp @@ -2,7 +2,7 @@ * \file flow_diffusion.hpp * \brief Delarations of numerics classes for viscous flux computation. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 2f5d7275facf..8930af685058 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -2,7 +2,7 @@ * \file flow_sources.hpp * \brief Delarations of numerics classes for source-term integration. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -177,7 +177,7 @@ class CSourceBodyForce final : public CSourceBase_Flow { * \brief Class for the source term integration of a body force in the incompressible solver. * \ingroup SourceDiscr * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSourceIncBodyForce final : public CSourceBase_Flow { su2double Body_Force_Vector[3]; @@ -204,7 +204,7 @@ class CSourceIncBodyForce final : public CSourceBase_Flow { * \brief Class for the source term integration of the Boussinesq approximation for incompressible flow. * \ingroup SourceDiscr * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSourceBoussinesq final : public CSourceBase_Flow { su2double Gravity_Vector[3]; diff --git a/SU2_CFD/include/numerics/heat.hpp b/SU2_CFD/include/numerics/heat.hpp index 4a869c73f0e7..58c91a7fd3d2 100644 --- a/SU2_CFD/include/numerics/heat.hpp +++ b/SU2_CFD/include/numerics/heat.hpp @@ -2,7 +2,7 @@ * \file heat.hpp * \brief Delarations of numerics classes for heat transfer problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for scalar centered scheme. * \ingroup ConvDiscr * \author O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CCentSca_Heat : public CNumerics { @@ -81,7 +81,7 @@ class CCentSca_Heat : public CNumerics { * \brief Class for doing a scalar upwind solver for the heat convection equation. * \ingroup ConvDiscr * \author O. Burghardt. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CUpwSca_Heat : public CNumerics { private: @@ -119,7 +119,7 @@ class CUpwSca_Heat : public CNumerics { * \brief Class for computing viscous term using average of gradients without correction (heat equation). * \ingroup ViscDiscr * \author O. Burghardt. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CAvgGrad_Heat : public CNumerics { private: @@ -160,7 +160,7 @@ class CAvgGrad_Heat : public CNumerics { * \brief Class for computing viscous term using average of gradients with correction (heat equation). * \ingroup ViscDiscr * \author O. Burghardt. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CAvgGradCorrected_Heat : public CNumerics { private: diff --git a/SU2_CFD/include/numerics/radiation.hpp b/SU2_CFD/include/numerics/radiation.hpp index 768ec3a83ebc..dba0db87841f 100644 --- a/SU2_CFD/include/numerics/radiation.hpp +++ b/SU2_CFD/include/numerics/radiation.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the classes used to compute * residual terms in radiation problems. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/template.hpp b/SU2_CFD/include/numerics/template.hpp index b305ce98f003..4dae8622eda8 100644 --- a/SU2_CFD/include/numerics/template.hpp +++ b/SU2_CFD/include/numerics/template.hpp @@ -5,7 +5,7 @@ * new schemes in SU2, in practice you should look for a similar * scheme and try to re-use functionality (not by copy-paste). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/transition.hpp b/SU2_CFD/include/numerics/transition.hpp index 4be38768ee34..ded785a2ad34 100644 --- a/SU2_CFD/include/numerics/transition.hpp +++ b/SU2_CFD/include/numerics/transition.hpp @@ -2,7 +2,7 @@ * \file transition.hpp * \brief Delarations of numerics classes for transition problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp index f50fbaa97649..9abad4d6ad37 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for discretization of * convective fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp index de77c97a6bea..4fdcd62c5e7d 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * viscous fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 55f5ba658425..92960ca41e49 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for integration of source * terms in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -158,7 +158,7 @@ class CSourcePieceWise_TurbSA final : public CSourceBase_TurbSA { * \brief Class for integrating the source terms of the Spalart-Allmaras CC modification turbulence model equation. * \ingroup SourceDiscr * \author E.Molina, A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSourcePieceWise_TurbSA_COMP final : public CSourceBase_TurbSA { private: @@ -193,7 +193,7 @@ class CSourcePieceWise_TurbSA_COMP final : public CSourceBase_TurbSA { * \brief Class for integrating the source terms of the Spalart-Allmaras Edwards modification turbulence model equation. * \ingroup SourceDiscr * \author E.Molina, A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSourcePieceWise_TurbSA_E final : public CSourceBase_TurbSA { private: @@ -226,7 +226,7 @@ class CSourcePieceWise_TurbSA_E final : public CSourceBase_TurbSA { * \brief Class for integrating the source terms of the Spalart-Allmaras Edwards modification with CC turbulence model equation. * \ingroup SourceDiscr * \author E.Molina, A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSourcePieceWise_TurbSA_E_COMP : public CSourceBase_TurbSA { private: diff --git a/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp b/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp index c72222261097..ccc91a7e577d 100644 --- a/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp +++ b/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp @@ -4,7 +4,7 @@ * \note This should be the only cpp for this family of classes * (which are all templates). All compilation takes place here. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp b/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp index 893b648f7508..7dbbdb9efa1f 100644 --- a/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp +++ b/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp @@ -2,7 +2,7 @@ * \file CNumericsSIMD.hpp * \brief Vectorized (SIMD) numerics classes. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp index ca0a708256ca..d1180b04466e 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp @@ -2,7 +2,7 @@ * \file centered.hpp * \brief Centered convective schemes. * \author P. Gomes, F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index a1160191d9c4..d05549085bde 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -2,7 +2,7 @@ * \file common.hpp * \brief Common convection-related methods. * \author P. Gomes, F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp index bd875f618ea0..3477ea0f7644 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp @@ -2,7 +2,7 @@ * \file roe.hpp * \brief Roe-family of convective schemes. * \author P. Gomes, A. Bueno, F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index a519cf28f94a..c6a212c4c6ec 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -2,7 +2,7 @@ * \file common.hpp * \brief Helper functions for viscous methods. * \author P. Gomes, C. Pederson, A. Bueno, F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 69801eaae387..020ce7e05ed7 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -2,7 +2,7 @@ * \file viscous_fluxes.hpp * \brief Decorator classes for computation of viscous fluxes. * \author P. Gomes, C. Pederson, A. Bueno, F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/variables.hpp b/SU2_CFD/include/numerics_simd/flow/variables.hpp index ab270a51c2a5..27dd6b7b3ec9 100644 --- a/SU2_CFD/include/numerics_simd/flow/variables.hpp +++ b/SU2_CFD/include/numerics_simd/flow/variables.hpp @@ -2,7 +2,7 @@ * \file variables.hpp * \brief Collection of types to store physical variables. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/util.hpp b/SU2_CFD/include/numerics_simd/util.hpp index 3bc993b5929c..785bf894d51e 100644 --- a/SU2_CFD/include/numerics_simd/util.hpp +++ b/SU2_CFD/include/numerics_simd/util.hpp @@ -2,7 +2,7 @@ * \file util.hpp * \brief Generic auxiliary functions. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjElasticityOutput.hpp b/SU2_CFD/include/output/CAdjElasticityOutput.hpp index 4da75e2a0af9..382da9ee2668 100644 --- a/SU2_CFD/include/output/CAdjElasticityOutput.hpp +++ b/SU2_CFD/include/output/CAdjElasticityOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjElasticityOutput.hpp * \brief Headers of the adjoint elasticity output class. * \author T. Albring, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp index 9f523c0e9818..78fb48a1fdfe 100644 --- a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjFlowIncOutput.hpp * \brief Headers of the adjoint incompressible flow output. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjFlowOutput.hpp b/SU2_CFD/include/output/CAdjFlowOutput.hpp index 56c054ecb1d6..6d3e6ccb85a6 100644 --- a/SU2_CFD/include/output/CAdjFlowOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjFlowCompOutput.hpp * \brief Headers of the adjoint compressible flow output. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjHeatOutput.hpp b/SU2_CFD/include/output/CAdjHeatOutput.hpp index 4da091712c96..1398fd96e556 100644 --- a/SU2_CFD/include/output/CAdjHeatOutput.hpp +++ b/SU2_CFD/include/output/CAdjHeatOutput.hpp @@ -2,7 +2,7 @@ * \file output_fea_discadj.hpp * \brief Headers of the adjoint heat output. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CBaselineOutput.hpp b/SU2_CFD/include/output/CBaselineOutput.hpp index fd0f17b92d46..c2e22dadc0f9 100644 --- a/SU2_CFD/include/output/CBaselineOutput.hpp +++ b/SU2_CFD/include/output/CBaselineOutput.hpp @@ -2,7 +2,7 @@ * \file CBaselineOutput.hpp * \brief Headers of the baseline output. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CElasticityOutput.hpp b/SU2_CFD/include/output/CElasticityOutput.hpp index a8c5ea9a046a..60049187133e 100644 --- a/SU2_CFD/include/output/CElasticityOutput.hpp +++ b/SU2_CFD/include/output/CElasticityOutput.hpp @@ -2,7 +2,7 @@ * \file CElasticityOutput.hpp * \brief Headers of the elasticity output. * \author F. Palacios, T. Economon, M. Colonno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp index ec5c5fbd67e0..d097f9190e12 100644 --- a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowCompFEMOutput.hpp * \brief Headers of the compressible FEM flow output. * \author R. Sanchez, T. Albring. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CFlowCompOutput.hpp b/SU2_CFD/include/output/CFlowCompOutput.hpp index 9ce0535959dd..d7370cde9627 100644 --- a/SU2_CFD/include/output/CFlowCompOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowCompOutput.hpp * \brief Headers of the compressible flow output. * \author R. Sanchez, T. Albring. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 59896cb0eea0..7627b1ee7bc4 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowIncCompOutput.hpp * \brief Headers of the incompressible flow output. * \author T. Albring, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CFlowOutput.hpp b/SU2_CFD/include/output/CFlowOutput.hpp index 01ba58bd2ae3..3571d3e8032e 100644 --- a/SU2_CFD/include/output/CFlowOutput.hpp +++ b/SU2_CFD/include/output/CFlowOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowOutput.hpp * \brief Headers of the flow output. * \author F. Palacios, T. Economon, M. Colonno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CHeatOutput.hpp b/SU2_CFD/include/output/CHeatOutput.hpp index 69ac423ccc71..616562e736eb 100644 --- a/SU2_CFD/include/output/CHeatOutput.hpp +++ b/SU2_CFD/include/output/CHeatOutput.hpp @@ -2,7 +2,7 @@ * \file CHeatOutput.hpp * \brief Headers of the heat output. * \author R. Sanchez, T. Albring. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CMeshOutput.hpp b/SU2_CFD/include/output/CMeshOutput.hpp index 68e0b37ffaa2..39d071c41d47 100644 --- a/SU2_CFD/include/output/CMeshOutput.hpp +++ b/SU2_CFD/include/output/CMeshOutput.hpp @@ -2,7 +2,7 @@ * \file CMeshOutput.hpp * \brief Headers of the mesh output. * \author R. Sanchez, T. Albring. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CMultizoneOutput.hpp b/SU2_CFD/include/output/CMultizoneOutput.hpp index 380660081867..65c088e576a9 100644 --- a/SU2_CFD/include/output/CMultizoneOutput.hpp +++ b/SU2_CFD/include/output/CMultizoneOutput.hpp @@ -2,7 +2,7 @@ * \file CDriverOutput.hpp * \brief Headers of the main subroutines for screen and history output in multizone problems. * \author R. Sanchez, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CNEMOCompOutput.hpp b/SU2_CFD/include/output/CNEMOCompOutput.hpp index 47a43ea9c4c4..1458757833a6 100644 --- a/SU2_CFD/include/output/CNEMOCompOutput.hpp +++ b/SU2_CFD/include/output/CNEMOCompOutput.hpp @@ -2,7 +2,7 @@ * \file CNEMOCompOutput.hpp * \brief Headers of the compressible flow output. * \author R. Sanchez, W. Maier. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 7f9f3161a800..88358c8726ec 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -2,7 +2,7 @@ * \file COutput.hpp * \brief Headers of the output class. * \author T.Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/COutputFactory.hpp b/SU2_CFD/include/output/COutputFactory.hpp index 75a435b7f5b2..ece08e8d8df9 100644 --- a/SU2_CFD/include/output/COutputFactory.hpp +++ b/SU2_CFD/include/output/COutputFactory.hpp @@ -2,7 +2,7 @@ * \file COutput.hpp * \brief Headers of the output class. * \author T.Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/COutputLegacy.hpp b/SU2_CFD/include/output/COutputLegacy.hpp index 17935f935ef5..48d1a7367d47 100644 --- a/SU2_CFD/include/output/COutputLegacy.hpp +++ b/SU2_CFD/include/output/COutputLegacy.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for generating the file outputs. * The subroutines and functions are in the output_structure.cpp file. * \author F. Palacios, T. Economon, M. Colonno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp index 7e3955a9aed9..64eda923292e 100644 --- a/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp @@ -2,7 +2,7 @@ * \file CCSVFileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp index 78450d3b5ef1..8a241f5c6f36 100644 --- a/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CFEMDataSorter.hpp * \brief Headers fo the FEM data sorter class. * \author T. Albring, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp index f0facc901307..791701a8210f 100644 --- a/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CFVMDataSorter.hpp * \brief Headers fo the FVM data sorter class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CFileWriter.hpp b/SU2_CFD/include/output/filewriter/CFileWriter.hpp index 542a0b2b285b..5734841ffecc 100644 --- a/SU2_CFD/include/output/filewriter/CFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CFileWriter.hpp @@ -2,7 +2,7 @@ * \file CFileWriter.hpp * \brief Headers fo the file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp index 1cfc9f7a83e8..5b35820c5c77 100644 --- a/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp @@ -2,7 +2,7 @@ * \file CParallelDataSorter.hpp * \brief Headers fo the data sorter class. * \author T. Albring, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp index fe46ac6eab70..d25f8641481b 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewBinaryFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp index 3bdf3db11b55..bfe1bd69a978 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewFileWriter.hpp * \brief Headers fo the paraview file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp index 9a1408fa88b4..c37cc7558b63 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewVTMFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp index bc91a53bf19e..25890ed10955 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewXMLFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp index 868e3d3bec74..94438058cb8b 100644 --- a/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSTLFileWriter.hpp * \brief Headers fo the STL file writer class. * \author T. Kattmann, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CSTLFileWriter * \brief Class for writing STL output files. * \author T. Kattmann, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSTLFileWriter final : public CFileWriter{ private: diff --git a/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp index 2b2d3cd1cb12..ec9bed7a15d9 100644 --- a/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2BinaryFileWriter.hpp * \brief Headers fo the SU2 binary file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp index c33f3a719618..0b5252b6035a 100644 --- a/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2FileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp index 05e35420a6e2..5f35f4226058 100644 --- a/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2MeshFileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp index be26c5157284..4c0f4bf722e5 100644 --- a/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CSurfaceFEMDataSorter.hpp * \brief Headers fo the surface FEM data sorter class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp index 79e59827bfac..3eafd7a2cc00 100644 --- a/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CSurfaceFVMDataSorter.hpp * \brief Headers for the surface FVM data sorter class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp index 1cf0690e6f44..5b6b1d0ada3a 100644 --- a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CTecplotBinaryFileWriter.hpp * \brief Headers fo the tecplot binary writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp index c69d1a748dd9..20d48810f593 100644 --- a/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp @@ -2,7 +2,7 @@ * \file CTecplotFileWriter.hpp * \brief Headers fo the tecplot ASCII writer class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/tools/CWindowingTools.hpp b/SU2_CFD/include/output/tools/CWindowingTools.hpp index 6a86139cee5a..f5d0649b0312 100644 --- a/SU2_CFD/include/output/tools/CWindowingTools.hpp +++ b/SU2_CFD/include/output/tools/CWindowingTools.hpp @@ -2,7 +2,7 @@ * \file signal_processing_toolbox.hpp * \brief Header file for the signal processing toolbox. * \author S. Schotthöfer - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/sgs_model.hpp b/SU2_CFD/include/sgs_model.hpp index 6f6be007616a..280888428014 100644 --- a/SU2_CFD/include/sgs_model.hpp +++ b/SU2_CFD/include/sgs_model.hpp @@ -2,7 +2,7 @@ * \file sgs_model.hpp * \brief Headers of the LES subgrid scale models of the SU2 solvers. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -38,7 +38,7 @@ using namespace std; * \class CSGSModel * \brief Base class for defining the LES subgrid scale model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSGSModel { @@ -224,7 +224,7 @@ class CSGSModel { * \class CSmagorinskyModel * \brief Derived class for defining the Smagorinsky SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CSmagorinskyModel : public CSGSModel { @@ -413,7 +413,7 @@ class CSmagorinskyModel : public CSGSModel { * \class CWALEModel * \brief Derived class for defining the WALE SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CWALEModel : public CSGSModel { @@ -601,7 +601,7 @@ class CWALEModel : public CSGSModel { * \class CVremanModel * \brief Derived class for defining the WALE SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk, E. Molina - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CVremanModel : public CSGSModel { diff --git a/SU2_CFD/include/sgs_model.inl b/SU2_CFD/include/sgs_model.inl index fbd2a27ced8b..74023039c06b 100644 --- a/SU2_CFD/include/sgs_model.inl +++ b/SU2_CFD/include/sgs_model.inl @@ -2,7 +2,7 @@ * \file sgs_model.inl * \brief In-Line subroutines of the sgs_model.hpp file. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp index 71ec9e79e0e8..c87b3af17715 100644 --- a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjEulerSolver.hpp * \brief Headers of the CAdjEulerSolver class * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjNSSolver.hpp b/SU2_CFD/include/solvers/CAdjNSSolver.hpp index 259886e6ade8..98adceed6770 100644 --- a/SU2_CFD/include/solvers/CAdjNSSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjNSSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjNSSolver.hpp * \brief Headers of the CAdjNSSolver class * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjTurbSolver.hpp b/SU2_CFD/include/solvers/CAdjTurbSolver.hpp index 021f2ae36062..459d5039e1ad 100644 --- a/SU2_CFD/include/solvers/CAdjTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjTurbSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjTurbSolver.hpp * \brief Headers of the CAdjTurbSolver class * \author F. Palacios, A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CBaselineSolver.hpp b/SU2_CFD/include/solvers/CBaselineSolver.hpp index 69aeb6665fc5..29fdec3c5b54 100644 --- a/SU2_CFD/include/solvers/CBaselineSolver.hpp +++ b/SU2_CFD/include/solvers/CBaselineSolver.hpp @@ -2,7 +2,7 @@ * \file CBaslineSolver.hpp * \brief Headers of the CBaselineSolver class * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp b/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp index 12c2f848ddb9..38ef3b20bdb8 100644 --- a/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp +++ b/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp @@ -2,7 +2,7 @@ * \file CBaslineSolver_FEM.hpp * \brief Headers of the CBaselineSolver class * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ * \class CBaselineSolver_FEM * \brief Main class for defining a baseline solution from a restart file for the DG-FEM solver output. * \author T. Economon. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CBaselineSolver_FEM final : public CSolver { protected: diff --git a/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp b/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp index 6824d0bc6040..8777a720b1f1 100644 --- a/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEASolver.hpp * \brief Headers of the CDiscAdjFEASolver class * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp index d5e5882cf500..cc557b4af93a 100644 --- a/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to compute the * the discrete adjoint of the linear-elastic mesh solver. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp index f561cbae26a5..c5b5dcd41382 100644 --- a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjSolver.hpp * \brief Headers of the CDiscAdjSolver class * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 890bec177e03..8780d54b52c1 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CEulerSolver.hpp * \brief Headers of the CEulerSolver class * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index 2e3cee9e5e09..927be283cbd6 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -2,7 +2,7 @@ * \file CFEASolver.hpp * \brief Finite element solver for elasticity problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp index 0ce24a053d09..74f22ab79506 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_EulerSolver.hpp * \brief Headers of the CFEM_DG_EulerSolver class * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Main class for defining the Euler Discontinuous Galerkin finite element flow solver. * \ingroup Euler_Equations * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_DG_EulerSolver : public CSolver { protected: diff --git a/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp index 65d8f336a01a..31e44bf29c53 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_NSSolver.hpp * \brief Headers of the CFEM_DG_NSSolver class * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Main class for defining the Navier-Stokes Discontinuous Galerkin finite element flow solver. * \ingroup Navier_Stokes_Equations * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEM_DG_NSSolver final : public CFEM_DG_EulerSolver { private: diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index e1673fb1fedc..acb1135c426e 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -1,7 +1,7 @@ /*! * \file CFVMFlowSolverBase.hpp * \brief Base class template for all FVM flow solvers. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 598d38ff636c..5cc958538614 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1,7 +1,7 @@ /*! * \file CFVMFlowSolverBase.inl * \brief Base class template for all FVM flow solvers. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index d09d1c3eaefa..95b3a063b23d 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -2,7 +2,7 @@ * \file CHeatSolver.hpp * \brief Headers of the CHeatSolver class * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \class CHeatSolver * \brief Main class for defining the finite-volume heat solver. * \author O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CHeatSolver final : public CSolver { protected: diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 796d409d4381..b7e650d60876 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CIncEulerSolver.hpp * \brief Headers of the CIncEulerSolver class * \author F. Palacios, T. Economon, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 04f8d4286e11..5b2ce7a5ceb7 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -2,7 +2,7 @@ * \file CIncNSSolver.hpp * \brief Headers of the CIncNSSolver class * \author F. Palacios, T. Economon, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CMeshSolver.hpp b/SU2_CFD/include/solvers/CMeshSolver.hpp index 55c14d7aa6f0..aed8b77f91dc 100644 --- a/SU2_CFD/include/solvers/CMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CMeshSolver.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to compute the deformation of * the volumetric numerical grid using the linear elasticity solver. * \author Ruben Sanchez, based on CVolumetricMovement developments (F. Palacios, A. Bueno, T. Economon, S. Padron) - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index 195a218631f9..09bb9216b92c 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CNEMOEulerSolver.hpp * \brief Headers of the CNEMOEulerSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -36,7 +36,7 @@ * \brief Main class for defining the NEMO Euler's flow solver. * \ingroup Euler_Equations * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CNEMOEulerSolver : public CFVMFlowSolverBase { protected: diff --git a/SU2_CFD/include/solvers/CNEMONSSolver.hpp b/SU2_CFD/include/solvers/CNEMONSSolver.hpp index 7e9acf02f546..0c3ea0c11550 100644 --- a/SU2_CFD/include/solvers/CNEMONSSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMONSSolver.hpp @@ -2,7 +2,7 @@ * \file CNEMONSSolver.hpp * \brief Headers of the CNEMONSSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CNSSolver.hpp b/SU2_CFD/include/solvers/CNSSolver.hpp index 99260e34f2c1..519c82db16e1 100644 --- a/SU2_CFD/include/solvers/CNSSolver.hpp +++ b/SU2_CFD/include/solvers/CNSSolver.hpp @@ -2,7 +2,7 @@ * \file CNSSolver.hpp * \brief Headers of the CNSSolver class * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CRadP1Solver.hpp b/SU2_CFD/include/solvers/CRadP1Solver.hpp index 88b34da2c5f7..1c2e144a6ea1 100644 --- a/SU2_CFD/include/solvers/CRadP1Solver.hpp +++ b/SU2_CFD/include/solvers/CRadP1Solver.hpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.hpp * \brief Declaration and inlines of the class to compute a P1 radiation problem. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CRadSolver.hpp b/SU2_CFD/include/solvers/CRadSolver.hpp index 70f148da5d90..b3ab378c5291 100644 --- a/SU2_CFD/include/solvers/CRadSolver.hpp +++ b/SU2_CFD/include/solvers/CRadSolver.hpp @@ -2,7 +2,7 @@ * \file CRadSolver.hpp * \brief Declaration and inlines of the class to compute a generic radiation solver. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 42af3d4ad5c3..48e929d665cb 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CSolver class which is inherited by all of the other * solvers * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTemplateSolver.hpp b/SU2_CFD/include/solvers/CTemplateSolver.hpp index db6c7601f7ec..395564f5201a 100644 --- a/SU2_CFD/include/solvers/CTemplateSolver.hpp +++ b/SU2_CFD/include/solvers/CTemplateSolver.hpp @@ -2,7 +2,7 @@ * \file CTemplateSolver.hpp * \brief Headers of the CTemplateSolver class * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTransLMSolver.hpp b/SU2_CFD/include/solvers/CTransLMSolver.hpp index f60250a0b56f..d6120fc028d4 100644 --- a/SU2_CFD/include/solvers/CTransLMSolver.hpp +++ b/SU2_CFD/include/solvers/CTransLMSolver.hpp @@ -2,7 +2,7 @@ * \file CTransLMSolver.hpp * \brief Headers of the CTransLMSolver class * \author A. Aranake - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSASolver.hpp b/SU2_CFD/include/solvers/CTurbSASolver.hpp index ef75485c7ccc..320cc5557153 100644 --- a/SU2_CFD/include/solvers/CTurbSASolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSASolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSASolver.hpp * \brief Headers of the CTurbSASolver class * \author A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 6a5813be462d..7d38a8050aa3 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSSTSolver.hpp * \brief Headers of the CTurbSSTSolver class * \author A. Campos, F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSolver.hpp b/SU2_CFD/include/solvers/CTurbSolver.hpp index 8abd303ceb5a..31882562bcd3 100644 --- a/SU2_CFD/include/solvers/CTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSolver.hpp * \brief Headers of the CTurbSolver class * \author A. Bueno. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/task_definition.hpp b/SU2_CFD/include/task_definition.hpp index ef6318e051b8..fa6aef1f99de 100644 --- a/SU2_CFD/include/task_definition.hpp +++ b/SU2_CFD/include/task_definition.hpp @@ -2,7 +2,7 @@ * \file task_definition.hpp * \brief Header of the task definition class for the SU2 solvers. * \author E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ using namespace std; * \class CTaskDefinition * \brief Class for defining a task to be carried out * \author: E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CTaskDefinition { diff --git a/SU2_CFD/include/task_definition.inl b/SU2_CFD/include/task_definition.inl index 2d95de81dc16..8482ab72a0bb 100644 --- a/SU2_CFD/include/task_definition.inl +++ b/SU2_CFD/include/task_definition.inl @@ -2,7 +2,7 @@ * \file task_definition.inl * \brief In-Line subroutines of the task_definition.hpp file. * \author E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjEulerVariable.hpp b/SU2_CFD/include/variables/CAdjEulerVariable.hpp index 60b47dba6101..448f9763e021 100644 --- a/SU2_CFD/include/variables/CAdjEulerVariable.hpp +++ b/SU2_CFD/include/variables/CAdjEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjEulerVariable.hpp * \brief Main class for defining the variables of the adjoint Euler solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjNSVariable.hpp b/SU2_CFD/include/variables/CAdjNSVariable.hpp index 83f2c9807f75..cb16c06e5163 100644 --- a/SU2_CFD/include/variables/CAdjNSVariable.hpp +++ b/SU2_CFD/include/variables/CAdjNSVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjNSVariable.hpp * \brief Main class for defining the variables of the adjoint Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjTurbVariable.hpp b/SU2_CFD/include/variables/CAdjTurbVariable.hpp index 19a5cc6a6894..0c0cf142add7 100644 --- a/SU2_CFD/include/variables/CAdjTurbVariable.hpp +++ b/SU2_CFD/include/variables/CAdjTurbVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.hpp * \brief Main class for defining the variables of the adjoint turbulence model. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CBaselineVariable.hpp b/SU2_CFD/include/variables/CBaselineVariable.hpp index be8a1be63480..5cd095e76353 100644 --- a/SU2_CFD/include/variables/CBaselineVariable.hpp +++ b/SU2_CFD/include/variables/CBaselineVariable.hpp @@ -2,7 +2,7 @@ * \file CBaselineVariable.hpp * \brief Main class for defining the variables of a baseline solution from a restart file (for output). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp b/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp index 64226c00dac6..b8d4973cd51f 100644 --- a/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEABoundVariable.hpp * \brief Main class for defining the variables of the adjoint FEA solver at the boundary. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Main class for defining the variables on the FEA boundaries for adjoint applications. * \ingroup Discrete_Adjoint * \author R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CDiscAdjFEABoundVariable final : public CDiscAdjFEAVariable { private: diff --git a/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp b/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp index 0d3d0ef806ad..94dd8162c8d7 100644 --- a/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAVariable.hpp * \brief Main class for defining the variables of the adjoint FEA solver. * \author T. Albring, R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Main class for defining the variables of the adjoint solver. * \ingroup Discrete_Adjoint * \author T. Albring, R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CDiscAdjFEAVariable : public CVariable { protected: diff --git a/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp b/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp index d6cc480306f7..f994925578ea 100644 --- a/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the adjoint variables of the mesh movement. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CDiscAdjVariable.hpp b/SU2_CFD/include/variables/CDiscAdjVariable.hpp index b4f5b332316e..ed043787fccc 100644 --- a/SU2_CFD/include/variables/CDiscAdjVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjVariable.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjVariable.hpp * \brief Main class for defining the variables of the adjoint solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index 24e5a0d2410d..3f7a02735d46 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CEulerVariable.hpp * \brief Class for defining the variables of the compressible Euler solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CFEABoundVariable.hpp b/SU2_CFD/include/variables/CFEABoundVariable.hpp index 37109f9867d6..ee229b32e669 100644 --- a/SU2_CFD/include/variables/CFEABoundVariable.hpp +++ b/SU2_CFD/include/variables/CFEABoundVariable.hpp @@ -2,7 +2,7 @@ * \file CFEABoundVariable.hpp * \brief Class for defining the variables on the FEA boundaries for FSI applications. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ * A map is constructed so that variables can be referenced by iPoint instead of iVertex. * \ingroup Structural Finite Element Analysis Variables * \author R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEABoundVariable final : public CFEAVariable { protected: diff --git a/SU2_CFD/include/variables/CFEAVariable.hpp b/SU2_CFD/include/variables/CFEAVariable.hpp index 9c2153432cea..dbaa82b30545 100644 --- a/SU2_CFD/include/variables/CFEAVariable.hpp +++ b/SU2_CFD/include/variables/CFEAVariable.hpp @@ -2,7 +2,7 @@ * \file CFEAVariable.hpp * \brief Class for defining the variables of the FEM structural problem. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for defining the variables of the FEM structural problem. * \ingroup Structural Finite Element Analysis Variables * \author F. Palacios, R. Sanchez. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CFEAVariable : public CVariable { protected: diff --git a/SU2_CFD/include/variables/CHeatVariable.hpp b/SU2_CFD/include/variables/CHeatVariable.hpp index a69a05c57baa..92474870a6b6 100644 --- a/SU2_CFD/include/variables/CHeatVariable.hpp +++ b/SU2_CFD/include/variables/CHeatVariable.hpp @@ -2,7 +2,7 @@ * \file CHeatVariable.hpp * \brief Class for defining the variables of the finite-volume heat equation solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CHeatVariable * \brief Class for defining the variables of the finite-volume heat equation solver. * \author O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" */ class CHeatVariable final : public CVariable { protected: diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index abb9d43e3129..c736555483d3 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CIncEulerVariable.hpp * \brief Class for defining the variables of the incompressible Euler solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CIncNSVariable.hpp b/SU2_CFD/include/variables/CIncNSVariable.hpp index e4e3c735e85a..37d376babdff 100644 --- a/SU2_CFD/include/variables/CIncNSVariable.hpp +++ b/SU2_CFD/include/variables/CIncNSVariable.hpp @@ -3,7 +3,7 @@ * \brief Class for defining the variables of the incompressible Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshBoundVariable.hpp b/SU2_CFD/include/variables/CMeshBoundVariable.hpp index 43ef5eba4b44..2300bf4c1f94 100644 --- a/SU2_CFD/include/variables/CMeshBoundVariable.hpp +++ b/SU2_CFD/include/variables/CMeshBoundVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement at the moving boundaries. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshElement.hpp b/SU2_CFD/include/variables/CMeshElement.hpp index 790c26a2c9cb..4ed2e4906f53 100644 --- a/SU2_CFD/include/variables/CMeshElement.hpp +++ b/SU2_CFD/include/variables/CMeshElement.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshVariable.hpp b/SU2_CFD/include/variables/CMeshVariable.hpp index 71f68f6e6ff1..d242ba161dca 100644 --- a/SU2_CFD/include/variables/CMeshVariable.hpp +++ b/SU2_CFD/include/variables/CMeshVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index b68e94984000..2d8596f94f35 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -1,589 +1,589 @@ -/*! - * \file CNEMOEulerVariable.hpp - * \brief Class for defining the variables of the compressible NEMO Euler solver. - * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.1.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -#include "CVariable.hpp" -#include "../fluid/CNEMOGas.hpp" - -/*! - * \class CNEMOEulerVariable - * \brief Main class for defining the variables of the NEMO Euler's solver. - * \ingroup Euler_Equations - * \author S. R. Copeland, F. Palacios, W. Maier, C. Garbacz - * \version 7.0.8 - */ -class CNEMOEulerVariable : public CVariable { -public: - static constexpr size_t MAXNVAR = 25; - -protected: - - bool ionization; /*!< \brief Presence of charged species in gas mixture. */ - bool monoatomic = false; /*!< \brief Presence of single species gas. */ - - VectorType Velocity2; /*!< \brief Square of the velocity vector. */ - MatrixType Precond_Beta; /*!< \brief Low Mach number preconditioner value, Beta. */ - - CVectorOfMatrix& Gradient_Reconstruction; /*!< \brief Reference to the gradient of the conservative variables for MUSCL reconstruction for the convective term */ - CVectorOfMatrix Gradient_Aux; /*!< \brief Auxiliary structure to store a second gradient for reconstruction, if required. */ - - /*--- Primitive variable definition ---*/ - MatrixType Primitive; /*!< \brief Primitive variables (rhos_s, T, Tve, ...) in compressible flows. */ - MatrixType Primitive_Aux; /*!< \brief Primitive auxiliary variables (Y_s, T, Tve, ...) in compressible flows. */ - CVectorOfMatrix Gradient_Primitive; /*!< \brief Gradient of the primitive variables (rhos_s, T, Tve, ...). */ - MatrixType Limiter_Primitive; /*!< \brief Limiter of the primitive variables (rhos_s, T, Tve, ...). */ - - /*--- Secondary variable definition ---*/ - MatrixType Secondary; /*!< \brief Primitive variables (T, vx, vy, vz, P, rho, h, c) in compressible flows. */ - CVectorOfMatrix Gradient_Secondary; /*!< \brief Gradient of the primitive variables (T, vx, vy, vz, P, rho). */ - - /*--- New solution container for Classical RK4 ---*/ - MatrixType Solution_New; /*!< \brief New solution container for Classical RK4. */ - - /*--- Other Necessary Variable Definition ---*/ - MatrixType dPdU; /*!< \brief Partial derivative of pressure w.r.t. conserved variables. */ - MatrixType dTdU; /*!< \brief Partial derivative of temperature w.r.t. conserved variables. */ - MatrixType dTvedU; /*!< \brief Partial derivative of vib.-el. temperature w.r.t. conserved variables. */ - MatrixType eves; /*!< \brief energy of vib-el mode w.r.t. species. */ - MatrixType Cvves; /*!< \brief Specific heat of vib-el mode w.r.t. species. */ - VectorType Gamma; /*!< \brief Ratio of specific heats. */ - - CNEMOGas *fluidmodel; - - /*!< \brief Index definition for NEMO pritimive variables. */ - unsigned long RHOS_INDEX, T_INDEX, TVE_INDEX, VEL_INDEX, P_INDEX, - RHO_INDEX, H_INDEX, A_INDEX, RHOCVTR_INDEX, RHOCVVE_INDEX, - LAM_VISC_INDEX, EDDY_VISC_INDEX, nSpecies; - - su2double Tve_Freestream; /*!< \brief Freestream vib-el temperature. */ - -public: - - /*! - * \brief Constructor of the class. - * \param[in] val_pressure - Value of the flow pressure (initialization value). - * \param[in] val_massfrac - Value of the mass fraction (initialization value). - * \param[in] val_mach - Value of the Mach number (initialization value). - * \param[in] val_temperature - Value of the flow temperature (initialization value). - * \param[in] val_temperature_ve - Value of the flow temperature_ve (initialization value). - * \param[in] npoint - Number of points/nodes/vertices in the domain. - * \param[in] val_nDim - Number of dimensions of the problem. - * \param[in] val_nVar - Number of conserved variables. - * \param[in] val_nVarPrim - Number of primitive variables. - * \param[in] val_nVarPrimGrad - Number of primitive gradient variables. - * \param[in] config - Definition of the particular problem. - */ - CNEMOEulerVariable(su2double val_pressure, const su2double *val_massfrac, - su2double *val_mach, su2double val_temperature, - su2double val_temperature_ve, unsigned long npoint, - unsigned long ndim, - unsigned long nvar, unsigned long nvalprim, - unsigned long nvarprimgrad, CConfig *config, CNEMOGas *fluidmodel); - - /*! - * \brief Destructor of the class. - */ - ~CNEMOEulerVariable() override = default; - - /*---------------------------------------*/ - /*--- U,V,S Routines ---*/ - /*---------------------------------------*/ - - /*! - * \brief Get the new solution of the problem (Classical RK4). - * \param[in] iVar - Index of the variable. - * \return Pointer to the old solution vector. - */ - inline su2double GetSolution_New(unsigned long iPoint, unsigned long iVar) const final { return Solution_New(iPoint,iVar); } - - /*! - * \brief Set the new solution container for Classical RK4. - */ - void SetSolution_New() final; - - /*! - * \brief Add a value to the new solution container for Classical RK4. - * \param[in] iVar - Number of the variable. - * \param[in] val_solution - Value that we want to add to the solution. - */ - inline void AddSolution_New(unsigned long iPoint, unsigned long iVar, su2double val_solution) final { - Solution_New(iPoint,iVar) += val_solution; - } - - /*! - * \brief Set the value of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iVar - Index of the variable. - * \return Set the value of the primitive variable for the index iVar. - */ - inline void SetPrimitive(unsigned long iPoint, unsigned long iVar, su2double val_prim) final { Primitive(iPoint,iVar) = val_prim; } - - /*! - * \brief Set the value of the primitive variables. - * \param[in] val_prim - Primitive variables. - * \return Set the value of the primitive variable for the index iVar. - */ - inline void SetPrimitive(unsigned long iPoint, const su2double *val_prim) final { - for (unsigned long iVar = 0; iVar < nPrimVar; iVar++) - Primitive(iPoint,iVar) = val_prim[iVar]; - } - - /*! - * \brief Get the primitive variables limiter. - * \return Primitive variables limiter for the entire domain. - */ - inline MatrixType& GetLimiter_Primitive(void) {return Limiter_Primitive; } - - /*! - * \brief Set the gradient of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value of the gradient. - */ - inline su2double GetLimiter_Primitive(unsigned long iPoint, unsigned long iVar) const final {return Limiter_Primitive(iPoint,iVar); } - - /*! - * \brief Get the value of the primitive variables gradient. - * \return Value of the primitive variables gradient. - */ - inline su2double *GetLimiter_Primitive(unsigned long iPoint) final { return Limiter_Primitive[iPoint]; } - - /*! - * \brief Set the gradient of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] value - Value of the gradient. - */ - inline void SetLimiter_Primitive(unsigned long iPoint, unsigned long iVar, su2double value) final { - Limiter_Primitive(iPoint,iVar) = value; - } - - /*! - * \brief Set the value of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iVar - Index of the variable. - * \return Set the value of the primitive variable for the index iVar. - */ - inline void SetSecondary(unsigned long iPoint, unsigned long iVar, su2double val_secondary) final {Secondary(iPoint,iVar) = val_secondary; } - - /*! - * \brief Set the value of the primitive variables. - * \param[in] val_prim - Primitive variables. - * \return Set the value of the primitive variable for the index iVar. - */ - inline void SetSecondary(unsigned long iPoint, const su2double *val_secondary) final { - for (unsigned long iVar = 0; iVar < nSecondaryVar; iVar++) - Secondary(iPoint,iVar) = val_secondary[iVar]; - } - - /*! - * \brief Set the value of the primitive auxiliary variables - with mass fractions. - * \param[in] iVar - Index of the variable. - * \param[in] iVar - Index of the variable. - * \return Set the value of the primitive variable for the index iVar. - */ - inline void SetPrimitive_Aux(unsigned long iPoint, unsigned long iVar, su2double val_prim) { Primitive_Aux(iPoint,iVar) = val_prim; } - - - /*! - * \brief Get the primitive variables. - * \param[in] iVar - Index of the variable. - * \return Value of the primitive variable for the index iVar. - */ - inline su2double GetPrimitive(unsigned long iPoint, unsigned long iVar) const final { return Primitive(iPoint,iVar); } - - /*! - * \brief Get the primitive variables of the problem. - * \return Pointer to the primitive variable vector. - */ - inline su2double *GetPrimitive(unsigned long iPoint) final {return Primitive[iPoint]; } - - /*! - * \brief Get the primitive variables for all points. - * \return Reference to primitives. - */ - inline const MatrixType& GetPrimitive(void) const { return Primitive; } - - /*! - * \brief Get the primitive variables for all points. - * \return Reference to primitives. - */ - inline const MatrixType& GetPrimitive_Aux(void) const { return Primitive_Aux; } - - - /*! - * \brief Get the primitive variables. - * \param[in] iVar - Index of the variable. - * \return Value of the primitive variable for the index iVar. - */ - inline su2double GetSecondary(unsigned long iPoint, unsigned long iVar) const final {return Secondary(iPoint,iVar); } - - /*! - * \brief Get the primitive variables of the problem. - * \return Pointer to the primitive variable vector. - */ - inline su2double *GetSecondary(unsigned long iPoint) final { return Secondary[iPoint]; } - - /*---------------------------------------*/ - /*--- Gradient Routines ---*/ - /*---------------------------------------*/ - - /*! - * \brief Get the reconstruction gradient for primitive variable at all points. - * \return Reference to variable reconstruction gradient. - */ - inline CVectorOfMatrix& GetGradient_Reconstruction(void) final { return Gradient_Reconstruction; } - - /*! - * \brief Get the value of the reconstruction variables gradient at a node. - * \param[in] iPoint - Index of the current node. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \return Value of the reconstruction variables gradient at a node. - */ - inline su2double GetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const final { - return Gradient_Reconstruction(iPoint,iVar,iDim); - } - - /*! - * \brief Get the array of the reconstruction variables gradient at a node. - * \param[in] iPoint - Index of the current node. - * \return Array of the reconstruction variables gradient at a node. - */ - inline su2double **GetGradient_Reconstruction(unsigned long iPoint) final { return Gradient_Reconstruction[iPoint]; } - - /*! - * \brief Get the value of the reconstruction variables gradient at a node. - * \param[in] iPoint - Index of the current node. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value of the reconstruction gradient component. - */ - inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { - Gradient_Reconstruction(iPoint,iVar,iDim) = value; - } - - /*! - * \brief Set to zero the gradient of the primitive variables. - */ - void SetGradient_PrimitiveZero(); - - /*! - * \brief Add value to the gradient of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value to add to the gradient of the primitive variables. - */ - inline void AddGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { - Gradient_Primitive(iPoint,iVar,iDim) += value; - } - - /*! - * \brief Subtract value to the gradient of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value to subtract to the gradient of the primitive variables. - */ - inline void SubtractGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) { - Gradient_Primitive(iPoint,iVar,iDim) -= value; - } - - /*! - * \brief Get the value of the primitive variables gradient. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \return Value of the primitive variables gradient. - */ - inline su2double GetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const final { - return Gradient_Primitive(iPoint,iVar,iDim); - } - - /*! - * \brief Set the gradient of the primitive variables. - * \param[in] iVar - Index of the variable. - * \param[in] iDim - Index of the dimension. - * \param[in] value - Value of the gradient. - */ - inline void SetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { - Gradient_Primitive(iPoint,iVar,iDim) = value; - } - - /*! - * \brief Get the value of the primitive variables gradient. - * \return Value of the primitive variables gradient. - */ - inline su2double **GetGradient_Primitive(unsigned long iPoint) final { return Gradient_Primitive[iPoint]; } - - /*! - * \brief Get the primitive variable gradients for all points. - * \return Reference to primitive variable gradient. - */ - inline CVectorOfMatrix& GetGradient_Primitive(void) { return Gradient_Primitive; } - - /*! - * \brief Set all the primitive variables for compressible flows. - */ - bool SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) override; - - /*! - * \brief Set all the primitive and secondary variables from the conserved vector. - */ - bool Cons2PrimVar(su2double *U, su2double *V, su2double *dPdU, - su2double *dTdU, su2double *dTvedU, su2double *val_eves, - su2double *val_Cvves); - - /*---------------------------------------*/ - /*--- Specific variable routines ---*/ - /*---------------------------------------*/ - - /*! - * \brief Set the norm 2 of the velocity. - * \return Norm 2 of the velocity vector. - */ - void SetVelocity2(unsigned long iPoint) final; - - /*! - * \brief Get the norm 2 of the velocity. - * \return Norm 2 of the velocity vector. - */ - inline su2double GetVelocity2(unsigned long iPoint) const final { return Velocity2(iPoint); } - - /*! - * \brief Get the flow pressure. - * \return Value of the flow pressure. - */ - inline su2double GetPressure(unsigned long iPoint) const final { return Primitive(iPoint,P_INDEX); } - - /*! - * \brief Get the speed of the sound. - * \return Value of speed of the sound. - */ - inline su2double GetSoundSpeed(unsigned long iPoint) const final { return Primitive(iPoint,A_INDEX); } - - /*! - * \brief Get the enthalpy of the flow. - * \return Value of the enthalpy of the flow. - */ - inline su2double GetEnthalpy(unsigned long iPoint) const final { return Primitive(iPoint,H_INDEX); } - - /*! - * \brief Get the density of the flow. - * \return Value of the density of the flow. - */ - inline su2double GetDensity(unsigned long iPoint) const final { return Primitive(iPoint,RHO_INDEX); } - - /*! - * \brief Get the specie density of the flow. - * \return Value of the specie density of the flow. - */ - inline su2double GetDensity(unsigned long iPoint, unsigned long val_Species) const final { return Primitive(iPoint,RHOS_INDEX+val_Species); } - - /*! - * \brief Get the energy of the flow. - * \return Value of the energy of the flow. - */ - inline su2double GetEnergy(unsigned long iPoint) const final { return Solution(iPoint,nSpecies+nDim)/Primitive(iPoint,RHO_INDEX); } - - /*! - * \brief Get the temperature of the flow. - * \return Value of the temperature of the flow. - */ - inline su2double GetTemperature(unsigned long iPoint) const final { return Primitive(iPoint,T_INDEX); } - - /*! - * \brief Get the velocity of the flow. - * \param[in] iDim - Index of the dimension. - * \return Value of the velocity for the dimension iDim. - */ - inline su2double GetVelocity(unsigned long iPoint, unsigned long iDim) const final { return Primitive(iPoint,VEL_INDEX+iDim); } - - /*! - * \brief Get the projected velocity in a unitary vector direction (compressible solver). - * \param[in] val_vector - Direction of projection. - * \return Value of the projected velocity. - */ - inline su2double GetProjVel(unsigned long iPoint, const su2double *val_vector) const final { - su2double ProjVel = 0.0; - for (unsigned long iDim = 0; iDim < nDim; iDim++) - ProjVel += Primitive(iPoint,VEL_INDEX+iDim)*val_vector[iDim]; - return ProjVel; - } - - /*! - * \brief Set the velocity vector from the solution. - * \param[in] val_velocity - Pointer to the velocity. - */ - inline void SetVelocity(unsigned long iPoint) final { - Velocity2(iPoint) = 0.0; - for (unsigned long iDim = 0; iDim < nDim; iDim++) { - Primitive(iPoint,VEL_INDEX+iDim) = Solution(iPoint,nSpecies+iDim) / Primitive(iPoint,RHO_INDEX); - Velocity2(iPoint) += pow(Primitive(iPoint,VEL_INDEX+iDim),2); - } - } - - /*! - * \brief Set the velocity vector from the old solution. - * \param[in] val_velocity - Pointer to the velocity. - */ - inline void SetVelocity_Old(unsigned long iPoint, const su2double *val_velocity) final { - for (unsigned long iDim = 0; iDim < nDim; iDim++){ - Solution_Old(iPoint,nSpecies+iDim) = val_velocity[iDim]*Primitive(iPoint,RHO_INDEX); - } - } - - /*! - * \brief A virtual member. - * \return Value of the vibrational-electronic temperature. - */ - inline su2double GetTemperature_ve(unsigned long iPoint) const final - { return Primitive(iPoint,TVE_INDEX); } - - /*! - * \brief Sets the vibrational electronic temperature of the flow. - * \return Value of the temperature of the flow. - */ - inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve) final - { Primitive(iPoint,TVE_INDEX) = val_Tve; return false; } - - /*! - * \brief Get the mixture specific heat at constant volume (trans.-rot.). - * \return \f$\rho C^{t-r}_{v} \f$ - */ - inline su2double GetRhoCv_tr(unsigned long iPoint) const final - { return Primitive(iPoint,RHOCVTR_INDEX); } - - /*! - * \brief Get the mixture specific heat at constant volume (vib.-el.). - * \return \f$\rho C^{v-e}_{v} \f$ - */ - inline su2double GetRhoCv_ve(unsigned long iPoint) const final - { return Primitive(iPoint,RHOCVVE_INDEX); } - - /*! - * \brief Returns the stored value of Eve at the specified node - */ - inline su2double *GetEve(unsigned long iPoint) { return eves[iPoint]; } - - /*! - * \brief Returns the value of Cvve at the specified node - */ - su2double *GetCvve(unsigned long iPoint) { return Cvves[iPoint]; } - - /*! - * \brief Set partial derivative of pressure w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$ - */ - inline su2double *GetdPdU(unsigned long iPoint) final { return dPdU[iPoint]; } - - /*! - * \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial T}{\partial \rho_s}\f$ - */ - inline su2double *GetdTdU(unsigned long iPoint) final { return dTdU[iPoint]; } - - /*! - * \brief Set partial derivative of vib.-el. temperature w.r.t. density \f$\frac{\partial T^{V-E}}{\partial \rho_s}\f$ - */ - inline su2double *GetdTvedU(unsigned long iPoint) final { return dTvedU[iPoint]; } - - /*! - * \brief Get the mass fraction \f$\rho_s / \rho \f$ of species s. - * \param[in] val_Species - Index of species s. - * \return Value of the mass fraction of species s. - */ - inline su2double GetMassFraction(unsigned long iPoint, unsigned long val_Species) const final { - return Primitive(iPoint,RHOS_INDEX+val_Species) / Primitive(iPoint,RHO_INDEX); - } - - /*! - * \brief Returns the stored value of Gamma at the specified node - */ - inline su2double GetGamma(unsigned long iPoint) { return Gamma(iPoint); } - - /*---------------------------------------*/ - /*--- NEMO indices ---*/ - /*---------------------------------------*/ - - /*! - * \brief Retrieves the value of the species density in the primitive variable vector. - */ - inline unsigned short GetRhosIndex(void) { return RHOS_INDEX; } - - /*! - * \brief Retrieves the value of the total density in the primitive variable vector. - */ - inline unsigned short GetRhoIndex(void) { return RHO_INDEX; } - - /*! - * \brief Retrieves the value of the pressure in the primitive variable vector. - */ - inline unsigned short GetPIndex(void) { return P_INDEX; } - - /*! - * \brief Retrieves the value of the in temperature the primitive variable vector. - */ - inline unsigned short GetTIndex(void) { return T_INDEX; } - - /*! - * \brief Retrieves the value of the vibe-elec temperature in the primitive variable vector. - */ - inline unsigned short GetTveIndex(void) { return TVE_INDEX; } - - /*! - * \brief Retrieves the value of the velocity in the primitive variable vector. - */ - inline unsigned short GetVelIndex(void) { return VEL_INDEX; } - - /*! - * \brief Retrieves the value of the enthalpy in the primitive variable vector. - */ - inline unsigned short GetHIndex(void) { return H_INDEX; } - - /*! - * \brief Retrieves the value of the soundspeed in the primitive variable vector. - */ - inline unsigned short GetAIndex(void) { return A_INDEX; } - - /*! - * \brief Retrieves the value of the RhoCvtr in the primitive variable vector. - */ - inline unsigned short GetRhoCvtrIndex(void) { return RHOCVTR_INDEX; } - - /*! - * \brief Retrieves the value of the RhoCvve in the primitive variable vector. - */ - inline unsigned short GetRhoCvveIndex(void) { return RHOCVVE_INDEX; } - - /*! - * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. - * \param[in] iPoint - Point index. - * \param[in] val_vector - Pointer to the vector. - */ - inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { +/*! + * \file CNEMOEulerVariable.hpp + * \brief Class for defining the variables of the compressible NEMO Euler solver. + * \author C. Garbacz, W. Maier, S.R. Copeland + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CVariable.hpp" +#include "../fluid/CNEMOGas.hpp" + +/*! + * \class CNEMOEulerVariable + * \brief Main class for defining the variables of the NEMO Euler's solver. + * \ingroup Euler_Equations + * \author S. R. Copeland, F. Palacios, W. Maier, C. Garbacz + * \version 7.0.8 + */ +class CNEMOEulerVariable : public CVariable { +public: + static constexpr size_t MAXNVAR = 25; + +protected: + + bool ionization; /*!< \brief Presence of charged species in gas mixture. */ + bool monoatomic = false; /*!< \brief Presence of single species gas. */ + + VectorType Velocity2; /*!< \brief Square of the velocity vector. */ + MatrixType Precond_Beta; /*!< \brief Low Mach number preconditioner value, Beta. */ + + CVectorOfMatrix& Gradient_Reconstruction; /*!< \brief Reference to the gradient of the conservative variables for MUSCL reconstruction for the convective term */ + CVectorOfMatrix Gradient_Aux; /*!< \brief Auxiliary structure to store a second gradient for reconstruction, if required. */ + + /*--- Primitive variable definition ---*/ + MatrixType Primitive; /*!< \brief Primitive variables (rhos_s, T, Tve, ...) in compressible flows. */ + MatrixType Primitive_Aux; /*!< \brief Primitive auxiliary variables (Y_s, T, Tve, ...) in compressible flows. */ + CVectorOfMatrix Gradient_Primitive; /*!< \brief Gradient of the primitive variables (rhos_s, T, Tve, ...). */ + MatrixType Limiter_Primitive; /*!< \brief Limiter of the primitive variables (rhos_s, T, Tve, ...). */ + + /*--- Secondary variable definition ---*/ + MatrixType Secondary; /*!< \brief Primitive variables (T, vx, vy, vz, P, rho, h, c) in compressible flows. */ + CVectorOfMatrix Gradient_Secondary; /*!< \brief Gradient of the primitive variables (T, vx, vy, vz, P, rho). */ + + /*--- New solution container for Classical RK4 ---*/ + MatrixType Solution_New; /*!< \brief New solution container for Classical RK4. */ + + /*--- Other Necessary Variable Definition ---*/ + MatrixType dPdU; /*!< \brief Partial derivative of pressure w.r.t. conserved variables. */ + MatrixType dTdU; /*!< \brief Partial derivative of temperature w.r.t. conserved variables. */ + MatrixType dTvedU; /*!< \brief Partial derivative of vib.-el. temperature w.r.t. conserved variables. */ + MatrixType eves; /*!< \brief energy of vib-el mode w.r.t. species. */ + MatrixType Cvves; /*!< \brief Specific heat of vib-el mode w.r.t. species. */ + VectorType Gamma; /*!< \brief Ratio of specific heats. */ + + CNEMOGas *fluidmodel; + + /*!< \brief Index definition for NEMO pritimive variables. */ + unsigned long RHOS_INDEX, T_INDEX, TVE_INDEX, VEL_INDEX, P_INDEX, + RHO_INDEX, H_INDEX, A_INDEX, RHOCVTR_INDEX, RHOCVVE_INDEX, + LAM_VISC_INDEX, EDDY_VISC_INDEX, nSpecies; + + su2double Tve_Freestream; /*!< \brief Freestream vib-el temperature. */ + +public: + + /*! + * \brief Constructor of the class. + * \param[in] val_pressure - Value of the flow pressure (initialization value). + * \param[in] val_massfrac - Value of the mass fraction (initialization value). + * \param[in] val_mach - Value of the Mach number (initialization value). + * \param[in] val_temperature - Value of the flow temperature (initialization value). + * \param[in] val_temperature_ve - Value of the flow temperature_ve (initialization value). + * \param[in] npoint - Number of points/nodes/vertices in the domain. + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of conserved variables. + * \param[in] val_nVarPrim - Number of primitive variables. + * \param[in] val_nVarPrimGrad - Number of primitive gradient variables. + * \param[in] config - Definition of the particular problem. + */ + CNEMOEulerVariable(su2double val_pressure, const su2double *val_massfrac, + su2double *val_mach, su2double val_temperature, + su2double val_temperature_ve, unsigned long npoint, + unsigned long ndim, + unsigned long nvar, unsigned long nvalprim, + unsigned long nvarprimgrad, CConfig *config, CNEMOGas *fluidmodel); + + /*! + * \brief Destructor of the class. + */ + ~CNEMOEulerVariable() override = default; + + /*---------------------------------------*/ + /*--- U,V,S Routines ---*/ + /*---------------------------------------*/ + + /*! + * \brief Get the new solution of the problem (Classical RK4). + * \param[in] iVar - Index of the variable. + * \return Pointer to the old solution vector. + */ + inline su2double GetSolution_New(unsigned long iPoint, unsigned long iVar) const final { return Solution_New(iPoint,iVar); } + + /*! + * \brief Set the new solution container for Classical RK4. + */ + void SetSolution_New() final; + + /*! + * \brief Add a value to the new solution container for Classical RK4. + * \param[in] iVar - Number of the variable. + * \param[in] val_solution - Value that we want to add to the solution. + */ + inline void AddSolution_New(unsigned long iPoint, unsigned long iVar, su2double val_solution) final { + Solution_New(iPoint,iVar) += val_solution; + } + + /*! + * \brief Set the value of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iVar - Index of the variable. + * \return Set the value of the primitive variable for the index iVar. + */ + inline void SetPrimitive(unsigned long iPoint, unsigned long iVar, su2double val_prim) final { Primitive(iPoint,iVar) = val_prim; } + + /*! + * \brief Set the value of the primitive variables. + * \param[in] val_prim - Primitive variables. + * \return Set the value of the primitive variable for the index iVar. + */ + inline void SetPrimitive(unsigned long iPoint, const su2double *val_prim) final { + for (unsigned long iVar = 0; iVar < nPrimVar; iVar++) + Primitive(iPoint,iVar) = val_prim[iVar]; + } + + /*! + * \brief Get the primitive variables limiter. + * \return Primitive variables limiter for the entire domain. + */ + inline MatrixType& GetLimiter_Primitive(void) {return Limiter_Primitive; } + + /*! + * \brief Set the gradient of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \param[in] value - Value of the gradient. + */ + inline su2double GetLimiter_Primitive(unsigned long iPoint, unsigned long iVar) const final {return Limiter_Primitive(iPoint,iVar); } + + /*! + * \brief Get the value of the primitive variables gradient. + * \return Value of the primitive variables gradient. + */ + inline su2double *GetLimiter_Primitive(unsigned long iPoint) final { return Limiter_Primitive[iPoint]; } + + /*! + * \brief Set the gradient of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] value - Value of the gradient. + */ + inline void SetLimiter_Primitive(unsigned long iPoint, unsigned long iVar, su2double value) final { + Limiter_Primitive(iPoint,iVar) = value; + } + + /*! + * \brief Set the value of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iVar - Index of the variable. + * \return Set the value of the primitive variable for the index iVar. + */ + inline void SetSecondary(unsigned long iPoint, unsigned long iVar, su2double val_secondary) final {Secondary(iPoint,iVar) = val_secondary; } + + /*! + * \brief Set the value of the primitive variables. + * \param[in] val_prim - Primitive variables. + * \return Set the value of the primitive variable for the index iVar. + */ + inline void SetSecondary(unsigned long iPoint, const su2double *val_secondary) final { + for (unsigned long iVar = 0; iVar < nSecondaryVar; iVar++) + Secondary(iPoint,iVar) = val_secondary[iVar]; + } + + /*! + * \brief Set the value of the primitive auxiliary variables - with mass fractions. + * \param[in] iVar - Index of the variable. + * \param[in] iVar - Index of the variable. + * \return Set the value of the primitive variable for the index iVar. + */ + inline void SetPrimitive_Aux(unsigned long iPoint, unsigned long iVar, su2double val_prim) { Primitive_Aux(iPoint,iVar) = val_prim; } + + + /*! + * \brief Get the primitive variables. + * \param[in] iVar - Index of the variable. + * \return Value of the primitive variable for the index iVar. + */ + inline su2double GetPrimitive(unsigned long iPoint, unsigned long iVar) const final { return Primitive(iPoint,iVar); } + + /*! + * \brief Get the primitive variables of the problem. + * \return Pointer to the primitive variable vector. + */ + inline su2double *GetPrimitive(unsigned long iPoint) final {return Primitive[iPoint]; } + + /*! + * \brief Get the primitive variables for all points. + * \return Reference to primitives. + */ + inline const MatrixType& GetPrimitive(void) const { return Primitive; } + + /*! + * \brief Get the primitive variables for all points. + * \return Reference to primitives. + */ + inline const MatrixType& GetPrimitive_Aux(void) const { return Primitive_Aux; } + + + /*! + * \brief Get the primitive variables. + * \param[in] iVar - Index of the variable. + * \return Value of the primitive variable for the index iVar. + */ + inline su2double GetSecondary(unsigned long iPoint, unsigned long iVar) const final {return Secondary(iPoint,iVar); } + + /*! + * \brief Get the primitive variables of the problem. + * \return Pointer to the primitive variable vector. + */ + inline su2double *GetSecondary(unsigned long iPoint) final { return Secondary[iPoint]; } + + /*---------------------------------------*/ + /*--- Gradient Routines ---*/ + /*---------------------------------------*/ + + /*! + * \brief Get the reconstruction gradient for primitive variable at all points. + * \return Reference to variable reconstruction gradient. + */ + inline CVectorOfMatrix& GetGradient_Reconstruction(void) final { return Gradient_Reconstruction; } + + /*! + * \brief Get the value of the reconstruction variables gradient at a node. + * \param[in] iPoint - Index of the current node. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \return Value of the reconstruction variables gradient at a node. + */ + inline su2double GetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const final { + return Gradient_Reconstruction(iPoint,iVar,iDim); + } + + /*! + * \brief Get the array of the reconstruction variables gradient at a node. + * \param[in] iPoint - Index of the current node. + * \return Array of the reconstruction variables gradient at a node. + */ + inline su2double **GetGradient_Reconstruction(unsigned long iPoint) final { return Gradient_Reconstruction[iPoint]; } + + /*! + * \brief Get the value of the reconstruction variables gradient at a node. + * \param[in] iPoint - Index of the current node. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \param[in] value - Value of the reconstruction gradient component. + */ + inline void SetGradient_Reconstruction(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { + Gradient_Reconstruction(iPoint,iVar,iDim) = value; + } + + /*! + * \brief Set to zero the gradient of the primitive variables. + */ + void SetGradient_PrimitiveZero(); + + /*! + * \brief Add value to the gradient of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \param[in] value - Value to add to the gradient of the primitive variables. + */ + inline void AddGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { + Gradient_Primitive(iPoint,iVar,iDim) += value; + } + + /*! + * \brief Subtract value to the gradient of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \param[in] value - Value to subtract to the gradient of the primitive variables. + */ + inline void SubtractGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) { + Gradient_Primitive(iPoint,iVar,iDim) -= value; + } + + /*! + * \brief Get the value of the primitive variables gradient. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \return Value of the primitive variables gradient. + */ + inline su2double GetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const final { + return Gradient_Primitive(iPoint,iVar,iDim); + } + + /*! + * \brief Set the gradient of the primitive variables. + * \param[in] iVar - Index of the variable. + * \param[in] iDim - Index of the dimension. + * \param[in] value - Value of the gradient. + */ + inline void SetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim, su2double value) final { + Gradient_Primitive(iPoint,iVar,iDim) = value; + } + + /*! + * \brief Get the value of the primitive variables gradient. + * \return Value of the primitive variables gradient. + */ + inline su2double **GetGradient_Primitive(unsigned long iPoint) final { return Gradient_Primitive[iPoint]; } + + /*! + * \brief Get the primitive variable gradients for all points. + * \return Reference to primitive variable gradient. + */ + inline CVectorOfMatrix& GetGradient_Primitive(void) { return Gradient_Primitive; } + + /*! + * \brief Set all the primitive variables for compressible flows. + */ + bool SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) override; + + /*! + * \brief Set all the primitive and secondary variables from the conserved vector. + */ + bool Cons2PrimVar(su2double *U, su2double *V, su2double *dPdU, + su2double *dTdU, su2double *dTvedU, su2double *val_eves, + su2double *val_Cvves); + + /*---------------------------------------*/ + /*--- Specific variable routines ---*/ + /*---------------------------------------*/ + + /*! + * \brief Set the norm 2 of the velocity. + * \return Norm 2 of the velocity vector. + */ + void SetVelocity2(unsigned long iPoint) final; + + /*! + * \brief Get the norm 2 of the velocity. + * \return Norm 2 of the velocity vector. + */ + inline su2double GetVelocity2(unsigned long iPoint) const final { return Velocity2(iPoint); } + + /*! + * \brief Get the flow pressure. + * \return Value of the flow pressure. + */ + inline su2double GetPressure(unsigned long iPoint) const final { return Primitive(iPoint,P_INDEX); } + + /*! + * \brief Get the speed of the sound. + * \return Value of speed of the sound. + */ + inline su2double GetSoundSpeed(unsigned long iPoint) const final { return Primitive(iPoint,A_INDEX); } + + /*! + * \brief Get the enthalpy of the flow. + * \return Value of the enthalpy of the flow. + */ + inline su2double GetEnthalpy(unsigned long iPoint) const final { return Primitive(iPoint,H_INDEX); } + + /*! + * \brief Get the density of the flow. + * \return Value of the density of the flow. + */ + inline su2double GetDensity(unsigned long iPoint) const final { return Primitive(iPoint,RHO_INDEX); } + + /*! + * \brief Get the specie density of the flow. + * \return Value of the specie density of the flow. + */ + inline su2double GetDensity(unsigned long iPoint, unsigned long val_Species) const final { return Primitive(iPoint,RHOS_INDEX+val_Species); } + + /*! + * \brief Get the energy of the flow. + * \return Value of the energy of the flow. + */ + inline su2double GetEnergy(unsigned long iPoint) const final { return Solution(iPoint,nSpecies+nDim)/Primitive(iPoint,RHO_INDEX); } + + /*! + * \brief Get the temperature of the flow. + * \return Value of the temperature of the flow. + */ + inline su2double GetTemperature(unsigned long iPoint) const final { return Primitive(iPoint,T_INDEX); } + + /*! + * \brief Get the velocity of the flow. + * \param[in] iDim - Index of the dimension. + * \return Value of the velocity for the dimension iDim. + */ + inline su2double GetVelocity(unsigned long iPoint, unsigned long iDim) const final { return Primitive(iPoint,VEL_INDEX+iDim); } + + /*! + * \brief Get the projected velocity in a unitary vector direction (compressible solver). + * \param[in] val_vector - Direction of projection. + * \return Value of the projected velocity. + */ + inline su2double GetProjVel(unsigned long iPoint, const su2double *val_vector) const final { + su2double ProjVel = 0.0; for (unsigned long iDim = 0; iDim < nDim; iDim++) - Solution(iPoint, nSpecies+iDim) = Primitive(iPoint,RHO_INDEX) * val_vector[iDim]; + ProjVel += Primitive(iPoint,VEL_INDEX+iDim)*val_vector[iDim]; + return ProjVel; + } + + /*! + * \brief Set the velocity vector from the solution. + * \param[in] val_velocity - Pointer to the velocity. + */ + inline void SetVelocity(unsigned long iPoint) final { + Velocity2(iPoint) = 0.0; + for (unsigned long iDim = 0; iDim < nDim; iDim++) { + Primitive(iPoint,VEL_INDEX+iDim) = Solution(iPoint,nSpecies+iDim) / Primitive(iPoint,RHO_INDEX); + Velocity2(iPoint) += pow(Primitive(iPoint,VEL_INDEX+iDim),2); + } + } + + /*! + * \brief Set the velocity vector from the old solution. + * \param[in] val_velocity - Pointer to the velocity. + */ + inline void SetVelocity_Old(unsigned long iPoint, const su2double *val_velocity) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++){ + Solution_Old(iPoint,nSpecies+iDim) = val_velocity[iDim]*Primitive(iPoint,RHO_INDEX); + } + } + + /*! + * \brief A virtual member. + * \return Value of the vibrational-electronic temperature. + */ + inline su2double GetTemperature_ve(unsigned long iPoint) const final + { return Primitive(iPoint,TVE_INDEX); } + + /*! + * \brief Sets the vibrational electronic temperature of the flow. + * \return Value of the temperature of the flow. + */ + inline bool SetTemperature_ve(unsigned long iPoint, su2double val_Tve) final + { Primitive(iPoint,TVE_INDEX) = val_Tve; return false; } + + /*! + * \brief Get the mixture specific heat at constant volume (trans.-rot.). + * \return \f$\rho C^{t-r}_{v} \f$ + */ + inline su2double GetRhoCv_tr(unsigned long iPoint) const final + { return Primitive(iPoint,RHOCVTR_INDEX); } + + /*! + * \brief Get the mixture specific heat at constant volume (vib.-el.). + * \return \f$\rho C^{v-e}_{v} \f$ + */ + inline su2double GetRhoCv_ve(unsigned long iPoint) const final + { return Primitive(iPoint,RHOCVVE_INDEX); } + + /*! + * \brief Returns the stored value of Eve at the specified node + */ + inline su2double *GetEve(unsigned long iPoint) { return eves[iPoint]; } + + /*! + * \brief Returns the value of Cvve at the specified node + */ + su2double *GetCvve(unsigned long iPoint) { return Cvves[iPoint]; } + + /*! + * \brief Set partial derivative of pressure w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$ + */ + inline su2double *GetdPdU(unsigned long iPoint) final { return dPdU[iPoint]; } + + /*! + * \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial T}{\partial \rho_s}\f$ + */ + inline su2double *GetdTdU(unsigned long iPoint) final { return dTdU[iPoint]; } + + /*! + * \brief Set partial derivative of vib.-el. temperature w.r.t. density \f$\frac{\partial T^{V-E}}{\partial \rho_s}\f$ + */ + inline su2double *GetdTvedU(unsigned long iPoint) final { return dTvedU[iPoint]; } + + /*! + * \brief Get the mass fraction \f$\rho_s / \rho \f$ of species s. + * \param[in] val_Species - Index of species s. + * \return Value of the mass fraction of species s. + */ + inline su2double GetMassFraction(unsigned long iPoint, unsigned long val_Species) const final { + return Primitive(iPoint,RHOS_INDEX+val_Species) / Primitive(iPoint,RHO_INDEX); + } + + /*! + * \brief Returns the stored value of Gamma at the specified node + */ + inline su2double GetGamma(unsigned long iPoint) { return Gamma(iPoint); } + + /*---------------------------------------*/ + /*--- NEMO indices ---*/ + /*---------------------------------------*/ + + /*! + * \brief Retrieves the value of the species density in the primitive variable vector. + */ + inline unsigned short GetRhosIndex(void) { return RHOS_INDEX; } + + /*! + * \brief Retrieves the value of the total density in the primitive variable vector. + */ + inline unsigned short GetRhoIndex(void) { return RHO_INDEX; } + + /*! + * \brief Retrieves the value of the pressure in the primitive variable vector. + */ + inline unsigned short GetPIndex(void) { return P_INDEX; } + + /*! + * \brief Retrieves the value of the in temperature the primitive variable vector. + */ + inline unsigned short GetTIndex(void) { return T_INDEX; } + + /*! + * \brief Retrieves the value of the vibe-elec temperature in the primitive variable vector. + */ + inline unsigned short GetTveIndex(void) { return TVE_INDEX; } + + /*! + * \brief Retrieves the value of the velocity in the primitive variable vector. + */ + inline unsigned short GetVelIndex(void) { return VEL_INDEX; } + + /*! + * \brief Retrieves the value of the enthalpy in the primitive variable vector. + */ + inline unsigned short GetHIndex(void) { return H_INDEX; } + + /*! + * \brief Retrieves the value of the soundspeed in the primitive variable vector. + */ + inline unsigned short GetAIndex(void) { return A_INDEX; } + + /*! + * \brief Retrieves the value of the RhoCvtr in the primitive variable vector. + */ + inline unsigned short GetRhoCvtrIndex(void) { return RHOCVTR_INDEX; } + + /*! + * \brief Retrieves the value of the RhoCvve in the primitive variable vector. + */ + inline unsigned short GetRhoCvveIndex(void) { return RHOCVVE_INDEX; } + + /*! + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. + */ + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) + Solution(iPoint, nSpecies+iDim) = Primitive(iPoint,RHO_INDEX) * val_vector[iDim]; } /*! @@ -592,6 +592,6 @@ class CNEMOEulerVariable : public CVariable { */ inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final { for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,nSpecies+iDim) = 0.0; - } - -}; + } + +}; diff --git a/SU2_CFD/include/variables/CNEMONSVariable.hpp b/SU2_CFD/include/variables/CNEMONSVariable.hpp index 657e5aac85ae..ba9a87c4a90b 100644 --- a/SU2_CFD/include/variables/CNEMONSVariable.hpp +++ b/SU2_CFD/include/variables/CNEMONSVariable.hpp @@ -1,167 +1,167 @@ -/*! - * \file CNEMONSVariable.hpp - * \brief Class for defining the variables of the compressible NEMO Navier-Stokes solver. - * \author C. Garbacz, W. Maier, S.R. Copeland. - * \version 7.1.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -#include "CNEMOEulerVariable.hpp" - -/*! - * \class CNEMONSVariable - * \brief Main class for defining the variables of the NEMO Navier-Stokes' solver. - * \ingroup Navier_Stokes_Equations - * \author C. Garbacz, W. Maier, S.R. Copeland. - * \version 7.0.8 - */ -class CNEMONSVariable final : public CNEMOEulerVariable { -private: - VectorType Prandtl_Lam; /*!< \brief Laminar Prandtl number. */ - VectorType Temperature_Ref; /*!< \brief Reference temperature of the fluid. */ - VectorType Viscosity_Ref; /*!< \brief Reference viscosity of the fluid. */ - VectorType Viscosity_Inf; /*!< \brief Viscosity of the fluid at the infinity. */ - MatrixType DiffusionCoeff; /*!< \brief Diffusion coefficient of the mixture. */ - CVectorOfMatrix Dij; /*!< \brief Binary diffusion coefficients. */ - VectorType LaminarViscosity; /*!< \brief Viscosity of the fluid. */ - VectorType ThermalCond; /*!< \brief T-R thermal conductivity of the gas mixture. */ - VectorType ThermalCond_ve; /*!< \brief V-E thermal conductivity of the gas mixture. */ - vector thermalconductivities; - vector Ds; - - su2double inv_TimeScale; /*!< \brief Inverse of the reference time scale. */ - - MatrixType Vorticity; /*!< \brief Vorticity of the fluid. */ - VectorType StrainMag; /*!< \brief Magnitude of rate of strain tensor. */ - VectorType Tau_Wall; /*!< \brief Magnitude of the wall shear stress from a wall function. */ - VectorType DES_LengthScale; /*!< \brief DES Length Scale. */ - VectorType Roe_Dissipation; /*!< \brief Roe low dissipation coefficient. */ - VectorType Vortex_Tilting; /*!< \brief Value of the vortex tilting variable for DES length scale computation. */ - -public: - - /*! - * \brief Constructor of the class. - * \param[in] val_density - Value of the flow density (initialization value). - * \param[in] val_massfrac - Value of the flow mass fraction (initialization value). - * \param[in] val_velocity - Value of the flow velocity (initialization value). - * \param[in] val_temperature - Value of the flow temperature (initialization value). - * \param[in] val_temperature_ve - Value of the flow temperature_ve (initialization value). - * \param[in] npoint - Number of points/nodes/vertices in the domain. - * \param[in] val_nDim - Number of dimensions of the problem. - * \param[in] val_nVar - Number of conserved variables. - * \param[in] val_nPrimVar - Number of primitive variables. - * \param[in] val_nPrimVargrad - Number of primitive gradient variables. - * \param[in] config - Definition of the particular problem. - */ - CNEMONSVariable(su2double val_density, const su2double *val_massfrac, su2double *val_velocity, - su2double val_temperature, su2double val_temperature_ve, unsigned long npoint, - unsigned long val_nDim, unsigned long val_nVar, unsigned long val_nPrimVar, - unsigned long val_nPrimVarGrad, CConfig *config, CNEMOGas *fluidmodel); - - /*! - * \brief Constructor of the class. - * \param[in] val_solution - Pointer to the flow value (initialization value). - * \param[in] val_nDim - Number of dimensions of the problem. - * \param[in] val_nVar - Number of conserved variables. - * \param[in] val_nPrimVar - Number of primitive variables. - * \param[in] val_nPrimgVarGrad - Number of primitive gradient variables. - * \param[in] config - Definition of the particular problem. - */ - CNEMONSVariable(su2double *val_solution, unsigned long val_nDim, unsigned long val_nVar, - unsigned long val_nPrimVar, unsigned long val_nPrimVarGrad, unsigned long npoint, - CConfig *config); - - /*! - * \brief Destructor of the class. - */ - ~CNEMONSVariable() = default; - - /*! - * \brief Get the primitive variables for all points. - * \return Reference to primitives. - */ - inline const MatrixType& GetPrimitive_Aux(void) const { return Primitive_Aux; } - - /*! - * \brief Set all the primitive variables for compressible flows. - */ - bool SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) final; - - /*! - * \brief Set the vorticity value. - */ - bool SetVorticity(void); - - /*! - * \overload - * \param[in] eddy_visc - Value of the eddy viscosity. - */ - inline void SetEddyViscosity(unsigned long iPoint, su2double eddy_visc) override { Primitive(iPoint,EDDY_VISC_INDEX) = eddy_visc; } - - /*! - * \brief Get the species diffusion coefficient. - * \return Value of the species diffusion coefficient. - */ - inline su2double* GetDiffusionCoeff(unsigned long iPoint) override { return DiffusionCoeff[iPoint]; } - - /*! - * \brief Get the laminar viscosity of the flow. - * \return Value of the laminar viscosity of the flow. - */ - inline su2double GetLaminarViscosity(unsigned long iPoint) const override { return LaminarViscosity(iPoint); } - - /*! - * \brief Get the eddy viscosity of the flow. - * \return The eddy viscosity of the flow. - */ - inline su2double GetEddyViscosity(unsigned long iPoint) const override { return Primitive(iPoint,EDDY_VISC_INDEX); } - - /*! - * \brief Get the thermal conductivity of the flow. - * \return Value of the laminar viscosity of the flow. - */ - inline su2double GetThermalConductivity(unsigned long iPoint) const override {return ThermalCond(iPoint); } - - /*! - * \brief Get the vib-el. thermal conductivity of the flow. - * \return Value of the laminar viscosity of the flow. - */ - inline su2double GetThermalConductivity_ve(unsigned long iPoint) const override { return ThermalCond_ve(iPoint); } - - /*! - * \brief Set the temperature at the wall - */ - inline void SetWallTemperature(unsigned long iPoint, su2double temperature_wall) override { - Primitive(iPoint,T_INDEX) = temperature_wall; - } - - /*! - * \brief Get the value of the vorticity. - * \return Value of the vorticity. - */ - inline su2double *GetVorticity(unsigned long iPoint) override { return Vorticity[iPoint]; } - - -}; +/*! + * \file CNEMONSVariable.hpp + * \brief Class for defining the variables of the compressible NEMO Navier-Stokes solver. + * \author C. Garbacz, W. Maier, S.R. Copeland. + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CNEMOEulerVariable.hpp" + +/*! + * \class CNEMONSVariable + * \brief Main class for defining the variables of the NEMO Navier-Stokes' solver. + * \ingroup Navier_Stokes_Equations + * \author C. Garbacz, W. Maier, S.R. Copeland. + * \version 7.0.8 + */ +class CNEMONSVariable final : public CNEMOEulerVariable { +private: + VectorType Prandtl_Lam; /*!< \brief Laminar Prandtl number. */ + VectorType Temperature_Ref; /*!< \brief Reference temperature of the fluid. */ + VectorType Viscosity_Ref; /*!< \brief Reference viscosity of the fluid. */ + VectorType Viscosity_Inf; /*!< \brief Viscosity of the fluid at the infinity. */ + MatrixType DiffusionCoeff; /*!< \brief Diffusion coefficient of the mixture. */ + CVectorOfMatrix Dij; /*!< \brief Binary diffusion coefficients. */ + VectorType LaminarViscosity; /*!< \brief Viscosity of the fluid. */ + VectorType ThermalCond; /*!< \brief T-R thermal conductivity of the gas mixture. */ + VectorType ThermalCond_ve; /*!< \brief V-E thermal conductivity of the gas mixture. */ + vector thermalconductivities; + vector Ds; + + su2double inv_TimeScale; /*!< \brief Inverse of the reference time scale. */ + + MatrixType Vorticity; /*!< \brief Vorticity of the fluid. */ + VectorType StrainMag; /*!< \brief Magnitude of rate of strain tensor. */ + VectorType Tau_Wall; /*!< \brief Magnitude of the wall shear stress from a wall function. */ + VectorType DES_LengthScale; /*!< \brief DES Length Scale. */ + VectorType Roe_Dissipation; /*!< \brief Roe low dissipation coefficient. */ + VectorType Vortex_Tilting; /*!< \brief Value of the vortex tilting variable for DES length scale computation. */ + +public: + + /*! + * \brief Constructor of the class. + * \param[in] val_density - Value of the flow density (initialization value). + * \param[in] val_massfrac - Value of the flow mass fraction (initialization value). + * \param[in] val_velocity - Value of the flow velocity (initialization value). + * \param[in] val_temperature - Value of the flow temperature (initialization value). + * \param[in] val_temperature_ve - Value of the flow temperature_ve (initialization value). + * \param[in] npoint - Number of points/nodes/vertices in the domain. + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of conserved variables. + * \param[in] val_nPrimVar - Number of primitive variables. + * \param[in] val_nPrimVargrad - Number of primitive gradient variables. + * \param[in] config - Definition of the particular problem. + */ + CNEMONSVariable(su2double val_density, const su2double *val_massfrac, su2double *val_velocity, + su2double val_temperature, su2double val_temperature_ve, unsigned long npoint, + unsigned long val_nDim, unsigned long val_nVar, unsigned long val_nPrimVar, + unsigned long val_nPrimVarGrad, CConfig *config, CNEMOGas *fluidmodel); + + /*! + * \brief Constructor of the class. + * \param[in] val_solution - Pointer to the flow value (initialization value). + * \param[in] val_nDim - Number of dimensions of the problem. + * \param[in] val_nVar - Number of conserved variables. + * \param[in] val_nPrimVar - Number of primitive variables. + * \param[in] val_nPrimgVarGrad - Number of primitive gradient variables. + * \param[in] config - Definition of the particular problem. + */ + CNEMONSVariable(su2double *val_solution, unsigned long val_nDim, unsigned long val_nVar, + unsigned long val_nPrimVar, unsigned long val_nPrimVarGrad, unsigned long npoint, + CConfig *config); + + /*! + * \brief Destructor of the class. + */ + ~CNEMONSVariable() = default; + + /*! + * \brief Get the primitive variables for all points. + * \return Reference to primitives. + */ + inline const MatrixType& GetPrimitive_Aux(void) const { return Primitive_Aux; } + + /*! + * \brief Set all the primitive variables for compressible flows. + */ + bool SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) final; + + /*! + * \brief Set the vorticity value. + */ + bool SetVorticity(void); + + /*! + * \overload + * \param[in] eddy_visc - Value of the eddy viscosity. + */ + inline void SetEddyViscosity(unsigned long iPoint, su2double eddy_visc) override { Primitive(iPoint,EDDY_VISC_INDEX) = eddy_visc; } + + /*! + * \brief Get the species diffusion coefficient. + * \return Value of the species diffusion coefficient. + */ + inline su2double* GetDiffusionCoeff(unsigned long iPoint) override { return DiffusionCoeff[iPoint]; } + + /*! + * \brief Get the laminar viscosity of the flow. + * \return Value of the laminar viscosity of the flow. + */ + inline su2double GetLaminarViscosity(unsigned long iPoint) const override { return LaminarViscosity(iPoint); } + + /*! + * \brief Get the eddy viscosity of the flow. + * \return The eddy viscosity of the flow. + */ + inline su2double GetEddyViscosity(unsigned long iPoint) const override { return Primitive(iPoint,EDDY_VISC_INDEX); } + + /*! + * \brief Get the thermal conductivity of the flow. + * \return Value of the laminar viscosity of the flow. + */ + inline su2double GetThermalConductivity(unsigned long iPoint) const override {return ThermalCond(iPoint); } + + /*! + * \brief Get the vib-el. thermal conductivity of the flow. + * \return Value of the laminar viscosity of the flow. + */ + inline su2double GetThermalConductivity_ve(unsigned long iPoint) const override { return ThermalCond_ve(iPoint); } + + /*! + * \brief Set the temperature at the wall + */ + inline void SetWallTemperature(unsigned long iPoint, su2double temperature_wall) override { + Primitive(iPoint,T_INDEX) = temperature_wall; + } + + /*! + * \brief Get the value of the vorticity. + * \return Value of the vorticity. + */ + inline su2double *GetVorticity(unsigned long iPoint) override { return Vorticity[iPoint]; } + + +}; diff --git a/SU2_CFD/include/variables/CNSVariable.hpp b/SU2_CFD/include/variables/CNSVariable.hpp index c8157e8417db..0d93d7eb0400 100644 --- a/SU2_CFD/include/variables/CNSVariable.hpp +++ b/SU2_CFD/include/variables/CNSVariable.hpp @@ -2,7 +2,7 @@ * \file CNSVariable.hpp * \brief Class for defining the variables of the compressible Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CRadP1Variable.hpp b/SU2_CFD/include/variables/CRadP1Variable.hpp index fc50698e5b32..96d466bff5ae 100644 --- a/SU2_CFD/include/variables/CRadP1Variable.hpp +++ b/SU2_CFD/include/variables/CRadP1Variable.hpp @@ -2,7 +2,7 @@ * \file CRadP1Variable.hpp * \brief Class for defining the variables of the P1 radiation model. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CRadVariable.hpp b/SU2_CFD/include/variables/CRadVariable.hpp index 06fab424ab0f..7fc0babcbc51 100644 --- a/SU2_CFD/include/variables/CRadVariable.hpp +++ b/SU2_CFD/include/variables/CRadVariable.hpp @@ -2,7 +2,7 @@ * \file CRadVariable.hpp * \brief Class for defining the variables of the radiation solver. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTransLMVariable.hpp b/SU2_CFD/include/variables/CTransLMVariable.hpp index b2a315e3f310..c62d5e85ba10 100644 --- a/SU2_CFD/include/variables/CTransLMVariable.hpp +++ b/SU2_CFD/include/variables/CTransLMVariable.hpp @@ -2,7 +2,7 @@ * \file CTransLMVariable.hpp * \brief Declaration of the variables of the transition model. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbSAVariable.hpp b/SU2_CFD/include/variables/CTurbSAVariable.hpp index 2c6491d87569..ee9450fc6fbe 100644 --- a/SU2_CFD/include/variables/CTurbSAVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSAVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbSAVariable.hpp * \brief Declaration of the variables of the SA turbulence model. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbSSTVariable.hpp b/SU2_CFD/include/variables/CTurbSSTVariable.hpp index c208e75b1e31..a9faec3fa452 100644 --- a/SU2_CFD/include/variables/CTurbSSTVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSSTVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbSSTVariable.hpp * \brief Declaration of the variables of the SST turbulence model. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbVariable.hpp b/SU2_CFD/include/variables/CTurbVariable.hpp index 97d2935eb4cc..0cd532ee10fc 100644 --- a/SU2_CFD/include/variables/CTurbVariable.hpp +++ b/SU2_CFD/include/variables/CTurbVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbVariable.hpp * \brief Base class for defining the variables of the turbulence model. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 54c5e8cc18e9..a1064a90cc70 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -4,7 +4,7 @@ variables, function definitions in file CVariable.cpp. All variables are children of at least this class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/obj/Makefile.am b/SU2_CFD/obj/Makefile.am index b151070ca740..30e7636a0e50 100644 --- a/SU2_CFD/obj/Makefile.am +++ b/SU2_CFD/obj/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for SU2_CFD # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp index dc12ddaf30df..c0b289ac7dcb 100644 --- a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp +++ b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp @@ -2,7 +2,7 @@ * \file CMarkerProfileReaderFVM.cpp * \brief Class that handles the reading of marker profile files. * \author T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index a73cb5126dc9..35d49885482b 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -2,7 +2,7 @@ * \file SU2_CFD.cpp * \brief Main file of the SU2 Computational Fluid Dynamics code * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { /*--- Command line parsing ---*/ - CLI::App app{"SU2 v7.1.0 \"Blackbird\", The Open-Source CFD Code"}; + CLI::App app{"SU2 v7.1.1 \"Blackbird\", The Open-Source CFD Code"}; app.add_flag("-d,--dryrun", dry_run, "Enable dry run mode.\n" "Only execute preprocessing steps using a dummy geometry."); app.add_option("-t,--threads", num_threads, "Number of OpenMP threads per MPI rank."); diff --git a/SU2_CFD/src/definition_structure.cpp b/SU2_CFD/src/definition_structure.cpp index b0a4b0d2d54b..7a05145b4a86 100644 --- a/SU2_CFD/src/definition_structure.cpp +++ b/SU2_CFD/src/definition_structure.cpp @@ -2,7 +2,7 @@ * \file definition_structure.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 296065b86686..d8afeb89d142 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjMultizoneDriver.cpp * \brief The main subroutines for driving adjoint multi-zone problems * \author O. Burghardt, P. Gomes, T. Albring, R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 48a9463e00db..fee8c00af659 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_adjoint_singlezone.cpp * \brief The main subroutines for driving adjoint single-zone problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 3f6856ea7bb2..32b0e871c8e9 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2,7 +2,7 @@ * \file driver_structure.cpp * \brief The main subroutines for driving single or multi-zone problems. * \author T. Economon, H. Kline, R. Sanchez, F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CDummyDriver.cpp b/SU2_CFD/src/drivers/CDummyDriver.cpp index 63780909763f..e6d440b662cd 100644 --- a/SU2_CFD/src/drivers/CDummyDriver.cpp +++ b/SU2_CFD/src/drivers/CDummyDriver.cpp @@ -2,7 +2,7 @@ * \file CDummyDriver.cpp * \brief Dummy driver class for running the preprocessing without geometry preprocessing. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index a8605ef9ae88..567ee1b14dcd 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_structure.cpp * \brief The main subroutines for driving multi-zone problems. * \author R. Sanchez, O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index eeee79606b9a..683798053d5e 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_direct_singlezone.cpp * \brief The main subroutines for driving single-zone problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CFluidModel.cpp b/SU2_CFD/src/fluid/CFluidModel.cpp index 2d5f73ba2ba0..1ff0728c4f51 100644 --- a/SU2_CFD/src/fluid/CFluidModel.cpp +++ b/SU2_CFD/src/fluid/CFluidModel.cpp @@ -2,7 +2,7 @@ * \file CFluidModel.cpp * \brief Source of the fluid model base class containing thermo-physical subroutines. * \author S.Vitale, M.Pini, G.Gori, A.Guardone, P.Colonna, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CIdealGas.cpp b/SU2_CFD/src/fluid/CIdealGas.cpp index ba1b7d9c8b76..78bf83b128ca 100644 --- a/SU2_CFD/src/fluid/CIdealGas.cpp +++ b/SU2_CFD/src/fluid/CIdealGas.cpp @@ -2,7 +2,7 @@ * \file CIdealGas.cpp * \brief Source of the ideal gas model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index 4eb8d3323cf9..8885bda6a6c6 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -2,7 +2,7 @@ * \file CMutationTCLib.cpp * \brief Source of the Mutation++ 2T nonequilibrium gas model. * \author C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CNEMOGas.cpp b/SU2_CFD/src/fluid/CNEMOGas.cpp index cfc21af63871..3a36eae72201 100644 --- a/SU2_CFD/src/fluid/CNEMOGas.cpp +++ b/SU2_CFD/src/fluid/CNEMOGas.cpp @@ -2,7 +2,7 @@ * \file CNEMOGas.cpp * \brief Source of the nonequilibrium gas model. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CPengRobinson.cpp b/SU2_CFD/src/fluid/CPengRobinson.cpp index e2205975f850..bf8456af6163 100644 --- a/SU2_CFD/src/fluid/CPengRobinson.cpp +++ b/SU2_CFD/src/fluid/CPengRobinson.cpp @@ -2,7 +2,7 @@ * \file CPengRobinson.cpp * \brief Source of the Peng-Robinson model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CSU2TCLib.cpp b/SU2_CFD/src/fluid/CSU2TCLib.cpp index f378101efe61..4fbafd8c39d9 100644 --- a/SU2_CFD/src/fluid/CSU2TCLib.cpp +++ b/SU2_CFD/src/fluid/CSU2TCLib.cpp @@ -2,7 +2,7 @@ * \file CSU2TCLib.cpp * \brief Source of user defined 2T nonequilibrium gas model. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CVanDerWaalsGas.cpp b/SU2_CFD/src/fluid/CVanDerWaalsGas.cpp index 7e0efca6c370..e16256be1e7d 100644 --- a/SU2_CFD/src/fluid/CVanDerWaalsGas.cpp +++ b/SU2_CFD/src/fluid/CVanDerWaalsGas.cpp @@ -2,7 +2,7 @@ * \file CVanDerWaalsGas.cpp * \brief Source of the Polytropic Van der Waals model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CFEM_DG_Integration.cpp b/SU2_CFD/src/integration/CFEM_DG_Integration.cpp index 9ec00d536de3..f1a339bbbc5c 100644 --- a/SU2_CFD/src/integration/CFEM_DG_Integration.cpp +++ b/SU2_CFD/src/integration/CFEM_DG_Integration.cpp @@ -2,7 +2,7 @@ * \file CFEM_DG_Integration.cpp * \brief Definition of time and space integration for the DG solver. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index c2699c9eb560..729eb41958bf 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -2,7 +2,7 @@ * \file CIntegration.cpp * \brief Implementation of the base class for space and time integration. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CIntegrationFactory.cpp b/SU2_CFD/src/integration/CIntegrationFactory.cpp index cb4a57554cb3..844b388442ec 100644 --- a/SU2_CFD/src/integration/CIntegrationFactory.cpp +++ b/SU2_CFD/src/integration/CIntegrationFactory.cpp @@ -2,7 +2,7 @@ * \file CIntegrationFactory.cpp * \brief Main subroutines for CIntegrationFactory . * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 1143ce564e8e..3441fe82737f 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -2,7 +2,7 @@ * \file CMultiGridIntegration.cpp * \brief Implementation of the multigrid integration class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 5c7abdf89083..a9f3a804c61a 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -2,7 +2,7 @@ * \file CNewtonIntegration.cpp * \brief Newton-Krylov integration. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CSingleGridIntegration.cpp b/SU2_CFD/src/integration/CSingleGridIntegration.cpp index 69727321c9d6..88da5a71ef91 100644 --- a/SU2_CFD/src/integration/CSingleGridIntegration.cpp +++ b/SU2_CFD/src/integration/CSingleGridIntegration.cpp @@ -2,7 +2,7 @@ * \file CSingleGridIntegration.cpp * \brief Single (fine) grid integration class implementation. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CStructuralIntegration.cpp b/SU2_CFD/src/integration/CStructuralIntegration.cpp index 52fb4177ceb8..ee29cde6421c 100644 --- a/SU2_CFD/src/integration/CStructuralIntegration.cpp +++ b/SU2_CFD/src/integration/CStructuralIntegration.cpp @@ -2,7 +2,7 @@ * \file CStructuralIntegration.cpp * \brief Space and time integration for structural problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 71f76e7d0726..8559d1fcf840 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -2,7 +2,7 @@ * \file CInterface.cpp * \brief Main subroutines for MPI transfer of information between zones * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp b/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp index f0180f697f35..193e310c04f8 100644 --- a/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another one. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp index be823780208a..b422476cf7df 100644 --- a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer average variables * needed for MixingPlane computation from a generic zone into another one. * \author S. Vitale - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp b/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp index 709dba76b334..71dc84edf862 100644 --- a/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another * \author G. Gori Politecnico di Milano - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 6ff35c0490f5..51a5cc6423a4 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer temperature and heatflux * density for conjugate heat interfaces between structure and fluid zones. * \author O. Burghardt - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp index 706189b4f816..c68ef91deff1 100644 --- a/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone in a discrete adjoint simulation. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp b/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp index 7fbe085bde71..a6d2ac037874 100644 --- a/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp @@ -2,7 +2,7 @@ * \file CDisplacementsInterface.cpp * \brief Main subroutines for transferring boundary displacements. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index cc70050817a5..8dccbf195624 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index 870d6b00d2d8..427d51851f4c 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp index b0887c79a41e..90b4910b2956 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 94bfab7dc34f..155307886f51 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp index 64048cbce202..54c2daa78ade 100644 --- a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjHeatIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 1263c41b36e2..2b5f0a6560c8 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -2,7 +2,7 @@ * \file CFEAIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CFEMFluidIteration.cpp b/SU2_CFD/src/iteration/CFEMFluidIteration.cpp index fff55845d865..beda31774102 100644 --- a/SU2_CFD/src/iteration/CFEMFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFEMFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CFEMFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 1c28976f5399..aeaf77f96219 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index adf02634aa18..bf125b75885a 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -2,7 +2,7 @@ * \file CHeatIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index d76b49ef187e..7ebd79a4235a 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -2,7 +2,7 @@ * \file iteration_structure.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CIterationFactory.cpp b/SU2_CFD/src/iteration/CIterationFactory.cpp index e330c9434e60..3af7adadfeaf 100644 --- a/SU2_CFD/src/iteration/CIterationFactory.cpp +++ b/SU2_CFD/src/iteration/CIterationFactory.cpp @@ -2,7 +2,7 @@ * \file CAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CTurboIteration.cpp b/SU2_CFD/src/iteration/CTurboIteration.cpp index 7066771c1a17..30e16ca7d1a7 100644 --- a/SU2_CFD/src/iteration/CTurboIteration.cpp +++ b/SU2_CFD/src/iteration/CTurboIteration.cpp @@ -2,7 +2,7 @@ * \file CTurboIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/limiters/CLimiterDetails.cpp b/SU2_CFD/src/limiters/CLimiterDetails.cpp index f6c5cc3292e7..c575e44e15f0 100644 --- a/SU2_CFD/src/limiters/CLimiterDetails.cpp +++ b/SU2_CFD/src/limiters/CLimiterDetails.cpp @@ -3,7 +3,7 @@ * \brief A class template that allows defining limiters via * specialization of particular details. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/CNumerics.cpp b/SU2_CFD/src/numerics/CNumerics.cpp index 95b96a4ee865..8d19b52c72f2 100644 --- a/SU2_CFD/src/numerics/CNumerics.cpp +++ b/SU2_CFD/src/numerics/CNumerics.cpp @@ -4,7 +4,7 @@ * Contains methods for common tasks, e.g. compute flux * Jacobians. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp index 853a14da47fb..2bbb8d471f71 100644 --- a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp +++ b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp @@ -4,7 +4,7 @@ * Contains methods for common tasks, e.g. compute flux * Jacobians. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp index d0f3ac76a133..12ce854348f0 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for discretization * of viscous fluxes in fluid flow NEMO problems. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp index 721672852f76..06d1b6ebd4d1 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration * of source terms in fluid flow NEMO problems. * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/ausm.cpp b/SU2_CFD/src/numerics/NEMO/convection/ausm.cpp index 9e14008636dc..8888fb62cab8 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/ausm.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/ausm.cpp @@ -2,7 +2,7 @@ * \file ausm.cpp * \brief Implementations of the AUSM-family of schemes in NEMO. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/ausmplusup2.cpp b/SU2_CFD/src/numerics/NEMO/convection/ausmplusup2.cpp index d018b81da444..1756b1498ba8 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/ausmplusup2.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/ausmplusup2.cpp @@ -2,7 +2,7 @@ * \file ausmplusup2.cpp * \brief Implementations of the AUSM-family of schemes - AUSM+UP2. * \author W. Maier, A. Sachedeva, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/ausmpwplus.cpp b/SU2_CFD/src/numerics/NEMO/convection/ausmpwplus.cpp index 62796548a340..88293d6f0beb 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/ausmpwplus.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/ausmpwplus.cpp @@ -2,7 +2,7 @@ * \file ausmpwplus.cpp * \brief Implementations of the AUSM-family of schemes - AUSMPWPLUS. * \author F. Palacios, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/lax.cpp b/SU2_CFD/src/numerics/NEMO/convection/lax.cpp index 9f25a48fd621..8cc5714dd714 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/lax.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/lax.cpp @@ -2,7 +2,7 @@ * \file lax.cpp * \brief Implementations of Lax centered scheme. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/msw.cpp b/SU2_CFD/src/numerics/NEMO/convection/msw.cpp index 147ad17e3e83..c2fb4ac4ddb0 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/msw.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/msw.cpp @@ -2,7 +2,7 @@ * \file msw.cpp * \brief Implementations of the modified Steger-Warming scheme. * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/NEMO/convection/roe.cpp b/SU2_CFD/src/numerics/NEMO/convection/roe.cpp index ddbf00f496dd..fdd146b750fb 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/roe.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/roe.cpp @@ -2,7 +2,7 @@ * \file roe.cpp * \brief Implementations of Roe-type schemes in NEMO. * \author S. R. Copeland, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp index e20c7c725ba3..f583e2646208 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp @@ -2,7 +2,7 @@ * \file adj_convection.cpp * \brief Implementation of adjoint convection numerics classes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp index 6bd9b395c032..e177fa67d6f2 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp @@ -2,7 +2,7 @@ * \file adj_diffusion.cpp * \brief Implementation of adjoint diffusion numerics classes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp index d9ac7e846871..5a84c76ce537 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp @@ -2,7 +2,7 @@ * \file adj_sources.cpp * \brief Implementation of adjoint source numerics classes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp index 32da0355745c..4c47c6f3847f 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp @@ -2,7 +2,7 @@ * \file CFEAElasticity.cpp * \brief Base class for all elasticity problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index 199be05e382a..dfe849972ccd 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -2,7 +2,7 @@ * \file CFEALinearElasticity.cpp * \brief Classes for linear elasticity problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index 45f65f568fe8..10f5b54999fc 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -3,7 +3,7 @@ * \brief This file contains the routines for setting the tangent matrix and * residual of a FEM nonlinear elastic structural problem. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp index 0f6c032e9df7..76e70f0a5e81 100644 --- a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp +++ b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp @@ -2,7 +2,7 @@ * \file nonlinear_models.cpp * \brief Definition of nonlinear constitutive models. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp b/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp index 8f965336d25b..86db397ce891 100644 --- a/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp +++ b/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp @@ -2,7 +2,7 @@ * \file ausm_slau.cpp * \brief Implementations of the AUSM-family of schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index 69b1b59b46e9..d1a891232cb3 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -2,7 +2,7 @@ * \file centered.cpp * \brief Implementations of centered schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/cusp.cpp b/SU2_CFD/src/numerics/flow/convection/cusp.cpp index 063ae16d4609..5840a11b6930 100644 --- a/SU2_CFD/src/numerics/flow/convection/cusp.cpp +++ b/SU2_CFD/src/numerics/flow/convection/cusp.cpp @@ -2,7 +2,7 @@ * \file cusp.cpp * \brief Implementation of the CUSP scheme. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/fds.cpp b/SU2_CFD/src/numerics/flow/convection/fds.cpp index 270bf5dfbada..003d6da0721c 100644 --- a/SU2_CFD/src/numerics/flow/convection/fds.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fds.cpp @@ -2,7 +2,7 @@ * \file fds.cpp * \brief Implementation of Flux-Difference-Splitting schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/fvs.cpp b/SU2_CFD/src/numerics/flow/convection/fvs.cpp index 59d6c81be921..bcf44c7a5bbd 100644 --- a/SU2_CFD/src/numerics/flow/convection/fvs.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fvs.cpp @@ -2,7 +2,7 @@ * \file fvs.cpp * \brief Implementations of Flux-Vector-Splitting schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 27e1e89c2810..5e194ce1f391 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -2,7 +2,7 @@ * \file hllc.cpp * \brief Implementations of HLLC schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 07256cb790a2..6d487afb94a9 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -2,7 +2,7 @@ * \file roe.cpp * \brief Implementations of Roe-type schemes. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index d9832b726392..1dde3aa910f6 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for discretization * of viscous fluxes in fluid flow problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index b95e176eb6e5..9ed3841c8f55 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration * of source terms in fluid flow problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/heat.cpp b/SU2_CFD/src/numerics/heat.cpp index a6b1911d0f19..c6dc5cdde64c 100644 --- a/SU2_CFD/src/numerics/heat.cpp +++ b/SU2_CFD/src/numerics/heat.cpp @@ -2,7 +2,7 @@ * \file heat.cpp * \brief Implementation of numerics classes for heat transfer. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/radiation.cpp b/SU2_CFD/src/numerics/radiation.cpp index 5d4268fe88b2..65222ad3095f 100644 --- a/SU2_CFD/src/numerics/radiation.cpp +++ b/SU2_CFD/src/numerics/radiation.cpp @@ -3,7 +3,7 @@ * \brief This file contains the implementation of the numerical * methods for radiation. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/template.cpp b/SU2_CFD/src/numerics/template.cpp index 81effb5c0d0c..ba0627e47cfb 100644 --- a/SU2_CFD/src/numerics/template.cpp +++ b/SU2_CFD/src/numerics/template.cpp @@ -2,7 +2,7 @@ * \file template.cpp * \brief Empty implementation of numerics templates, see .hpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/transition.cpp b/SU2_CFD/src/numerics/transition.cpp index 99182037c547..4d7ceac91963 100644 --- a/SU2_CFD/src/numerics/transition.cpp +++ b/SU2_CFD/src/numerics/transition.cpp @@ -2,7 +2,7 @@ * \file transition.cpp * \brief Implementation of numerics classes for transition problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/turbulent/turb_convection.cpp b/SU2_CFD/src/numerics/turbulent/turb_convection.cpp index 8dfa4e3c7d21..f294b61778b0 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_convection.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_convection.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes to compute convective * fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp b/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp index 66d70730450f..cd50f8ed71ce 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes to compute viscous * fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 0f6379ee9263..0efc4e00dcf4 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration of * turbulence source-terms. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CAdjElasticityOutput.cpp b/SU2_CFD/src/output/CAdjElasticityOutput.cpp index 1af8a45ce73e..22b1e5add14e 100644 --- a/SU2_CFD/src/output/CAdjElasticityOutput.cpp +++ b/SU2_CFD/src/output/CAdjElasticityOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjElasticityOutput.cpp * \brief Main subroutines for elasticity discrete adjoint output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index e45ec3d6cbb0..66e36e8bb8b0 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -2,7 +2,7 @@ * \file output_adj_flow_comp.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index 0bdbb0080622..b7bd9e901157 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -2,7 +2,7 @@ * \file output_adj_flow_inc.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CAdjHeatOutput.cpp b/SU2_CFD/src/output/CAdjHeatOutput.cpp index 0ea5b3a74ee9..4c8f2b767a72 100644 --- a/SU2_CFD/src/output/CAdjHeatOutput.cpp +++ b/SU2_CFD/src/output/CAdjHeatOutput.cpp @@ -2,7 +2,7 @@ * \file output_adj_heat.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CBaselineOutput.cpp b/SU2_CFD/src/output/CBaselineOutput.cpp index 168575e6d680..6c8d3bf54991 100644 --- a/SU2_CFD/src/output/CBaselineOutput.cpp +++ b/SU2_CFD/src/output/CBaselineOutput.cpp @@ -2,7 +2,7 @@ * \file output_baseline.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp index 8ff56ffc94b3..07b52053e40d 100644 --- a/SU2_CFD/src/output/CElasticityOutput.cpp +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -2,7 +2,7 @@ * \file output_elasticity.cpp * \brief Main subroutines for FEA output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp index 632bdefad0c9..cb1dc697aaa1 100644 --- a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -2,7 +2,7 @@ * \file output_flow_comp_fem.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 14240f531057..cb226265e0a0 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -2,7 +2,7 @@ * \file output_flow_comp.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index df6ca665daff..77f8613b93cc 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -2,7 +2,7 @@ * \file output_flow_inc.cpp * \brief Main subroutines for incompressible flow output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 8736b6f5d558..38d62e744154 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -2,7 +2,7 @@ * \file output_flow.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * @@ -1259,7 +1259,7 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n"; Breakdown_file << "| ___ _ _ ___ |" << "\n"; - Breakdown_file << "| / __| | | |_ ) Release 7.1.0 \"Blackbird\" |" << "\n"; + Breakdown_file << "| / __| | | |_ ) Release 7.1.1 \"Blackbird\" |" << "\n"; Breakdown_file << "| \\__ \\ |_| |/ / |" << "\n"; Breakdown_file << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n"; Breakdown_file << "| |" << "\n"; diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 857d721011a8..55aa37097d1a 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -2,7 +2,7 @@ * \file output_heat.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CMeshOutput.cpp b/SU2_CFD/src/output/CMeshOutput.cpp index 03b067b782cc..0bb79e6ac3bd 100644 --- a/SU2_CFD/src/output/CMeshOutput.cpp +++ b/SU2_CFD/src/output/CMeshOutput.cpp @@ -2,7 +2,7 @@ * \file output_mesh.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CMultizoneOutput.cpp b/SU2_CFD/src/output/CMultizoneOutput.cpp index 0c492df46598..8d182ef1dc57 100644 --- a/SU2_CFD/src/output/CMultizoneOutput.cpp +++ b/SU2_CFD/src/output/CMultizoneOutput.cpp @@ -2,7 +2,7 @@ * \file CMultizoneOutput.cpp * \brief Main subroutines for multizone output * \author R. Sanchez, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 943adc06633e..d8959465121e 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -2,7 +2,7 @@ * \file output_structure.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/COutputFactory.cpp b/SU2_CFD/src/output/COutputFactory.cpp index a39f315ea0e8..45ef89a92dc8 100644 --- a/SU2_CFD/src/output/COutputFactory.cpp +++ b/SU2_CFD/src/output/COutputFactory.cpp @@ -2,7 +2,7 @@ * \file COutputFactory.cpp * \brief Main subroutines for output solver information * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp index 7ffd2fb96702..fbfc78461185 100644 --- a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp @@ -2,7 +2,7 @@ * \file CCSVFileWriter.cpp * \brief CSV Writer output class * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp index 61244dd63964..ea2b3c465040 100644 --- a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CFEMDataSorter.cpp * \brief Datasorter class for FEM solvers. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp index d3deb547df44..4d3b50cb7449 100644 --- a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CFVMDataSorter.cpp * \brief Datasorter class for FVM solvers. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp index eeef9bdd0efa..c3d4f9601c5a 100644 --- a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp @@ -2,7 +2,7 @@ * \file CParallelDataSorter.cpp * \brief Datasorter base class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp index a882011c27bf..2d9efcf1f88f 100644 --- a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp @@ -2,7 +2,7 @@ * \file CFileWriter.cpp * \brief Filewriter base class. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp index 1a2d85cef371..467a1e7702f1 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewBinaryFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp index a4a73b9a63b8..f49947e88419 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewFileWriter.cpp * \brief Filewriter class for Paraview ASCII format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp index 8ca0bc411578..658e5bae03d4 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewVTMFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp index 4871946b7cfc..2beed5509646 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewXMLFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp index 33281e83190a..1d29acb0ad01 100644 --- a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSTLFileWriter.cpp * \brief STL Writer output class * \author T. Kattmann, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp index 1b23f9cad0d6..ccd44f347101 100644 --- a/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2BinaryFileWriter.cpp * \brief Filewriter class SU2 native binary format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp index e7facb24ebb7..1e9a7d523fc9 100644 --- a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2FileWriter.cpp * \brief Filewriter class SU2 native ASCII (CSV) format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp index 0c81dcc33d8f..d90a26271e96 100644 --- a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2MeshFileWriter.cpp * \brief Filewriter class SU2 native mesh format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp index d548dd655b42..97221c236bf2 100644 --- a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CSurfaceFEMDataSorter.cpp * \brief Datasorter for FEM surfaces. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp index bcf6b99064ea..13df7a4d8e89 100644 --- a/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CSurfaceFVMDataSorter.cpp * \brief Datasorter for FVM surfaces. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp index 63824a1c7e2b..5b609940e2d4 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CTecplotBinaryFileWriter.cpp * \brief Filewriter class for Tecplot binary format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp index c0631451dd3e..c5207a27740d 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp @@ -2,7 +2,7 @@ * \file CTecplotFileWriter.cpp * \brief Filewriter class for Tecplot ASCII format. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/output_physics.cpp b/SU2_CFD/src/output/output_physics.cpp index 7d68b8775b5e..621937bd3c60 100644 --- a/SU2_CFD/src/output/output_physics.cpp +++ b/SU2_CFD/src/output/output_physics.cpp @@ -2,7 +2,7 @@ * \file output_physics.cpp * \brief Main subroutines to compute physical output quantities such as CL, CD, entropy generation, mass flow, ecc... . * \author S. Vitale - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index c10a2bf1d866..ebac0379aaad 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -2,7 +2,7 @@ * \file output_structure.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/tools/CWindowingTools.cpp b/SU2_CFD/src/output/tools/CWindowingTools.cpp index a0bb5a261648..87fc1f250a8e 100644 --- a/SU2_CFD/src/output/tools/CWindowingTools.cpp +++ b/SU2_CFD/src/output/tools/CWindowingTools.cpp @@ -2,7 +2,7 @@ * \file signal_processing_toolbox.cpp * \brief Signal processing tools * \author S. Schotthöfer - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index ebf9a926d5d2..e324046844ef 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -2,7 +2,7 @@ * \file python_wrapper_structure.cpp * \brief Driver subroutines that are used by the Python wrapper. Those routines are usually called from an external Python environment. * \author D. Thomas - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index 9d213c1948e6..de3ec622236f 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjEulerSolver.cpp * \brief Main subroutines for solving Euler adjoint problems. * \author F. Palacios, T. Economon, H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 439aa053d6f7..d887ab8d7dec 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjNSSolver.cpp * \brief Main subroutines for solving Navier-Stokes adjoint problems. * \author F. Palacios, T. Economon, H. Kline - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp index 01c8a58bf99d..b71a5a5347ec 100644 --- a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.cpp * \brief Main subrotuines for solving turbulent adjoint problems. * \author F. Palacios, A. Bueno, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CBaselineSolver.cpp b/SU2_CFD/src/solvers/CBaselineSolver.cpp index 7900acc2a9ba..195c38732651 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver.cpp @@ -2,7 +2,7 @@ * \file CBaselineSolver.cpp * \brief Main subroutines for CBaselineSolver class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp index faf3c855c8fd..bff91f15d622 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp @@ -2,7 +2,7 @@ * \file CBaselineSolver_FEM.cpp * \brief Main subroutines for CBaselineSolver_FEM class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp index a0d9d81596e0..74dc958baa9b 100644 --- a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEASolver.cpp * \brief Main subroutines for solving adjoint FEM elasticity problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp index 73997cff2f9d..067f256cbdf0 100644 --- a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjMeshSolver.cpp * \brief Main subroutines for solving the discrete adjoint mesh problem. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index efed6499cd09..166270e3c1b5 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjSolver.cpp * \brief Main subroutines for solving the discrete adjoint problem. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e7f447f2b3a0..7cd1a186cb13 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CEulerSolver.cpp * \brief Main subrotuines for solving Finite-Volume Euler flow problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index f8b0e91096d3..23a47c217f2c 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2,7 +2,7 @@ * \file CFEASolver.cpp * \brief Main subroutines for solving direct FEM elasticity problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 245318ff48bd..174a104aade9 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -2,7 +2,7 @@ * \file CFEM_DG_EulerSolver.cpp * \brief Main subroutines for solving finite element Euler flow problems * \author J. Alonso, E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp index 477a6b509b3c..442380bdff04 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp @@ -2,7 +2,7 @@ * \file CFEM_DG_NSSolver.cpp * \brief Main subroutines for solving finite element Navier-Stokes flow problems * \author J. Alonso, E. van der Weide, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 121f0237742b..7d928c01968f 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -2,7 +2,7 @@ * \file CHeatSolver.cpp * \brief Main subrotuines for solving the heat equation * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 90b3f0eab48d..e02b8fd25048 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CIncEulerSolver.cpp * \brief Main subroutines for solving incompressible flow (Euler, Navier-Stokes, etc.). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 4418cef5eb53..2eb8acbd6799 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -2,7 +2,7 @@ * \file CIncNSSolver.cpp * \brief Main subroutines for solving Navier-Stokes incompressible flow. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 07748237afde..f008ad0e8121 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -2,7 +2,7 @@ * \file CMeshSolver.cpp * \brief Main subroutines to solve moving meshes using a pseudo-linear elastic approach. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index b8e5ac6a1c9a..aae061ef04d7 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CNEMOEulerSolver.cpp * \brief Headers of the CNEMOEulerSolver class * \author S. R. Copeland, F. Palacios, W. Maier, C. Garbacz - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index b0f73ee79ea7..5fc79496d58d 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -2,7 +2,7 @@ * \file CNEMONSSolver.cpp * \brief Headers of the CNEMONSSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 915e296c0399..87df3fb2c726 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -2,7 +2,7 @@ * \file CNSSolver.cpp * \brief Main subrotuines for solving Finite-Volume Navier-Stokes flow problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CRadP1Solver.cpp b/SU2_CFD/src/solvers/CRadP1Solver.cpp index 76bcf61681fc..5bd1e64f0a31 100644 --- a/SU2_CFD/src/solvers/CRadP1Solver.cpp +++ b/SU2_CFD/src/solvers/CRadP1Solver.cpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.cpp * \brief Main subroutines for solving P1 radiation problems. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CRadSolver.cpp b/SU2_CFD/src/solvers/CRadSolver.cpp index ba9228f16927..b780f23d3280 100644 --- a/SU2_CFD/src/solvers/CRadSolver.cpp +++ b/SU2_CFD/src/solvers/CRadSolver.cpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.cpp * \brief Main subroutines for solving generic radiation problems (P1, M1, discrete ordinates...) * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index ee2f94d4e053..312e5b39d246 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2,7 +2,7 @@ * \file CSolver.cpp * \brief Main subroutines for CSolver class. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index affbca70ed5b..5b8804520646 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -2,7 +2,7 @@ * \file CSolverFactory.cpp * \brief Main subroutines for CSolverFactoryclass. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CTemplateSolver.cpp b/SU2_CFD/src/solvers/CTemplateSolver.cpp index 4019746cb653..b0795469937c 100644 --- a/SU2_CFD/src/solvers/CTemplateSolver.cpp +++ b/SU2_CFD/src/solvers/CTemplateSolver.cpp @@ -2,7 +2,7 @@ * \file CTemplateSolver.cpp * \brief Subroutines to be implemented for any new solvers * \author F. Palacios - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CTransLMSolver.cpp b/SU2_CFD/src/solvers/CTransLMSolver.cpp index 8f96d1629dd9..b123c812e536 100644 --- a/SU2_CFD/src/solvers/CTransLMSolver.cpp +++ b/SU2_CFD/src/solvers/CTransLMSolver.cpp @@ -2,7 +2,7 @@ * \file CTransLMSolver.cpp * \brief Main subrotuines for Transition model solver. * \author A. Aranake - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 98f85d5021a4..a33a4795822a 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSASolver.cpp * \brief Main subrotuines of CTurbSASolver class * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 5ae1e47c69dc..c03e2295c191 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSSTSolver.cpp * \brief Main subrotuines of CTurbSSTSolver class * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index 627e63d18461..66d9a7c83081 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSolver.cpp * \brief Main subrotuines of CTurbSolver class * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CAdjEulerVariable.cpp b/SU2_CFD/src/variables/CAdjEulerVariable.cpp index 316e18c10546..d8a7c6476fae 100644 --- a/SU2_CFD/src/variables/CAdjEulerVariable.cpp +++ b/SU2_CFD/src/variables/CAdjEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjEulerVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CAdjNSVariable.cpp b/SU2_CFD/src/variables/CAdjNSVariable.cpp index 736929dff7e3..a05de3455b7f 100644 --- a/SU2_CFD/src/variables/CAdjNSVariable.cpp +++ b/SU2_CFD/src/variables/CAdjNSVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjNSVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CAdjTurbVariable.cpp b/SU2_CFD/src/variables/CAdjTurbVariable.cpp index 4836b89d55d9..bebcfde9939c 100644 --- a/SU2_CFD/src/variables/CAdjTurbVariable.cpp +++ b/SU2_CFD/src/variables/CAdjTurbVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CBaselineVariable.cpp b/SU2_CFD/src/variables/CBaselineVariable.cpp index 1df84c3198aa..1cc0c7967329 100644 --- a/SU2_CFD/src/variables/CBaselineVariable.cpp +++ b/SU2_CFD/src/variables/CBaselineVariable.cpp @@ -2,7 +2,7 @@ * \file CBaselineVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp b/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp index a71c32ecf81f..0d322292024d 100644 --- a/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAVariable.cpp * \brief Definition of the variables for FEM adjoint elastic structural problems. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp b/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp index 41f451a5c3a0..87765f8a6642 100644 --- a/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAVariable.cpp * \brief Definition of the variables for FEM adjoint elastic structural problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp b/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp index fe8781d65ded..0d3b6cbfd31c 100644 --- a/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjMeshVariable.cpp * \brief Main subroutines for the discrete adjoint mesh variable structure. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjVariable.cpp b/SU2_CFD/src/variables/CDiscAdjVariable.cpp index c8ed3cb3575f..178cc024d922 100644 --- a/SU2_CFD/src/variables/CDiscAdjVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjVariable.cpp * \brief Main subroutines for the discrete adjoint variable structure. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 9a48d45d8cce..cd7bcbcc4fbc 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CEulerVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CFEABoundVariable.cpp b/SU2_CFD/src/variables/CFEABoundVariable.cpp index b493f9510eb9..a60eb0803f2f 100644 --- a/SU2_CFD/src/variables/CFEABoundVariable.cpp +++ b/SU2_CFD/src/variables/CFEABoundVariable.cpp @@ -2,7 +2,7 @@ * \file CFEABoundVariable.cpp * \brief Definition of the variables for FEM elastic structural problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CFEAVariable.cpp b/SU2_CFD/src/variables/CFEAVariable.cpp index b585a7da058a..fb6d808f6456 100644 --- a/SU2_CFD/src/variables/CFEAVariable.cpp +++ b/SU2_CFD/src/variables/CFEAVariable.cpp @@ -2,7 +2,7 @@ * \file CFEAVariable.cpp * \brief Definition of the variables for FEM elastic structural problems. * \author R. Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CHeatVariable.cpp b/SU2_CFD/src/variables/CHeatVariable.cpp index 3eb6ffb8ff82..461077a15a42 100644 --- a/SU2_CFD/src/variables/CHeatVariable.cpp +++ b/SU2_CFD/src/variables/CHeatVariable.cpp @@ -2,7 +2,7 @@ * \file CHeatVariable.cpp * \brief Definition of the variables for heat equation problems. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index df0e8da3737d..e4f24b18622e 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CIncEulerVariable.cpp * \brief Definition of the variable classes for incompressible flow. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index 68fb0000ccd0..1505fb42b6e1 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -2,7 +2,7 @@ * \file CIncNSVariable.cpp * \brief Definition of the variable classes for incompressible flow. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CMeshBoundVariable.cpp b/SU2_CFD/src/variables/CMeshBoundVariable.cpp index 780496fc5433..82cf0b2698c6 100644 --- a/SU2_CFD/src/variables/CMeshBoundVariable.cpp +++ b/SU2_CFD/src/variables/CMeshBoundVariable.cpp @@ -2,7 +2,7 @@ * \file CMeshBoundVariable.cpp * \brief Definition of the boundary variables for mesh motion using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CMeshElement.cpp b/SU2_CFD/src/variables/CMeshElement.cpp index c25d38a63903..53454882f9d9 100644 --- a/SU2_CFD/src/variables/CMeshElement.cpp +++ b/SU2_CFD/src/variables/CMeshElement.cpp @@ -2,7 +2,7 @@ * \file CMeshElement.cpp * \brief Definition of the mesh elements for mesh deformation using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CMeshVariable.cpp b/SU2_CFD/src/variables/CMeshVariable.cpp index f2bf92d5c81b..d7b0ce383ad5 100644 --- a/SU2_CFD/src/variables/CMeshVariable.cpp +++ b/SU2_CFD/src/variables/CMeshVariable.cpp @@ -2,7 +2,7 @@ * \file CMeshVariable.cpp * \brief Definition of the variables for mesh motion using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp index 45bc0aa5fb9c..4424ab95808f 100644 --- a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp +++ b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp @@ -1,352 +1,352 @@ -/*! - * \file CNEMOEulerVariable.cpp - * \brief Definition of the solution fields. - * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.1.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../../include/variables/CNEMOEulerVariable.hpp" -#include - -CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, - const su2double *val_massfrac, - su2double *val_mach, - su2double val_temperature, - su2double val_temperature_ve, - unsigned long npoint, - unsigned long ndim, - unsigned long nvar, - unsigned long nvarprim, - unsigned long nvarprimgrad, - CConfig *config, - CNEMOGas *fluidmodel) : CVariable(npoint, - ndim, - nvar, - config ), - Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - - vector energies; - unsigned short iDim, iSpecies; - su2double soundspeed, sqvel, rho; - - /*--- Setting variable amounts ---*/ - nDim = ndim; - nPrimVar = nvarprim; - nPrimVarGrad = nvarprimgrad; - - nSpecies = config->GetnSpecies(); - RHOS_INDEX = 0; - T_INDEX = nSpecies; - TVE_INDEX = nSpecies+1; - VEL_INDEX = nSpecies+2; - P_INDEX = nSpecies+nDim+2; - RHO_INDEX = nSpecies+nDim+3; - H_INDEX = nSpecies+nDim+4; - A_INDEX = nSpecies+nDim+5; - RHOCVTR_INDEX = nSpecies+nDim+6; - RHOCVVE_INDEX = nSpecies+nDim+7; - LAM_VISC_INDEX = nSpecies+nDim+8; - EDDY_VISC_INDEX = nSpecies+nDim+9; - - /*--- Set monoatomic flag ---*/ - if (config->GetMonoatomic()) { - monoatomic = true; - Tve_Freestream = config->GetTemperature_ve_FreeStream(); - } - - /*--- Allocate & initialize residual vectors ---*/ - Res_TruncError.resize(nPoint,nVar) = su2double(0.0); - - /*--- Size Grad_AuxVar for axiysmmetric ---*/ - if (config->GetAxisymmetric()){ - nAuxVar = 3; - Grad_AuxVar.resize(nPoint,nAuxVar,nDim,0.0); - AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); - } - - /*--- Only for residual smoothing (multigrid) ---*/ - for (unsigned long iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { - if (config->GetMG_CorrecSmooth(iMesh) > 0) { - Residual_Sum.resize(nPoint,nVar); - Residual_Old.resize(nPoint,nVar); - break; - } - } - - /*--- Allocate undivided laplacian (centered) and limiter (upwind)---*/ - if (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) - Undivided_Laplacian.resize(nPoint,nVar); - - /*--- Always allocate the slope limiter, - and the auxiliar variables (check the logic - JST with 2nd order Turb model - ) ---*/ - Limiter.resize(nPoint,nVar) = su2double(0.0); - Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); - - Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); - Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); - - /*--- Primitive and secondary variables ---*/ - Primitive.resize(nPoint,nPrimVar) = su2double(0.0); - Primitive_Aux.resize(nPoint,nPrimVar) = su2double(0.0); - Secondary.resize(nPoint,nPrimVar) = su2double(0.0); - - dPdU.resize(nPoint, nVar) = su2double(0.0); - dTdU.resize(nPoint, nVar) = su2double(0.0); - dTvedU.resize(nPoint, nVar) = su2double(0.0); - Cvves.resize(nPoint, nSpecies) = su2double(0.0); - eves.resize(nPoint, nSpecies) = su2double(0.0); - Gamma.resize(nPoint) = su2double(0.0); - - /*--- Compressible flow, gradients primitive variables ---*/ - Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); - Gradient.resize(nPoint,nVar,nDim,0.0); - - if (config->GetReconstructionGradientRequired()) { - Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); - } - - if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { - Rmatrix.resize(nPoint,nDim,nDim,0.0); - } - - Velocity2.resize(nPoint) = su2double(0.0); - Max_Lambda_Inv.resize(nPoint) = su2double(0.0); - Delta_Time.resize(nPoint) = su2double(0.0); - Lambda.resize(nPoint) = su2double(0.0); - Sensor.resize(nPoint) = su2double(0.0); - - /* Non-physical point (first-order) initialization. */ - Non_Physical.resize(nPoint) = false; - Non_Physical_Counter.resize(nPoint) = 0; - +/*! + * \file CNEMOEulerVariable.cpp + * \brief Definition of the solution fields. + * \author C. Garbacz, W. Maier, S.R. Copeland + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/variables/CNEMOEulerVariable.hpp" +#include + +CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, + const su2double *val_massfrac, + su2double *val_mach, + su2double val_temperature, + su2double val_temperature_ve, + unsigned long npoint, + unsigned long ndim, + unsigned long nvar, + unsigned long nvarprim, + unsigned long nvarprimgrad, + CConfig *config, + CNEMOGas *fluidmodel) : CVariable(npoint, + ndim, + nvar, + config ), + Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { + + vector energies; + unsigned short iDim, iSpecies; + su2double soundspeed, sqvel, rho; + + /*--- Setting variable amounts ---*/ + nDim = ndim; + nPrimVar = nvarprim; + nPrimVarGrad = nvarprimgrad; + + nSpecies = config->GetnSpecies(); + RHOS_INDEX = 0; + T_INDEX = nSpecies; + TVE_INDEX = nSpecies+1; + VEL_INDEX = nSpecies+2; + P_INDEX = nSpecies+nDim+2; + RHO_INDEX = nSpecies+nDim+3; + H_INDEX = nSpecies+nDim+4; + A_INDEX = nSpecies+nDim+5; + RHOCVTR_INDEX = nSpecies+nDim+6; + RHOCVVE_INDEX = nSpecies+nDim+7; + LAM_VISC_INDEX = nSpecies+nDim+8; + EDDY_VISC_INDEX = nSpecies+nDim+9; + + /*--- Set monoatomic flag ---*/ + if (config->GetMonoatomic()) { + monoatomic = true; + Tve_Freestream = config->GetTemperature_ve_FreeStream(); + } + + /*--- Allocate & initialize residual vectors ---*/ + Res_TruncError.resize(nPoint,nVar) = su2double(0.0); + + /*--- Size Grad_AuxVar for axiysmmetric ---*/ + if (config->GetAxisymmetric()){ + nAuxVar = 3; + Grad_AuxVar.resize(nPoint,nAuxVar,nDim,0.0); + AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); + } + + /*--- Only for residual smoothing (multigrid) ---*/ + for (unsigned long iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + if (config->GetMG_CorrecSmooth(iMesh) > 0) { + Residual_Sum.resize(nPoint,nVar); + Residual_Old.resize(nPoint,nVar); + break; + } + } + + /*--- Allocate undivided laplacian (centered) and limiter (upwind)---*/ + if (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) + Undivided_Laplacian.resize(nPoint,nVar); + + /*--- Always allocate the slope limiter, + and the auxiliar variables (check the logic - JST with 2nd order Turb model - ) ---*/ + Limiter.resize(nPoint,nVar) = su2double(0.0); + Limiter_Primitive.resize(nPoint,nPrimVarGrad) = su2double(0.0); + + Solution_Max.resize(nPoint,nPrimVarGrad) = su2double(0.0); + Solution_Min.resize(nPoint,nPrimVarGrad) = su2double(0.0); + + /*--- Primitive and secondary variables ---*/ + Primitive.resize(nPoint,nPrimVar) = su2double(0.0); + Primitive_Aux.resize(nPoint,nPrimVar) = su2double(0.0); + Secondary.resize(nPoint,nPrimVar) = su2double(0.0); + + dPdU.resize(nPoint, nVar) = su2double(0.0); + dTdU.resize(nPoint, nVar) = su2double(0.0); + dTvedU.resize(nPoint, nVar) = su2double(0.0); + Cvves.resize(nPoint, nSpecies) = su2double(0.0); + eves.resize(nPoint, nSpecies) = su2double(0.0); + Gamma.resize(nPoint) = su2double(0.0); + + /*--- Compressible flow, gradients primitive variables ---*/ + Gradient_Primitive.resize(nPoint,nPrimVarGrad,nDim,0.0); + Gradient.resize(nPoint,nVar,nDim,0.0); + + if (config->GetReconstructionGradientRequired()) { + Gradient_Aux.resize(nPoint,nPrimVarGrad,nDim,0.0); + } + + if (config->GetKind_Gradient_Method() == WEIGHTED_LEAST_SQUARES) { + Rmatrix.resize(nPoint,nDim,nDim,0.0); + } + + Velocity2.resize(nPoint) = su2double(0.0); + Max_Lambda_Inv.resize(nPoint) = su2double(0.0); + Delta_Time.resize(nPoint) = su2double(0.0); + Lambda.resize(nPoint) = su2double(0.0); + Sensor.resize(nPoint) = su2double(0.0); + + /* Non-physical point (first-order) initialization. */ + Non_Physical.resize(nPoint) = false; + Non_Physical_Counter.resize(nPoint) = 0; + /* Under-relaxation parameter. */ - UnderRelaxation.resize(nPoint) = su2double(1.0); - LocalCFL.resize(nPoint) = su2double(0.0); - - /*--- Loop over all points --*/ - for(unsigned long iPoint = 0; iPoint < nPoint; ++iPoint){ - - /*--- Reset velocity^2 [m2/s2] to zero ---*/ - sqvel = 0.0; - - /*--- Set mixture state ---*/ - fluidmodel->SetTDStatePTTv(val_pressure, val_massfrac, val_temperature, val_temperature_ve); - - /*--- Compute necessary quantities ---*/ - rho = fluidmodel->GetDensity(); - soundspeed = fluidmodel->ComputeSoundSpeed(); - for (iDim = 0; iDim < nDim; iDim++){ - sqvel += val_mach[iDim]*soundspeed * val_mach[iDim]*soundspeed; - } - energies = fluidmodel->ComputeMixtureEnergies(); - - /*--- Initialize Solution & Solution_Old vectors ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) - Solution(iPoint,iSpecies) = rho*val_massfrac[iSpecies]; - for (iDim = 0; iDim < nDim; iDim++) - Solution(iPoint,nSpecies+iDim) = rho*val_mach[iDim]*soundspeed; - - Solution(iPoint,nSpecies+nDim) = rho*(energies[0]+0.5*sqvel); - Solution(iPoint,nSpecies+nDim+1) = rho*(energies[1]); - - Solution_Old = Solution; - - /*--- Assign primitive variables ---*/ - Primitive(iPoint,T_INDEX) = val_temperature; - Primitive(iPoint,TVE_INDEX) = val_temperature_ve; - Primitive(iPoint,P_INDEX) = val_pressure; - } -} - -void CNEMOEulerVariable::SetVelocity2(unsigned long iPoint) { - - unsigned short iDim; - - Velocity2(iPoint) = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Primitive(iPoint,VEL_INDEX+iDim) = Solution(iPoint,nSpecies+iDim) / Primitive(iPoint,RHO_INDEX); - Velocity2(iPoint) += Solution(iPoint,nSpecies+iDim)*Solution(iPoint,nSpecies+iDim) - / (Primitive(iPoint,RHO_INDEX)*Primitive(iPoint,RHO_INDEX)); - } -} - -bool CNEMOEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) { - - bool nonPhys; - unsigned short iVar; - - fluidmodel = static_cast(FluidModel); - - /*--- Convert conserved to primitive variables ---*/ - nonPhys = Cons2PrimVar(Solution[iPoint], Primitive[iPoint], - dPdU[iPoint], dTdU[iPoint], dTvedU[iPoint], eves[iPoint], Cvves[iPoint]); - - /*--- Reset solution to previous one, if nonphys ---*/ - if (nonPhys) { - for (iVar = 0; iVar < nVar; iVar++) - Solution(iPoint,iVar) = Solution_Old(iPoint,iVar); - } - - /*--- Set additional point quantaties ---*/ - Gamma(iPoint) = fluidmodel->ComputeGamma(); - - SetVelocity2(iPoint); - - return nonPhys; -} - -bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, - su2double *val_dPdU, su2double *val_dTdU, - su2double *val_dTvedU, su2double *val_eves, - su2double *val_Cvves) { - - unsigned short iDim, iSpecies; - su2double Tmin, Tmax, Tvemin, Tvemax; - vector rhos; - - rhos.resize(nSpecies,0.0); - - /*--- Conserved & primitive vector layout ---*/ - // U: [rho1, ..., rhoNs, rhou, rhov, rhow, rhoe, rhoeve]^T - // V: [rho1, ..., rhoNs, T, Tve, u, v, w, P, rho, h, a, rhoCvtr, rhoCvve]^T - - /*--- Set booleans ---*/ - bool nonPhys = false; - - /*--- Set temperature clipping values ---*/ - Tmin = 50.0; Tmax = 8E4; - Tvemin = 50.0; Tvemax = 8E4; - - /*--- Rename variables for convenience ---*/ - su2double rhoE = U[nSpecies+nDim]; // Density * energy [J/m3] - su2double rhoEve = U[nSpecies+nDim+1]; // Density * energy_ve [J/m3] - - /*--- Assign species & mixture density ---*/ - // Note: if any species densities are < 0, these values are re-assigned - // in the primitive AND conserved vectors to ensure positive density - V[RHO_INDEX] = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - if (U[iSpecies] < 0.0) { - U[iSpecies] = 1E-20; - V[RHOS_INDEX+iSpecies] = 1E-20; - rhos[iSpecies] = 1E-20; - //nonPhys = true; - } else { - V[RHOS_INDEX+iSpecies] = U[iSpecies]; - rhos[iSpecies] = U[iSpecies]; - } - V[RHO_INDEX] += U[iSpecies]; - } - - // Rename for convenience - su2double rho = V[RHO_INDEX]; - - /*--- Assign velocity^2 ---*/ - su2double sqvel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - V[VEL_INDEX+iDim] = U[nSpecies+iDim]/V[RHO_INDEX]; - sqvel += V[VEL_INDEX+iDim]*V[VEL_INDEX+iDim]; - } - - /*--- Assign temperatures ---*/ - const auto& T = fluidmodel->ComputeTemperatures(rhos, rhoE, rhoEve, 0.5*rho*sqvel); - - /*--- Temperatures ---*/ - V[T_INDEX] = T[0]; - V[TVE_INDEX] = T[1]; - - // Determine if the temperature lies within the acceptable range - //TODO: fIX THIS - if (V[T_INDEX] == Tmin) { - nonPhys = true; - } else if (V[T_INDEX] == Tmax){ - nonPhys = true; - } - - /*--- Vibrational-Electronic Temperature ---*/ - vector eves_min = fluidmodel->ComputeSpeciesEve(Tvemin); - vector eves_max = fluidmodel->ComputeSpeciesEve(Tvemax); - - // Check for non-physical solutions - if (!monoatomic){ - su2double rhoEve_min = 0.0; - su2double rhoEve_max = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - rhoEve_min += U[iSpecies] * eves_min[iSpecies]; - rhoEve_max += U[iSpecies] * eves_max[iSpecies]; - } - - if (rhoEve < rhoEve_min) { - - nonPhys = true; - V[TVE_INDEX] = Tvemin; - U[nSpecies+nDim+1] = rhoEve_min; - } else if (rhoEve > rhoEve_max) { - nonPhys = true; - V[TVE_INDEX] = Tvemax; - U[nSpecies+nDim+1] = rhoEve_max; - } - } else { - //TODO: can e-modes/vibe modes be active? - V[TVE_INDEX] = Tve_Freestream; - } - - // Determine other properties of the mixture at the current state - fluidmodel->SetTDStateRhosTTv(rhos, V[T_INDEX], V[TVE_INDEX]); - const auto& cvves = fluidmodel->ComputeSpeciesCvVibEle(); - vector eves = fluidmodel->ComputeSpeciesEve(V[TVE_INDEX]); - - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - val_eves[iSpecies] = eves[iSpecies]; - val_Cvves[iSpecies] = cvves[iSpecies]; - } - - su2double rhoCvtr = fluidmodel->ComputerhoCvtr(); - su2double rhoCvve = fluidmodel->ComputerhoCvve(); - - V[RHOCVTR_INDEX] = rhoCvtr; - V[RHOCVVE_INDEX] = rhoCvve; - - /*--- Pressure ---*/ - V[P_INDEX] = fluidmodel->ComputePressure(); - - if (V[P_INDEX] < 0.0) { - V[P_INDEX] = 1E-20; - nonPhys = true; - } - - /*--- Partial derivatives of pressure and temperature ---*/ - fluidmodel->ComputedPdU (V, eves, val_dPdU ); - fluidmodel->ComputedTdU (V, val_dTdU ); - fluidmodel->ComputedTvedU(V, eves, val_dTvedU); - - /*--- Sound speed ---*/ - V[A_INDEX] = fluidmodel->ComputeSoundSpeed(); - - /*--- Enthalpy ---*/ - V[H_INDEX] = (U[nSpecies+nDim] + V[P_INDEX])/V[RHO_INDEX]; - - return nonPhys; -} - -void CNEMOEulerVariable::SetSolution_New() { Solution_New = Solution; } + UnderRelaxation.resize(nPoint) = su2double(1.0); + LocalCFL.resize(nPoint) = su2double(0.0); + + /*--- Loop over all points --*/ + for(unsigned long iPoint = 0; iPoint < nPoint; ++iPoint){ + + /*--- Reset velocity^2 [m2/s2] to zero ---*/ + sqvel = 0.0; + + /*--- Set mixture state ---*/ + fluidmodel->SetTDStatePTTv(val_pressure, val_massfrac, val_temperature, val_temperature_ve); + + /*--- Compute necessary quantities ---*/ + rho = fluidmodel->GetDensity(); + soundspeed = fluidmodel->ComputeSoundSpeed(); + for (iDim = 0; iDim < nDim; iDim++){ + sqvel += val_mach[iDim]*soundspeed * val_mach[iDim]*soundspeed; + } + energies = fluidmodel->ComputeMixtureEnergies(); + + /*--- Initialize Solution & Solution_Old vectors ---*/ + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + Solution(iPoint,iSpecies) = rho*val_massfrac[iSpecies]; + for (iDim = 0; iDim < nDim; iDim++) + Solution(iPoint,nSpecies+iDim) = rho*val_mach[iDim]*soundspeed; + + Solution(iPoint,nSpecies+nDim) = rho*(energies[0]+0.5*sqvel); + Solution(iPoint,nSpecies+nDim+1) = rho*(energies[1]); + + Solution_Old = Solution; + + /*--- Assign primitive variables ---*/ + Primitive(iPoint,T_INDEX) = val_temperature; + Primitive(iPoint,TVE_INDEX) = val_temperature_ve; + Primitive(iPoint,P_INDEX) = val_pressure; + } +} + +void CNEMOEulerVariable::SetVelocity2(unsigned long iPoint) { + + unsigned short iDim; + + Velocity2(iPoint) = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Primitive(iPoint,VEL_INDEX+iDim) = Solution(iPoint,nSpecies+iDim) / Primitive(iPoint,RHO_INDEX); + Velocity2(iPoint) += Solution(iPoint,nSpecies+iDim)*Solution(iPoint,nSpecies+iDim) + / (Primitive(iPoint,RHO_INDEX)*Primitive(iPoint,RHO_INDEX)); + } +} + +bool CNEMOEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) { + + bool nonPhys; + unsigned short iVar; + + fluidmodel = static_cast(FluidModel); + + /*--- Convert conserved to primitive variables ---*/ + nonPhys = Cons2PrimVar(Solution[iPoint], Primitive[iPoint], + dPdU[iPoint], dTdU[iPoint], dTvedU[iPoint], eves[iPoint], Cvves[iPoint]); + + /*--- Reset solution to previous one, if nonphys ---*/ + if (nonPhys) { + for (iVar = 0; iVar < nVar; iVar++) + Solution(iPoint,iVar) = Solution_Old(iPoint,iVar); + } + + /*--- Set additional point quantaties ---*/ + Gamma(iPoint) = fluidmodel->ComputeGamma(); + + SetVelocity2(iPoint); + + return nonPhys; +} + +bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, + su2double *val_dPdU, su2double *val_dTdU, + su2double *val_dTvedU, su2double *val_eves, + su2double *val_Cvves) { + + unsigned short iDim, iSpecies; + su2double Tmin, Tmax, Tvemin, Tvemax; + vector rhos; + + rhos.resize(nSpecies,0.0); + + /*--- Conserved & primitive vector layout ---*/ + // U: [rho1, ..., rhoNs, rhou, rhov, rhow, rhoe, rhoeve]^T + // V: [rho1, ..., rhoNs, T, Tve, u, v, w, P, rho, h, a, rhoCvtr, rhoCvve]^T + + /*--- Set booleans ---*/ + bool nonPhys = false; + + /*--- Set temperature clipping values ---*/ + Tmin = 50.0; Tmax = 8E4; + Tvemin = 50.0; Tvemax = 8E4; + + /*--- Rename variables for convenience ---*/ + su2double rhoE = U[nSpecies+nDim]; // Density * energy [J/m3] + su2double rhoEve = U[nSpecies+nDim+1]; // Density * energy_ve [J/m3] + + /*--- Assign species & mixture density ---*/ + // Note: if any species densities are < 0, these values are re-assigned + // in the primitive AND conserved vectors to ensure positive density + V[RHO_INDEX] = 0.0; + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + if (U[iSpecies] < 0.0) { + U[iSpecies] = 1E-20; + V[RHOS_INDEX+iSpecies] = 1E-20; + rhos[iSpecies] = 1E-20; + //nonPhys = true; + } else { + V[RHOS_INDEX+iSpecies] = U[iSpecies]; + rhos[iSpecies] = U[iSpecies]; + } + V[RHO_INDEX] += U[iSpecies]; + } + + // Rename for convenience + su2double rho = V[RHO_INDEX]; + + /*--- Assign velocity^2 ---*/ + su2double sqvel = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + V[VEL_INDEX+iDim] = U[nSpecies+iDim]/V[RHO_INDEX]; + sqvel += V[VEL_INDEX+iDim]*V[VEL_INDEX+iDim]; + } + + /*--- Assign temperatures ---*/ + const auto& T = fluidmodel->ComputeTemperatures(rhos, rhoE, rhoEve, 0.5*rho*sqvel); + + /*--- Temperatures ---*/ + V[T_INDEX] = T[0]; + V[TVE_INDEX] = T[1]; + + // Determine if the temperature lies within the acceptable range + //TODO: fIX THIS + if (V[T_INDEX] == Tmin) { + nonPhys = true; + } else if (V[T_INDEX] == Tmax){ + nonPhys = true; + } + + /*--- Vibrational-Electronic Temperature ---*/ + vector eves_min = fluidmodel->ComputeSpeciesEve(Tvemin); + vector eves_max = fluidmodel->ComputeSpeciesEve(Tvemax); + + // Check for non-physical solutions + if (!monoatomic){ + su2double rhoEve_min = 0.0; + su2double rhoEve_max = 0.0; + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + rhoEve_min += U[iSpecies] * eves_min[iSpecies]; + rhoEve_max += U[iSpecies] * eves_max[iSpecies]; + } + + if (rhoEve < rhoEve_min) { + + nonPhys = true; + V[TVE_INDEX] = Tvemin; + U[nSpecies+nDim+1] = rhoEve_min; + } else if (rhoEve > rhoEve_max) { + nonPhys = true; + V[TVE_INDEX] = Tvemax; + U[nSpecies+nDim+1] = rhoEve_max; + } + } else { + //TODO: can e-modes/vibe modes be active? + V[TVE_INDEX] = Tve_Freestream; + } + + // Determine other properties of the mixture at the current state + fluidmodel->SetTDStateRhosTTv(rhos, V[T_INDEX], V[TVE_INDEX]); + const auto& cvves = fluidmodel->ComputeSpeciesCvVibEle(); + vector eves = fluidmodel->ComputeSpeciesEve(V[TVE_INDEX]); + + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + val_eves[iSpecies] = eves[iSpecies]; + val_Cvves[iSpecies] = cvves[iSpecies]; + } + + su2double rhoCvtr = fluidmodel->ComputerhoCvtr(); + su2double rhoCvve = fluidmodel->ComputerhoCvve(); + + V[RHOCVTR_INDEX] = rhoCvtr; + V[RHOCVVE_INDEX] = rhoCvve; + + /*--- Pressure ---*/ + V[P_INDEX] = fluidmodel->ComputePressure(); + + if (V[P_INDEX] < 0.0) { + V[P_INDEX] = 1E-20; + nonPhys = true; + } + + /*--- Partial derivatives of pressure and temperature ---*/ + fluidmodel->ComputedPdU (V, eves, val_dPdU ); + fluidmodel->ComputedTdU (V, val_dTdU ); + fluidmodel->ComputedTvedU(V, eves, val_dTvedU); + + /*--- Sound speed ---*/ + V[A_INDEX] = fluidmodel->ComputeSoundSpeed(); + + /*--- Enthalpy ---*/ + V[H_INDEX] = (U[nSpecies+nDim] + V[P_INDEX])/V[RHO_INDEX]; + + return nonPhys; +} + +void CNEMOEulerVariable::SetSolution_New() { Solution_New = Solution; } diff --git a/SU2_CFD/src/variables/CNEMONSVariable.cpp b/SU2_CFD/src/variables/CNEMONSVariable.cpp index 33dfdcae23d9..d8b5066ea294 100644 --- a/SU2_CFD/src/variables/CNEMONSVariable.cpp +++ b/SU2_CFD/src/variables/CNEMONSVariable.cpp @@ -1,142 +1,142 @@ -/*! - * \file CNEMONSVariable.cpp - * \brief Definition of the solution fields. - * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.1.0 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../../include/variables/CNEMONSVariable.hpp" -#include - -CNEMONSVariable::CNEMONSVariable(su2double val_pressure, - const su2double *val_massfrac, - su2double *val_mach, - su2double val_temperature, - su2double val_temperature_ve, - unsigned long npoint, - unsigned long val_ndim, - unsigned long val_nvar, - unsigned long val_nvarprim, - unsigned long val_nvarprimgrad, - CConfig *config, - CNEMOGas *fluidmodel) : CNEMOEulerVariable(val_pressure, - val_massfrac, - val_mach, - val_temperature, - val_temperature_ve, - npoint, - val_ndim, - val_nvar, - val_nvarprim, - val_nvarprimgrad, - config, - fluidmodel) { - - - - Temperature_Ref = config->GetTemperature_Ref(); - Viscosity_Ref = config->GetViscosity_Ref(); - Viscosity_Inf = config->GetViscosity_FreeStreamND(); - Prandtl_Lam = config->GetPrandtl_Lam(); - - DiffusionCoeff.resize(nPoint, nSpecies) = su2double(0.0); - LaminarViscosity.resize(nPoint) = su2double(0.0); - ThermalCond.resize(nPoint) = su2double(0.0); - ThermalCond_ve.resize(nPoint) = su2double(0.0); - - Max_Lambda_Visc.resize(nPoint) = su2double(0.0); - inv_TimeScale = config->GetModVel_FreeStream() / config->GetRefLength(); - - Vorticity.resize(nPoint,3) = su2double(0.0); - StrainMag.resize(nPoint) = su2double(0.0); - Tau_Wall.resize(nPoint) = su2double(-1.0); - DES_LengthScale.resize(nPoint) = su2double(0.0); - Roe_Dissipation.resize(nPoint) = su2double(0.0); - Vortex_Tilting.resize(nPoint) = su2double(0.0); - Max_Lambda_Visc.resize(nPoint) = su2double(0.0); -} - -bool CNEMONSVariable::SetVorticity(void) { - - for (unsigned long iPoint=0; iPoint(FluidModel); - - /*--- Convert conserved to primitive variables ---*/ - nonPhys = Cons2PrimVar(Solution[iPoint], Primitive[iPoint], dPdU[iPoint], dTdU[iPoint], dTvedU[iPoint], eves[iPoint], Cvves[iPoint]); - - /*--- Reset solution to previous one, if nonphys ---*/ - if (nonPhys) { - for (iVar = 0; iVar < nVar; iVar++) - Solution(iPoint,iVar) = Solution_Old(iPoint,iVar); - } - - /*--- Set additional point quantaties ---*/ - Gamma(iPoint) = fluidmodel->ComputeGamma(); - - SetVelocity2(iPoint); - - Ds = fluidmodel->GetDiffusionCoeff(); - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) - DiffusionCoeff(iPoint, iSpecies) = Ds[iSpecies]; - - LaminarViscosity(iPoint) = fluidmodel->GetViscosity(); - - thermalconductivities = fluidmodel->GetThermalConductivities(); - ThermalCond(iPoint) = thermalconductivities[0]; - ThermalCond_ve(iPoint) = thermalconductivities[1]; - - Primitive(iPoint, LAM_VISC_INDEX) = LaminarViscosity(iPoint); - - return nonPhys; -} - - - +/*! + * \file CNEMONSVariable.cpp + * \brief Definition of the solution fields. + * \author C. Garbacz, W. Maier, S.R. Copeland + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/variables/CNEMONSVariable.hpp" +#include + +CNEMONSVariable::CNEMONSVariable(su2double val_pressure, + const su2double *val_massfrac, + su2double *val_mach, + su2double val_temperature, + su2double val_temperature_ve, + unsigned long npoint, + unsigned long val_ndim, + unsigned long val_nvar, + unsigned long val_nvarprim, + unsigned long val_nvarprimgrad, + CConfig *config, + CNEMOGas *fluidmodel) : CNEMOEulerVariable(val_pressure, + val_massfrac, + val_mach, + val_temperature, + val_temperature_ve, + npoint, + val_ndim, + val_nvar, + val_nvarprim, + val_nvarprimgrad, + config, + fluidmodel) { + + + + Temperature_Ref = config->GetTemperature_Ref(); + Viscosity_Ref = config->GetViscosity_Ref(); + Viscosity_Inf = config->GetViscosity_FreeStreamND(); + Prandtl_Lam = config->GetPrandtl_Lam(); + + DiffusionCoeff.resize(nPoint, nSpecies) = su2double(0.0); + LaminarViscosity.resize(nPoint) = su2double(0.0); + ThermalCond.resize(nPoint) = su2double(0.0); + ThermalCond_ve.resize(nPoint) = su2double(0.0); + + Max_Lambda_Visc.resize(nPoint) = su2double(0.0); + inv_TimeScale = config->GetModVel_FreeStream() / config->GetRefLength(); + + Vorticity.resize(nPoint,3) = su2double(0.0); + StrainMag.resize(nPoint) = su2double(0.0); + Tau_Wall.resize(nPoint) = su2double(-1.0); + DES_LengthScale.resize(nPoint) = su2double(0.0); + Roe_Dissipation.resize(nPoint) = su2double(0.0); + Vortex_Tilting.resize(nPoint) = su2double(0.0); + Max_Lambda_Visc.resize(nPoint) = su2double(0.0); +} + +bool CNEMONSVariable::SetVorticity(void) { + + for (unsigned long iPoint=0; iPoint(FluidModel); + + /*--- Convert conserved to primitive variables ---*/ + nonPhys = Cons2PrimVar(Solution[iPoint], Primitive[iPoint], dPdU[iPoint], dTdU[iPoint], dTvedU[iPoint], eves[iPoint], Cvves[iPoint]); + + /*--- Reset solution to previous one, if nonphys ---*/ + if (nonPhys) { + for (iVar = 0; iVar < nVar; iVar++) + Solution(iPoint,iVar) = Solution_Old(iPoint,iVar); + } + + /*--- Set additional point quantaties ---*/ + Gamma(iPoint) = fluidmodel->ComputeGamma(); + + SetVelocity2(iPoint); + + Ds = fluidmodel->GetDiffusionCoeff(); + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + DiffusionCoeff(iPoint, iSpecies) = Ds[iSpecies]; + + LaminarViscosity(iPoint) = fluidmodel->GetViscosity(); + + thermalconductivities = fluidmodel->GetThermalConductivities(); + ThermalCond(iPoint) = thermalconductivities[0]; + ThermalCond_ve(iPoint) = thermalconductivities[1]; + + Primitive(iPoint, LAM_VISC_INDEX) = LaminarViscosity(iPoint); + + return nonPhys; +} + + + diff --git a/SU2_CFD/src/variables/CNSVariable.cpp b/SU2_CFD/src/variables/CNSVariable.cpp index d85f6502dada..98ad4d18adae 100644 --- a/SU2_CFD/src/variables/CNSVariable.cpp +++ b/SU2_CFD/src/variables/CNSVariable.cpp @@ -2,7 +2,7 @@ * \file CNSVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CRadP1Variable.cpp b/SU2_CFD/src/variables/CRadP1Variable.cpp index baaf66f533df..831cbb94d7e0 100644 --- a/SU2_CFD/src/variables/CRadP1Variable.cpp +++ b/SU2_CFD/src/variables/CRadP1Variable.cpp @@ -2,7 +2,7 @@ * \file CRadP1Variable.cpp * \brief Definition of the P1 model variables * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CRadVariable.cpp b/SU2_CFD/src/variables/CRadVariable.cpp index f09aa11593d6..633610f1350b 100644 --- a/SU2_CFD/src/variables/CRadVariable.cpp +++ b/SU2_CFD/src/variables/CRadVariable.cpp @@ -2,7 +2,7 @@ * \file CRadVariable.cpp * \brief Definition of the radiation variables * \author Ruben Sanchez - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTransLMVariable.cpp b/SU2_CFD/src/variables/CTransLMVariable.cpp index 061225fad4c0..f4120afd35d7 100644 --- a/SU2_CFD/src/variables/CTransLMVariable.cpp +++ b/SU2_CFD/src/variables/CTransLMVariable.cpp @@ -2,7 +2,7 @@ * \file CTransLMVariable.cpp * \brief Definition of the solution fields. * \author A. Aranake - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbSAVariable.cpp b/SU2_CFD/src/variables/CTurbSAVariable.cpp index cb84add72d33..9530f1d1be3c 100644 --- a/SU2_CFD/src/variables/CTurbSAVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSAVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbSAVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index 5b725da8e5a4..b6b9fae8dc89 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbSSTVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 6f41ae365ab3..c2e7211c192d 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CVariable.cpp b/SU2_CFD/src/variables/CVariable.cpp index d852d0e210e2..5d16271961d6 100644 --- a/SU2_CFD/src/variables/CVariable.cpp +++ b/SU2_CFD/src/variables/CVariable.cpp @@ -2,7 +2,7 @@ * \file CVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_DEF/include/SU2_DEF.hpp b/SU2_DEF/include/SU2_DEF.hpp index e0cd6911bd86..be5aaf23cbc3 100644 --- a/SU2_DEF/include/SU2_DEF.hpp +++ b/SU2_DEF/include/SU2_DEF.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_DEF. * The subroutines and functions are in the SU2_DEF.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_DEF/obj/Makefile.am b/SU2_DEF/obj/Makefile.am index 4724b670a632..90fdaf0afd35 100644 --- a/SU2_DEF/obj/Makefile.am +++ b/SU2_DEF/obj/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for SU2_DEF # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 3e1310da1da4..ca4b5b2ee6e2 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -2,7 +2,7 @@ * \file SU2_DEF.cpp * \brief Main file of Mesh Deformation Code (SU2_DEF). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_DOT/include/SU2_DOT.hpp b/SU2_DOT/include/SU2_DOT.hpp index 97c0a1f30233..e986ea638ed8 100644 --- a/SU2_DOT/include/SU2_DOT.hpp +++ b/SU2_DOT/include/SU2_DOT.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_DOT. * The subroutines and functions are in the SU2_DOT.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_DOT/obj/Makefile.am b/SU2_DOT/obj/Makefile.am index ad99ef051000..82cfc2f24373 100644 --- a/SU2_DOT/obj/Makefile.am +++ b/SU2_DOT/obj/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for SU2_DOT # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index f57ffd18df3d..0273ff910fd5 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -2,7 +2,7 @@ * \file SU2_DOT.cpp * \brief Main file of the Gradient Projection Code (SU2_DOT). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_GEO/include/SU2_GEO.hpp b/SU2_GEO/include/SU2_GEO.hpp index fe4781bd65b9..7824c67bd592 100644 --- a/SU2_GEO/include/SU2_GEO.hpp +++ b/SU2_GEO/include/SU2_GEO.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_GEO. * The subroutines and functions are in the SU2_GEO.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_GEO/obj/Makefile.am b/SU2_GEO/obj/Makefile.am index a488af60ad05..55a1c1fe852c 100644 --- a/SU2_GEO/obj/Makefile.am +++ b/SU2_GEO/obj/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for SU2_GEO # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index 9bfff3e3fbf0..c640b717455e 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -2,7 +2,7 @@ * \file SU2_GEO.cpp * \brief Main file of the Geometry Definition Code (SU2_GEO). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 9fe034d1e1fa..5fcb809263dd 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -3,7 +3,7 @@ ## \file FSIInterface.py # \brief FSI interface class that handles fluid/solid solvers synchronisation and communication. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index ec8e3c55f34d..f121beaebd9d 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -3,7 +3,7 @@ ## \file FSI_config.py # \brief Python class for handling configuration file for FSI computation. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/SU2_PY/Makefile.am b/SU2_PY/Makefile.am index 82b41fb5c9dd..a14b487b8628 100644 --- a/SU2_PY/Makefile.am +++ b/SU2_PY/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for the SU2 Python framework # \author M. Colonno, T. Economon, F. Palacios, T. Lukaczyk -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/SU2_PY/OptimalPropeller.py b/SU2_PY/OptimalPropeller.py index 12f95067fe4a..82112804ec12 100644 --- a/SU2_PY/OptimalPropeller.py +++ b/SU2_PY/OptimalPropeller.py @@ -1,7 +1,7 @@ ## \file OptimalPropeller.py # \brief Python script for generating the ActuatorDisk.dat file. # \author E. Saetta, L. Russo, R. Tognaccini -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/eval/design.py b/SU2_PY/SU2/eval/design.py index 606c68a28ce3..96e14e0f8753 100644 --- a/SU2_PY/SU2/eval/design.py +++ b/SU2_PY/SU2/eval/design.py @@ -3,7 +3,7 @@ ## \file design.py # \brief python package for designs # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/eval/functions.py b/SU2_PY/SU2/eval/functions.py index b501159da884..7f30df262d97 100644 --- a/SU2_PY/SU2/eval/functions.py +++ b/SU2_PY/SU2/eval/functions.py @@ -3,7 +3,7 @@ ## \file functions.py # \brief python package for functions # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/eval/gradients.py b/SU2_PY/SU2/eval/gradients.py index 0ab65f504438..6b33039e030c 100644 --- a/SU2_PY/SU2/eval/gradients.py +++ b/SU2_PY/SU2/eval/gradients.py @@ -3,7 +3,7 @@ ## \file gradients.py # \brief python package for gradients # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/config.py b/SU2_PY/SU2/io/config.py index 485ace2213a5..242c0b70002c 100755 --- a/SU2_PY/SU2/io/config.py +++ b/SU2_PY/SU2/io/config.py @@ -3,7 +3,7 @@ ## \file config.py # \brief python package for config # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/config_options.py b/SU2_PY/SU2/io/config_options.py index 74fe5e0b663b..e3c24d9227df 100644 --- a/SU2_PY/SU2/io/config_options.py +++ b/SU2_PY/SU2/io/config_options.py @@ -1,7 +1,7 @@ # \file config_options.py # \brief python package for config # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/data.py b/SU2_PY/SU2/io/data.py index 0a018be4e8f9..f0fcb80d10c9 100644 --- a/SU2_PY/SU2/io/data.py +++ b/SU2_PY/SU2/io/data.py @@ -3,7 +3,7 @@ ## \file data.py # \brief python package for data utility functions # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/filelock.py b/SU2_PY/SU2/io/filelock.py index 14a9d5ed4ad5..7bce2934b5e7 100644 --- a/SU2_PY/SU2/io/filelock.py +++ b/SU2_PY/SU2/io/filelock.py @@ -3,7 +3,7 @@ ## \file filelock.py # \brief python package for filelocking # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/redirect.py b/SU2_PY/SU2/io/redirect.py index b973d189a3c1..a5eb3d719874 100644 --- a/SU2_PY/SU2/io/redirect.py +++ b/SU2_PY/SU2/io/redirect.py @@ -3,7 +3,7 @@ ## \file redirect.py # \brief python package for file redirection # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/state.py b/SU2_PY/SU2/io/state.py index be4265640aad..b16e58693e79 100644 --- a/SU2_PY/SU2/io/state.py +++ b/SU2_PY/SU2/io/state.py @@ -3,7 +3,7 @@ ## \file state.py # \brief python package for state # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index 9201256340c8..d03d7bdd1657 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -3,7 +3,7 @@ ## \file tools.py # \brief file i/o functions # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/opt/project.py b/SU2_PY/SU2/opt/project.py index b387bfe1ca17..9b542e0e3e1b 100644 --- a/SU2_PY/SU2/opt/project.py +++ b/SU2_PY/SU2/opt/project.py @@ -3,7 +3,7 @@ ## \file project.py # \brief package for optimization projects # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/opt/scipy_tools.py b/SU2_PY/SU2/opt/scipy_tools.py index 8b49091fa34d..6e96a0f63323 100644 --- a/SU2_PY/SU2/opt/scipy_tools.py +++ b/SU2_PY/SU2/opt/scipy_tools.py @@ -3,7 +3,7 @@ ## \file scipy_tools.py # \brief tools for interfacing with scipy # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/adjoint.py b/SU2_PY/SU2/run/adjoint.py index 43c042056d46..66ba0ad05f60 100644 --- a/SU2_PY/SU2/run/adjoint.py +++ b/SU2_PY/SU2/run/adjoint.py @@ -3,7 +3,7 @@ ## \file adjoint.py # \brief python package for running adjoint problems # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/deform.py b/SU2_PY/SU2/run/deform.py index dd8394f78aff..94f312c07501 100644 --- a/SU2_PY/SU2/run/deform.py +++ b/SU2_PY/SU2/run/deform.py @@ -3,7 +3,7 @@ ## \file deform.py # \brief python package for deforming meshes # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index 54c930a95955..abbeb7ca0c9b 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -3,7 +3,7 @@ ## \file direct.py # \brief python package for running direct solutions # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/geometry.py b/SU2_PY/SU2/run/geometry.py index 311029f75f76..05e9894bd9a5 100644 --- a/SU2_PY/SU2/run/geometry.py +++ b/SU2_PY/SU2/run/geometry.py @@ -3,7 +3,7 @@ ## \file geometry.py # \brief python package for running geometry analyses # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/interface.py b/SU2_PY/SU2/run/interface.py index 2d8f901c0c15..aaba83c626eb 100644 --- a/SU2_PY/SU2/run/interface.py +++ b/SU2_PY/SU2/run/interface.py @@ -3,7 +3,7 @@ ## \file interface.py # \brief python package interfacing with the SU2 suite # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/merge.py b/SU2_PY/SU2/run/merge.py index f035af4a1c35..bfcb3212e08f 100644 --- a/SU2_PY/SU2/run/merge.py +++ b/SU2_PY/SU2/run/merge.py @@ -1,7 +1,7 @@ ## \file merge.py # \brief python package for merging meshes # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/run/projection.py b/SU2_PY/SU2/run/projection.py index c9878404d4cb..0c5d5256862f 100644 --- a/SU2_PY/SU2/run/projection.py +++ b/SU2_PY/SU2/run/projection.py @@ -3,7 +3,7 @@ ## \file projection.py # \brief python package for running gradient projection # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/util/filter_adjoint.py b/SU2_PY/SU2/util/filter_adjoint.py index 0c70cb12f09e..b3971c11b188 100644 --- a/SU2_PY/SU2/util/filter_adjoint.py +++ b/SU2_PY/SU2/util/filter_adjoint.py @@ -3,7 +3,7 @@ ## \file filter_adjoint.py # \brief Applies various filters to the adjoint surface sensitivities of an airfoil # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/util/plot.py b/SU2_PY/SU2/util/plot.py index 50b25bcc9014..5badbb95f55f 100644 --- a/SU2_PY/SU2/util/plot.py +++ b/SU2_PY/SU2/util/plot.py @@ -3,7 +3,7 @@ ## \file plot.py # \brief python package for plotting # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/util/polarSweepLib.py b/SU2_PY/SU2/util/polarSweepLib.py index 6f731a475bf3..a9a56bbf15e9 100755 --- a/SU2_PY/SU2/util/polarSweepLib.py +++ b/SU2_PY/SU2/util/polarSweepLib.py @@ -2,7 +2,7 @@ # \file polarSweepLib.py # \brief Functions library for compute_polar.py script. # \author E Arad -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2/util/which.py b/SU2_PY/SU2/util/which.py index e35b774f2c71..3e7b4069f1b4 100644 --- a/SU2_PY/SU2/util/which.py +++ b/SU2_PY/SU2/util/which.py @@ -3,7 +3,7 @@ ## \file which.py # \brief looks for where a program is # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2_CFD.py b/SU2_PY/SU2_CFD.py index dcfc15e6c578..b376cd4ae35c 100755 --- a/SU2_PY/SU2_CFD.py +++ b/SU2_PY/SU2_CFD.py @@ -3,7 +3,7 @@ ## \file SU2_CFD.py # \brief Python script to launch SU2_CFD through the Python Wrapper. # \author David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index aa83f44c5dd2..00a57fca8229 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -3,7 +3,7 @@ ## \file pysu2_nastran.py # \brief Structural solver using Nastran models # \authors Nicola Fonzi, Vittorio Cavalieri, based on the work of David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/change_version_number.py b/SU2_PY/change_version_number.py index b5245bb1ac9a..2b2699990f5a 100755 --- a/SU2_PY/change_version_number.py +++ b/SU2_PY/change_version_number.py @@ -3,7 +3,7 @@ ## \file change_version_number.py # \brief Python script for updating the version number of the SU2 suite. # \author A. Aranake -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # @@ -44,8 +44,8 @@ #oldvers = '2012-2018' #newvers = '2012-2019' -oldvers = '7.1.0 "Blackbird"' -oldvers_q= r'7.1.0 \"Blackbird\"' +oldvers = '7.1.1 "Blackbird"' +oldvers_q= r'7.1.1 \"Blackbird\"' newvers = str(options.version) + ' "' + str(options.releasename) + '"' newvers_q= str(options.version) + ' \\"' + str(options.releasename) + '\\"' diff --git a/SU2_PY/compute_multipoint.py b/SU2_PY/compute_multipoint.py index f1e7e623f081..667b63a26c94 100755 --- a/SU2_PY/compute_multipoint.py +++ b/SU2_PY/compute_multipoint.py @@ -3,7 +3,7 @@ ## \file Compute_multipoint.py # \brief Python script for performing a multipoint design. # \author Indiana Stokes -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/compute_polar.py b/SU2_PY/compute_polar.py index 979e72ce4b06..779cb70d5612 100755 --- a/SU2_PY/compute_polar.py +++ b/SU2_PY/compute_polar.py @@ -3,7 +3,7 @@ ## \file Compute_polar.py # \brief Python script for performing polar sweep. # \author E Arad (based on T. Lukaczyk and F. Palacios script) -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/compute_stability.py b/SU2_PY/compute_stability.py index b30338ebf38f..0097036e31e8 100755 --- a/SU2_PY/compute_stability.py +++ b/SU2_PY/compute_stability.py @@ -3,7 +3,7 @@ ## \file compute_stability.py # \brief Python script for performing the shape optimization. # \author T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/compute_uncertainty.py b/SU2_PY/compute_uncertainty.py index 43e8142257c0..15d742b97261 100755 --- a/SU2_PY/compute_uncertainty.py +++ b/SU2_PY/compute_uncertainty.py @@ -3,7 +3,7 @@ ## \file compute_uncertainty.py # \brief Python script for performing model-form UQ for SST turbulence model # \author J. Mukhopadhaya -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/config_gui.py b/SU2_PY/config_gui.py index c971864f2c9e..f679e4571d39 100755 --- a/SU2_PY/config_gui.py +++ b/SU2_PY/config_gui.py @@ -3,7 +3,7 @@ ## \file config_gui.py # \brief _____________. # \author A. Aranake -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/continuous_adjoint.py b/SU2_PY/continuous_adjoint.py index a7d5fd810965..ff5cf88589e1 100755 --- a/SU2_PY/continuous_adjoint.py +++ b/SU2_PY/continuous_adjoint.py @@ -3,7 +3,7 @@ ## \file continuous_adjoint.py # \brief Python script for continuous adjoint computation using the SU2 suite. # \author F. Palacios, T. Economon, T. Lukaczyk -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/direct_differentiation.py b/SU2_PY/direct_differentiation.py index d306a45375ab..be42c8669a56 100755 --- a/SU2_PY/direct_differentiation.py +++ b/SU2_PY/direct_differentiation.py @@ -3,7 +3,7 @@ ## \file direct_differentiation.py # \brief Python script for doing the direct differentiation computation using the SU2 suite. # \author F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/discrete_adjoint.py b/SU2_PY/discrete_adjoint.py index 23487ac99608..d05ded79fd04 100755 --- a/SU2_PY/discrete_adjoint.py +++ b/SU2_PY/discrete_adjoint.py @@ -3,7 +3,7 @@ ## \file discrete_adjoint.py # \brief Python script for doing the discrete adjoint computation using the SU2 suite. # \author F. Palacios, T. Economon, T. Lukaczyk -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/finite_differences.py b/SU2_PY/finite_differences.py index 41bd42448cbe..d7df7843a50e 100755 --- a/SU2_PY/finite_differences.py +++ b/SU2_PY/finite_differences.py @@ -3,7 +3,7 @@ ## \file finite_differences.py # \brief Python script for doing the finite differences computation using the SU2 suite. # \author F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/fsi_computation.py b/SU2_PY/fsi_computation.py index 6f246a018c6d..5745571d2ee0 100644 --- a/SU2_PY/fsi_computation.py +++ b/SU2_PY/fsi_computation.py @@ -3,7 +3,7 @@ ## \file fsi_computation.py # \brief Python wrapper code for FSI computation by coupling a third-party structural solver to SU2. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/merge_solution.py b/SU2_PY/merge_solution.py index 6d3247956350..a197c072fe1e 100755 --- a/SU2_PY/merge_solution.py +++ b/SU2_PY/merge_solution.py @@ -3,7 +3,7 @@ ## \file merge_solution.py # \brief Python script for merging of the solution files. # \author F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/mesh_deformation.py b/SU2_PY/mesh_deformation.py index 9898e0f357ae..0024531fdbe8 100755 --- a/SU2_PY/mesh_deformation.py +++ b/SU2_PY/mesh_deformation.py @@ -3,7 +3,7 @@ ## \file mesh_deformation.py # \brief Python script for doing the parallel deformation using SU2_DEF. # \author F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/package_tests.py b/SU2_PY/package_tests.py index 15ffcfede5f6..f638f922f00b 100755 --- a/SU2_PY/package_tests.py +++ b/SU2_PY/package_tests.py @@ -3,7 +3,7 @@ ## \file package_tests.py # \brief _____________. # \author T. Lukaczyk -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/parallel_computation.py b/SU2_PY/parallel_computation.py index 5e1c53fc0186..e1bb5b2fd818 100755 --- a/SU2_PY/parallel_computation.py +++ b/SU2_PY/parallel_computation.py @@ -3,7 +3,7 @@ ## \file parallel_computation.py # \brief Python script for doing the continuous adjoint computation using the SU2 suite. # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/parallel_computation_fsi.py b/SU2_PY/parallel_computation_fsi.py index 59fa50e14975..fb1a24470b65 100755 --- a/SU2_PY/parallel_computation_fsi.py +++ b/SU2_PY/parallel_computation_fsi.py @@ -3,7 +3,7 @@ ## \file parallel_computation_fsi.py # \brief Python script for running FSI simulations using the SU2 suite. # \author T. Economon, T. Lukaczyk, F. Palacios, H. Kline, R. Sanchez -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/parse_config.py b/SU2_PY/parse_config.py index 04436a4875ca..951f0c531380 100755 --- a/SU2_PY/parse_config.py +++ b/SU2_PY/parse_config.py @@ -3,7 +3,7 @@ ## \file parse_config.py # \brief Builds a worksheet of all SU2.cpp options # \author A. Aranake, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/profiling.py b/SU2_PY/profiling.py index 1bb8df589a7d..d09205f7679c 100755 --- a/SU2_PY/profiling.py +++ b/SU2_PY/profiling.py @@ -3,7 +3,7 @@ ## \file profiling.py # \brief Python script for postprocessing the SU2 custom profiling (profiling.csv) # \author T. Economon -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/pySU2/Makefile.am b/SU2_PY/pySU2/Makefile.am index 9d0bff1651f9..75fd1ff3f758 100644 --- a/SU2_PY/pySU2/Makefile.am +++ b/SU2_PY/pySU2/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for the SU2 Python wrapper. # \author D. Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/pySU2/pySU2.i b/SU2_PY/pySU2/pySU2.i index ae4307d4c222..49c9bf1387f3 100644 --- a/SU2_PY/pySU2/pySU2.i +++ b/SU2_PY/pySU2/pySU2.i @@ -4,7 +4,7 @@ # \file pySU2.i # \brief Configuration file for the Swig compilation of the Python wrapper. # \author D. Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/set_ffd_design_var.py b/SU2_PY/set_ffd_design_var.py index 7714b4a6d094..42b1543b52f0 100755 --- a/SU2_PY/set_ffd_design_var.py +++ b/SU2_PY/set_ffd_design_var.py @@ -3,7 +3,7 @@ ## \file set_ffd_design_var.py # \brief Python script for automatically generating a list of FFD variables. # \author T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_PY/shape_optimization.py b/SU2_PY/shape_optimization.py index 07341aecc0bc..e9a119cc395b 100755 --- a/SU2_PY/shape_optimization.py +++ b/SU2_PY/shape_optimization.py @@ -3,7 +3,7 @@ ## \file shape_optimization.py # \brief Python script for performing the shape optimization. # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # @@ -63,7 +63,7 @@ def main(): sys.stdout.write('\n-------------------------------------------------------------------------\n') sys.stdout.write('| ___ _ _ ___ |\n') - sys.stdout.write('| / __| | | |_ ) Release 7.1.0 \"Blackbird\" |\n') + sys.stdout.write('| / __| | | |_ ) Release 7.1.1 \"Blackbird\" |\n') sys.stdout.write('| \\__ \\ |_| |/ / |\n') sys.stdout.write('| |___/\\___//___| Aerodynamic Shape Optimization Script |\n') sys.stdout.write('| |\n') diff --git a/SU2_PY/topology_optimization.py b/SU2_PY/topology_optimization.py index 2ac40841da32..e3d9f2b322f6 100755 --- a/SU2_PY/topology_optimization.py +++ b/SU2_PY/topology_optimization.py @@ -2,7 +2,7 @@ ## \file topology_optimization.py # \brief Python script to drive SU2 in topology optimization. -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/SU2_SOL/include/SU2_SOL.hpp b/SU2_SOL/include/SU2_SOL.hpp index dc75612d0d72..98830420341a 100644 --- a/SU2_SOL/include/SU2_SOL.hpp +++ b/SU2_SOL/include/SU2_SOL.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_SOL. * The subroutines and functions are in the SU2_SOL.cpp file. * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_SOL/obj/Makefile.am b/SU2_SOL/obj/Makefile.am index 0d4d922e5f71..0adac8730146 100644 --- a/SU2_SOL/obj/Makefile.am +++ b/SU2_SOL/obj/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for SU2_SOL # \author M. Colonno, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/SU2_SOL/src/SU2_SOL.cpp b/SU2_SOL/src/SU2_SOL.cpp index 68b4da4e4752..6b191747cafa 100644 --- a/SU2_SOL/src/SU2_SOL.cpp +++ b/SU2_SOL/src/SU2_SOL.cpp @@ -2,7 +2,7 @@ * \file SU2_SOL.cpp * \brief Main file for the solution export/conversion code (SU2_SOL). * \author F. Palacios, T. Economon - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 10907f87fb20..bfba1a8aa8a0 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -3,7 +3,7 @@ ## \file TestCase.py # \brief Python class for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg index e54c2d5e5a2b..4b0e1af21f7f 100644 --- a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg +++ b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Santiago Padron % % Institution: Stanford University % % Date: 07-09-15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg index fa9cadd19f22..8e900c460e8b 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg index 81a4e80be47d..336c812eef1f 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg index 04fc13125f2d..91212cb018da 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg index 8d43458e9a6e..786d4594004d 100644 --- a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2015.08.25 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg index 74273c989ee0..8345cee9d9f1 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg index 7b90ced501ce..5857b07586d5 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg @@ -6,7 +6,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg index 7da2d683a4ac..903168413769 100644 --- a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg index 2f37c5b145ad..0ebb8b70f646 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Jul 18th, 2014 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg index 4db33d41c087..55a1c41fd9b2 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Jul 18th, 2014 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg index d9964fc5fb2b..58120e751a48 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg index 66be5e33e56a..f4d84af47dbc 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg index ebfc62d342cd..c99768abe2fd 100644 --- a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg index f40989f50645..a434b460159a 100644 --- a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/control_surface/inv_ONERAM6_moving.cfg b/TestCases/control_surface/inv_ONERAM6_moving.cfg index a5874ceada3e..9234a2724069 100644 --- a/TestCases/control_surface/inv_ONERAM6_moving.cfg +++ b/TestCases/control_surface/inv_ONERAM6_moving.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/control_surface/inv_ONERAM6_setting.cfg b/TestCases/control_surface/inv_ONERAM6_setting.cfg index 2f1d7ab3023f..244383bc307a 100644 --- a/TestCases/control_surface/inv_ONERAM6_setting.cfg +++ b/TestCases/control_surface/inv_ONERAM6_setting.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/ddes/flatplate/ddes_flatplate.cfg b/TestCases/ddes/flatplate/ddes_flatplate.cfg index d0b564801362..5ebc821109d6 100644 --- a/TestCases/ddes/flatplate/ddes_flatplate.cfg +++ b/TestCases/ddes/flatplate/ddes_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg index a00fcc713080..a5a2b071d5b1 100644 --- a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg +++ b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/naca0012/def_NACA0012.cfg b/TestCases/deformation/naca0012/def_NACA0012.cfg index d13acfebbfdc..237649bcff9d 100644 --- a/TestCases/deformation/naca0012/def_NACA0012.cfg +++ b/TestCases/deformation/naca0012/def_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg index 6d5e142b4410..38c2686b7b66 100644 --- a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg +++ b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/naca4412/def_NACA4412.cfg b/TestCases/deformation/naca4412/def_NACA4412.cfg index cb98b56ecb4e..21574c36151c 100644 --- a/TestCases/deformation/naca4412/def_NACA4412.cfg +++ b/TestCases/deformation/naca4412/def_NACA4412.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.06 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/rae2822/def_RAE2822.cfg b/TestCases/deformation/rae2822/def_RAE2822.cfg index 710c5d2c3088..f335445d7513 100644 --- a/TestCases/deformation/rae2822/def_RAE2822.cfg +++ b/TestCases/deformation/rae2822/def_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/spherical_ffd/def_spherical.cfg b/TestCases/deformation/spherical_ffd/def_spherical.cfg index 2717d372e1c8..76f747ad6fce 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg index 878226806f49..af96e91c9b1f 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg index 0ca25328f85d..ce67c9b4b572 100644 --- a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg +++ b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg @@ -5,7 +5,7 @@ % Author: ___________________________________________________________________ % % Institution: ______________________________________________________________ % % Date: __________ % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg index 0ad3d1d65159..65d3a91bfe73 100644 --- a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_fea/configAD_fem.cfg b/TestCases/disc_adj_fea/configAD_fem.cfg index b6e96e135901..7211b34b5f70 100644 --- a/TestCases/disc_adj_fea/configAD_fem.cfg +++ b/TestCases/disc_adj_fea/configAD_fem.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/disc_adj_fsi/configFEA.cfg b/TestCases/disc_adj_fsi/configFEA.cfg index a06a39fac287..5106c5040754 100644 --- a/TestCases/disc_adj_fsi/configFEA.cfg +++ b/TestCases/disc_adj_fsi/configFEA.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/disc_adj_fsi/configFlow.cfg b/TestCases/disc_adj_fsi/configFlow.cfg index ae108876bd30..5b1d91c1be1e 100644 --- a/TestCases/disc_adj_fsi/configFlow.cfg +++ b/TestCases/disc_adj_fsi/configFlow.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= NAVIER_STOKES diff --git a/TestCases/disc_adj_heat/disc_adj_heat.cfg b/TestCases/disc_adj_heat/disc_adj_heat.cfg index 9f57eda99931..f708e0109516 100644 --- a/TestCases/disc_adj_heat/disc_adj_heat.cfg +++ b/TestCases/disc_adj_heat/disc_adj_heat.cfg @@ -6,7 +6,7 @@ % Author: Ole Burghardt % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: November 26th, 2018 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg index d7fd4a6a180f..e23f83ed9103 100644 --- a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg +++ b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg @@ -4,7 +4,7 @@ % Case description: Subsonic incompressible inviscid flow around a NACA0012 % % Author: Thomas D. Economon % % Date: 2018.10.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index 69485bc41d99..60c8139f98cf 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -4,7 +4,7 @@ % Case description: Steady incompressible laminar flow past a heated cylinder % % Author: Thomas D. Economon % % Date: 2018.06.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg index b6591fef723f..919ce23a2e18 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg @@ -5,7 +5,7 @@ % http://turbmodels.larc.nasa.gov/naca0012_val_sa.html % % Author: Thomas D. Economon & Francisco Palacios % % Date: 2018.06.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg index d615f549ff2e..6393a25ea83f 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg @@ -5,7 +5,7 @@ % http://turbmodels.larc.nasa.gov/naca0012_val_sst.html % % Author: Thomas D. Economon & Francisco Palacios % % Date: 2018.06.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/naca0012/naca0012.cfg b/TestCases/disc_adj_rans/naca0012/naca0012.cfg index d09767d292aa..4c9a1e86b7af 100644 --- a/TestCases/disc_adj_rans/naca0012/naca0012.cfg +++ b/TestCases/disc_adj_rans/naca0012/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/CRM/inv_CRM_JST.cfg b/TestCases/euler/CRM/inv_CRM_JST.cfg index 714e87e96195..336a3de04244 100644 --- a/TestCases/euler/CRM/inv_CRM_JST.cfg +++ b/TestCases/euler/CRM/inv_CRM_JST.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/biparabolic/BIPARABOLIC.cfg b/TestCases/euler/biparabolic/BIPARABOLIC.cfg index d4e82c83bdb6..44c033f35678 100644 --- a/TestCases/euler/biparabolic/BIPARABOLIC.cfg +++ b/TestCases/euler/biparabolic/BIPARABOLIC.cfg @@ -5,7 +5,7 @@ % Author: Trent W. Lukaczyk % % Institution: Stanford University % % Date: 2012.08.16 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/channel/inv_channel.cfg b/TestCases/euler/channel/inv_channel.cfg index fc12e26bec1c..5f6d169a93b4 100644 --- a/TestCases/euler/channel/inv_channel.cfg +++ b/TestCases/euler/channel/inv_channel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/channel/inv_channel_RK.cfg b/TestCases/euler/channel/inv_channel_RK.cfg index 25f1bab40560..f51a9465ebaa 100644 --- a/TestCases/euler/channel/inv_channel_RK.cfg +++ b/TestCases/euler/channel/inv_channel_RK.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/naca0012/inv_NACA0012.cfg b/TestCases/euler/naca0012/inv_NACA0012.cfg index e1a1d45112db..e09e6d323a61 100644 --- a/TestCases/euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg index 645dac16c571..c3e78b809b70 100644 --- a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/oneram6/inv_ONERAM6.cfg b/TestCases/euler/oneram6/inv_ONERAM6.cfg index b70c03b4f421..994d0972a4fc 100644 --- a/TestCases/euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2015.08.25 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/wedge/inv_wedge_HLLC.cfg b/TestCases/euler/wedge/inv_wedge_HLLC.cfg index 4941d153bbc1..1ca52a45772a 100644 --- a/TestCases/euler/wedge/inv_wedge_HLLC.cfg +++ b/TestCases/euler/wedge/inv_wedge_HLLC.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg index a0254de7d6e4..9d8608e5a646 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 2D airfoil FSI with radial basis function interp. % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg index 3f3849f89944..97d415216b04 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 2D airfoil FSI with radial basis function interp. % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % diff --git a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg index c9444eec576a..bee4b761f66e 100644 --- a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg +++ b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg @@ -4,7 +4,7 @@ % Author: Ruben Sanchez Fernandez % % Institution: Imperial College London % % Date: 2016.02.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/fea_fsi/MixElemsKnowles/config.cfg b/TestCases/fea_fsi/MixElemsKnowles/config.cfg index c18c69d3b282..a983d3c69fa7 100644 --- a/TestCases/fea_fsi/MixElemsKnowles/config.cfg +++ b/TestCases/fea_fsi/MixElemsKnowles/config.cfg @@ -4,7 +4,7 @@ % Case description: Tip-loaded 3D cantilever beam, mix of element types, % % nonlinear elasticity with Knowles material model. % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg index d1ea8003c908..40aadb1cb70e 100644 --- a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg +++ b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg @@ -4,7 +4,7 @@ % Author: Ruben Sanchez Fernandez % % Institution: Imperial College London % % Date: 2016.02.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/fea_topology/config.cfg b/TestCases/fea_topology/config.cfg index 94c1e956f3f8..e541c15a1847 100644 --- a/TestCases/fea_topology/config.cfg +++ b/TestCases/fea_topology/config.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 4 by 1 cantilever optim. for stiff. @ 50% material % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Optimization diff --git a/TestCases/gust/inv_gust_NACA0012.cfg b/TestCases/gust/inv_gust_NACA0012.cfg index c3d44d246925..17d8ec72dbb2 100644 --- a/TestCases/gust/inv_gust_NACA0012.cfg +++ b/TestCases/gust/inv_gust_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Santiago Padron % % Institution: Stanford University % % Date: 06-26-2015 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/harmonic_balance/HB.cfg b/TestCases/harmonic_balance/HB.cfg index a944f9383b76..9dfcb122b4a0 100644 --- a/TestCases/harmonic_balance/HB.cfg +++ b/TestCases/harmonic_balance/HB.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.20.09 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg index 1c2e5908ae29..5ee0581dd9e4 100644 --- a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg +++ b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.20.09 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg index f0c08c377578..3ae0b6beb02c 100644 --- a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg index 8d0218250412..18140671830b 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg index 17297d1ed8de..c6b91e727d56 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg index 78d4ec2b022d..e16acb081631 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg index 3aa873d3a7d0..6bace675413c 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg index 3bce52ca758d..de36771e9734 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg index a6031c6ef54b..55ee0a156fc8 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg index eeacdcd6a64d..d92e605ee0fa 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg index 30f2279fb85b..eabc7275c6f9 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg index 88702865987f..31c47cb59ca7 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg index c16ab4b6d79c..84aad1673eed 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg index b952e1a2a192..002ef01668b9 100644 --- a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg +++ b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg @@ -5,7 +5,7 @@ % Author: Edwin van der Weide % % Institution: University of Twente % % Date: 2016.07.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg index 28bb98b8065c..0dd054528862 100644 --- a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg +++ b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg index 81902a5478ad..50e605568edc 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg @@ -5,7 +5,7 @@ % Author: Edwin van der Weide % % Institution: University of Twente % % Date: 2016.07.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg index 3547f2855bd2..71c22aa583eb 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg index 9ed040ca9339..40de22f80662 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg index 1d01d02f5260..744417f1a5c0 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index d69473c646ff..9e418b76b806 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg index f8c1dd91eb56..cb374e90f6b0 100644 --- a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg +++ b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 09/18/2011 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg index c5b6e21df541..20b639b8d86d 100644 --- a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg +++ b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg @@ -4,7 +4,7 @@ % Case description: Inv. inc. nozzle with pressure inlet and mass flow outlet % % Author: Thomas D. Economon % % Date: 2018.11.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 8f07b27a0640..474e719298ac 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -4,7 +4,7 @@ % Case description: Buoyancy-driven flow inside a cavity % % Author: Thomas D. Economon % % Date: 2018.06.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg index c50c80d42c39..2817c9327001 100644 --- a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2012.03.14 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index 99f14c72867a..17438af462b1 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -5,7 +5,7 @@ % custom fluid using polynomial fluid models. % % Author: Thomas D. Economon % % Date: 2018.12.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index 936f08747a18..ebe8ec21332e 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 9c29fb99e4e4..63ca0b64f309 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 111367a0e1a6..f452de8088b3 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index fa52f63e3f95..3b49b93125e3 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg index 7ef30f52a04f..b7ef1fa5a759 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 07.06.2019 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index 621ec559cd66..fac9c99f4c64 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index c4eb21b915c3..a1362711f77c 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 07.06.2019 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index ffba18c797fc..249beb91e714 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.14 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_rans/naca0012/naca0012.cfg b/TestCases/incomp_rans/naca0012/naca0012.cfg index b49ec5a95c7b..5cd1ee3b0ad6 100644 --- a/TestCases/incomp_rans/naca0012/naca0012.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg index a4861b05b814..73392f31c69a 100644 --- a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg index d8331a7080a3..e52d87969f93 100755 --- a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg +++ b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg @@ -4,7 +4,7 @@ % Case description: Incompressible inviscid MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index 20a25bbd8aad..a361a2e79337 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -4,7 +4,7 @@ % Case description: Incompressible laminar MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg index a55057a7b202..a571fe895620 100755 --- a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg +++ b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg @@ -4,7 +4,7 @@ % Case description: Compressible laminar MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/moving_wall/cavity/lam_cavity.cfg b/TestCases/moving_wall/cavity/lam_cavity.cfg index f6f7378821e0..dd68814dc411 100644 --- a/TestCases/moving_wall/cavity/lam_cavity.cfg +++ b/TestCases/moving_wall/cavity/lam_cavity.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.10.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg index 534193074e4e..88af508918ad 100644 --- a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg +++ b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.08.21 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg index 9b28228fc943..805bc7130663 100644 --- a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg +++ b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Charanya Venkatesan-Crome % % Institution: Stanford University % % Date: 2018.07.23 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg index db91c5d4bdd7..de990f8c2257 100644 --- a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg +++ b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/cylinder/lam_cylinder.cfg b/TestCases/navierstokes/cylinder/lam_cylinder.cfg index 9672ff6f3e05..b5e7d9cc60df 100644 --- a/TestCases/navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/navierstokes/cylinder/lam_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/flatplate/lam_flatplate.cfg b/TestCases/navierstokes/flatplate/lam_flatplate.cfg index 5712c970bff2..7b470bd118d5 100644 --- a/TestCases/navierstokes/flatplate/lam_flatplate.cfg +++ b/TestCases/navierstokes/flatplate/lam_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg index 3e144f7e2373..9545f582201d 100644 --- a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg +++ b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Sep 28, 2012 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index 01d165056d02..0aba572cd340 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2017.02.27 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/edge/edge_PPR.cfg b/TestCases/nicf/edge/edge_PPR.cfg index d14295477209..c0924e6b1392 100644 --- a/TestCases/nicf/edge/edge_PPR.cfg +++ b/TestCases/nicf/edge/edge_PPR.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/edge/edge_VW.cfg b/TestCases/nicf/edge/edge_VW.cfg index 3b068bd61bbe..2a2e2bbcace4 100644 --- a/TestCases/nicf/edge/edge_VW.cfg +++ b/TestCases/nicf/edge/edge_VW.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge.cfg b/TestCases/nonequilibrium/invwedge/invwedge.cfg index f783a7fb7995..bedfd32f6c75 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge.cfg @@ -5,7 +5,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2020.11.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/viscwedge/viscwedge.cfg b/TestCases/nonequilibrium/viscwedge/viscwedge.cfg index 1a70c0273917..df60ff248c24 100644 --- a/TestCases/nonequilibrium/viscwedge/viscwedge.cfg +++ b/TestCases/nonequilibrium/viscwedge/viscwedge.cfg @@ -5,7 +5,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2020.11.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg b/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg index d81488cc453d..b230e52a280f 100644 --- a/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg +++ b/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg @@ -5,7 +5,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2020.11.01 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg index 41cd1505c4e3..75081c5600de 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg @@ -7,7 +7,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg index 40d5597280de..94ebce1f915e 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg @@ -8,7 +8,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg index a4165b7d9dc2..322bee977cc7 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg @@ -8,7 +8,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg index 8affe19a7dbf..a724e5c6d185 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg @@ -10,7 +10,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg index da556c2ab1c3..bcc583531343 100644 --- a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg +++ b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg @@ -5,7 +5,7 @@ % Author: Indiana Stokes % % Institution: % % Date: 2017.07.03 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg index f5fa022f1b4e..c5eb434078de 100644 --- a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg +++ b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg index d9ca2a72dd7a..5e148350c5bd 100644 --- a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg +++ b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg index 83801d29d8c5..b139c62ffee4 100644 --- a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg +++ b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.06 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg index b9778401b9e1..6226b16062c8 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2013.09.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg index bbc1cdd2c9b1..856ce0717353 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2013.09.29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg index 3d65a14543a1..b183a7738f30 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg index 4a95a416992b..7058184e15be 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/naca0012/naca0012.cfg b/TestCases/optimization_rans/naca0012/naca0012.cfg index 1d1eaec533db..2d0c373a422a 100644 --- a/TestCases/optimization_rans/naca0012/naca0012.cfg +++ b/TestCases/optimization_rans/naca0012/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg index 082307c57eba..15f61229e8be 100644 --- a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg +++ b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg index bcd5b3afab39..02dc5dd64800 100644 --- a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg index 8c90a847c612..a078945f5cec 100644 --- a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg index 2c377163067d..99c6487b5b79 100644 --- a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 489db0f20d5c..0ac0942e97ab 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 6cd67b598a0d..26b4a8b461ee 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/pastix_support/config.cfg b/TestCases/pastix_support/config.cfg index bbfab201580c..e119d21b9c33 100644 --- a/TestCases/pastix_support/config.cfg +++ b/TestCases/pastix_support/config.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % PaStiX options (http://pastix.gforge.inria.fr/files/README-txt.html) % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Intro: diff --git a/TestCases/pastix_support/readme.txt b/TestCases/pastix_support/readme.txt index e8d264b97b6d..17f832ae302d 100644 --- a/TestCases/pastix_support/readme.txt +++ b/TestCases/pastix_support/readme.txt @@ -2,7 +2,7 @@ % SU2 configuration file % % PaStiX support build instructions. % % Institution: Imperial College London % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 1 - Download diff --git a/TestCases/polar/naca0012/inv_NACA0012.cfg b/TestCases/polar/naca0012/inv_NACA0012.cfg index 00881bf58dde..9832313a221e 100644 --- a/TestCases/polar/naca0012/inv_NACA0012.cfg +++ b/TestCases/polar/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py index fe244e692f65..18870e67fe94 100755 --- a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py +++ b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py @@ -3,7 +3,7 @@ ## \file run_adjoint.py # \brief Python script to launch SU2_CFD_AD and compute the sensitivity of the FEA problem respect to flow loads. # \author Ruben Sanchez -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py index 752458d3a967..88ce70e31123 100755 --- a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py +++ b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py @@ -3,7 +3,7 @@ ## \file run_adjoint.py # \brief Python script to launch SU2_CFD_AD # \author Ruben Sanchez -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index faece71a8edd..cc1dc0b3e6e3 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -5,7 +5,7 @@ % Author: ___________________________________________________________________ % % Institution: ______________________________________________________________ % % Date: __________ % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index a611e6554d79..e2a1d13f326f 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -3,7 +3,7 @@ ## \file flatPlate_rigidMotion.py # \brief Python script to launch SU2_CFD with customized unsteady boundary conditions using the Python wrapper. # \author David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py index 06a3edd2b7eb..d58968b03228 100755 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py @@ -3,7 +3,7 @@ ## \file launch_unsteady_CHT_FlatPlate.py # \brief Python script to launch SU2_CFD with customized unsteady boundary conditions using the Python wrapper. # \author David Thomas -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # The current SU2 release has been coordinated by the # SU2 International Developers Society diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index e6f06d2b8056..c1781b361eaa 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -5,7 +5,7 @@ % Author: David THOMAS % % Institution: University of Liège % % Date: 12/12/2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/radiation/p1adjoint/configp1adjoint.cfg b/TestCases/radiation/p1adjoint/configp1adjoint.cfg index 7dfb6926bfee..a544cb86437d 100644 --- a/TestCases/radiation/p1adjoint/configp1adjoint.cfg +++ b/TestCases/radiation/p1adjoint/configp1adjoint.cfg @@ -4,7 +4,7 @@ % Case description: Coupled CFD-RHT adjoint problem % % Author: Ruben Sanchez (TU Kaiserslautern) % % Date: 2020-02-13 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/radiation/p1model/configp1.cfg b/TestCases/radiation/p1model/configp1.cfg index b5a60a0ffccd..35cfe695db11 100644 --- a/TestCases/radiation/p1model/configp1.cfg +++ b/TestCases/radiation/p1model/configp1.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: 2019-01-29 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg b/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg index 2c3097ba04b0..7e2c33b9873f 100644 --- a/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg +++ b/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg @@ -1,237 +1,237 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Actuator Disk with a semi-infinite spinner % -% Author: E. Saetta, L. Russo, R. Tognaccini % -% Institution: Theoretical and Applied Aerodynamic Research Group (TAARG) % -% University of Naples Federico II % -% Comments: Grid file and propeller data courtesy of Mauro Minervino, % -% Centro Italiano Ricerche Aerospaziali (CIRA) % -% Date: 07/08/2020 % -% File Version 7.1.0 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%----------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION -------------------------% -% Solver type (EULER, NAVIER_STOKES, RANS, -% INC_EULER, INC_NAVIER_STOKES, INC_RANS -% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, -% HEAT_EQUATION_FVM, ELASTICITY) -SOLVER= RANS -% -% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) -KIND_TURB_MODEL= SA -% -% Turbulence intensity at freestream -FREESTREAM_TURBULENCEINTENSITY=0.01 -% -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) -MATH_PROBLEM= DIRECT -% -% Restart solution (NO, YES) -RESTART_SOL= NO -% -% System of measurements (SI, US) -% International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, -% Density = kg/m^3, Speed = m/s, -% Equiv. Area = m^2 ) -SYSTEM_MEASUREMENTS= SI -% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% -% Mach number (non-dimensional, based on the free-stream values) -MACH_NUMBER= 0.55996 -% -% Angle of attack (degrees, only for compressible flows) -AOA= 0.0 -% -% Side-slip angle (degrees, only for compressible flows) -SIDESLIP_ANGLE= 0.0 -% -% Reynolds number (non-dimensional, based on the free-stream values) -REYNOLDS_NUMBER= 3.65E7 -% -% Reynolds length (1 m, 1 inch by default) -REYNOLDS_LENGTH= 5.0292 -% -% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% -% Reference origin for moment computation (m or in) -REF_ORIGIN_MOMENT_X = 0.0 -REF_ORIGIN_MOMENT_Y = 0.0 -REF_ORIGIN_MOMENT_Z = 0.0 -% -% Reference length for moment non-dimensional coefficients (m or in) -REF_LENGTH= 1.0 -% -% Reference area for non-dimensional force coefficients (0 implies automatic -% calculation) (m^2 or in^2) -REF_AREA= 19.8649 -% -% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, -% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) -REF_DIMENSIONALIZATION= DIMENSIONAL -% -% --------------- ENGINE AND ACTUATOR DISK SIMULATION -------------------------% -% Highlite area to compute MFR (1 in by default) -HIGHLITE_AREA= 19.8649 -% -% Engine nu factor (SA model). -ENGINE_NU_FACTOR= 0.0 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -ACTDISK_DOUBLE_SURFACE = YES -% -% Actuator disk boundary type (VARIABLE_LOAD, VARIABLES_JUMP, BC_THRUST, -% DRAG_MINUS_THRUST) -ACTDISK_TYPE= VARIABLE_LOAD -% -% Actuator disk data input file name -ACTDISK_FILENAME= ActuatorDisk.dat -% -% Actuator disk boundary marker(s) with the following formats (NONE = no marker) -% Variable Load: (inlet face marker, outlet face marker, -% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) Markers only effectively used. -MARKER_ACTDISK = ( DISK, DISK_BACK, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) -% -% Far-field boundary marker(s) (NONE = no marker) -MARKER_FAR= ( FF ) -% -% Outlet boundary marker(s) (NONE = no marker) -% Compressible: ( outlet marker, back pressure (static thermodynamic), ... ) -MARKER_OUTLET = ( OUT , 56370.2) -% -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -MARKER_HEATFLUX = (SPINNER, 0.0) -% -% ------------------------ SURFACES IDENTIFICATION ----------------------------% -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING = ( DISK, DISK_BACK, SPINNER ) -% -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. -MARKER_MONITORING = ( DISK, DISK_BACK, SPINNER ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) -MARKER_ANALYZE = ( DISK, DISK_BACK ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). -MARKER_ANALYZE_AVERAGE = MASSFLUX -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) -NUM_METHOD_GRAD= GREEN_GAUSS -% -% CFL number (initial value for the adaptive CFL number) -CFL_NUMBER= 20.0 -% -% Adaptive CFL number (NO, YES) -CFL_ADAPT= NO -% -% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, -% MOMENT_Y, MOMENT_Z, EFFICIENCY, BUFFET, -% EQUIVALENT_AREA, NEARFIELD_PRESSURE, -% FORCE_X, FORCE_Y, FORCE_Z, THRUST, -% TORQUE, TOTAL_HEATFLUX, -% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, -% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) -% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. -OBJECTIVE_FUNCTION= DRAG -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. -LINEAR_SOLVER= FGMRES -% -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) -LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations -LINEAR_SOLVER_ERROR= 1E-12 -% -% Max number of iterations of the linear solver for the implicit formulation -LINEAR_SOLVER_ITER= 3 -% -% Number of elements to apply the criteria -CONV_CAUCHY_ELEMS= 1000 -% -% Epsilon to control the series convergence -CONV_CAUCHY_EPS= 1E-10 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, -% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) -CONV_NUM_METHOD_FLOW= JST -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% Convective numerical method (SCALAR_UPWIND) -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_TURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -% -% Time discretization (EULER_IMPLICIT) -TIME_DISCRE_TURB= EULER_IMPLICIT -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% Maximum number of iterations -ITER= 1500 -% -% Convergence criteria (CAUCHY, RESIDUAL) -CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) -CONV_RESIDUAL_MINVAL= -8 -% -% Start convergence criteria at iteration number -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% Mesh input file -MESH_FILENAME= propeller_variable_load.su2 -% -% Mesh input file format (SU2, CGNS) -MESH_FORMAT= SU2 -% -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= restart_flow.dat -% -% Output tabular file format (TECPLOT, CSV) -TABULAR_FORMAT= TECPLOT -% -% Output file convergence history (w/o extension) -CONV_FILENAME= history -% -% Write the forces breakdown file option (NO, YES) -WRT_FORCES_BREAKDOWN= YES -% -% Output file with the forces breakdown -BREAKDOWN_FILENAME= forces_breakdown.dat -% -% Output file restart flow -RESTART_FILENAME= restart_flow.dat -% -% Output file flow (w/o extension) variables -VOLUME_FILENAME= flow -% -% Output file surface flow coefficient (w/o extension) -SURFACE_FILENAME= surface_flow -% -% Writing solution file frequency -OUTPUT_WRT_FREQ= 250 -% -% -% -% -% Screen output fields -SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Actuator Disk with a semi-infinite spinner % +% Author: E. Saetta, L. Russo, R. Tognaccini % +% Institution: Theoretical and Applied Aerodynamic Research Group (TAARG) % +% University of Naples Federico II % +% Comments: Grid file and propeller data courtesy of Mauro Minervino, % +% Centro Italiano Ricerche Aerospaziali (CIRA) % +% Date: 07/08/2020 % +% File Version 7.1.1 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%----------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION -------------------------% +% Solver type (EULER, NAVIER_STOKES, RANS, +% INC_EULER, INC_NAVIER_STOKES, INC_RANS +% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, +% HEAT_EQUATION_FVM, ELASTICITY) +SOLVER= RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +KIND_TURB_MODEL= SA +% +% Turbulence intensity at freestream +FREESTREAM_TURBULENCEINTENSITY=0.01 +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= NO +% +% System of measurements (SI, US) +% International system of units (SI): ( meters, kilograms, Kelvins, +% Newtons = kg m/s^2, Pascals = N/m^2, +% Density = kg/m^3, Speed = m/s, +% Equiv. Area = m^2 ) +SYSTEM_MEASUREMENTS= SI +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 0.55996 +% +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% +% Side-slip angle (degrees, only for compressible flows) +SIDESLIP_ANGLE= 0.0 +% +% Reynolds number (non-dimensional, based on the free-stream values) +REYNOLDS_NUMBER= 3.65E7 +% +% Reynolds length (1 m, 1 inch by default) +REYNOLDS_LENGTH= 5.0292 +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% Reference origin for moment computation (m or in) +REF_ORIGIN_MOMENT_X = 0.0 +REF_ORIGIN_MOMENT_Y = 0.0 +REF_ORIGIN_MOMENT_Z = 0.0 +% +% Reference length for moment non-dimensional coefficients (m or in) +REF_LENGTH= 1.0 +% +% Reference area for non-dimensional force coefficients (0 implies automatic +% calculation) (m^2 or in^2) +REF_AREA= 19.8649 +% +% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, +% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) +REF_DIMENSIONALIZATION= DIMENSIONAL +% +% --------------- ENGINE AND ACTUATOR DISK SIMULATION -------------------------% +% Highlite area to compute MFR (1 in by default) +HIGHLITE_AREA= 19.8649 +% +% Engine nu factor (SA model). +ENGINE_NU_FACTOR= 0.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +ACTDISK_DOUBLE_SURFACE = YES +% +% Actuator disk boundary type (VARIABLE_LOAD, VARIABLES_JUMP, BC_THRUST, +% DRAG_MINUS_THRUST) +ACTDISK_TYPE= VARIABLE_LOAD +% +% Actuator disk data input file name +ACTDISK_FILENAME= ActuatorDisk.dat +% +% Actuator disk boundary marker(s) with the following formats (NONE = no marker) +% Variable Load: (inlet face marker, outlet face marker, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) Markers only effectively used. +MARKER_ACTDISK = ( DISK, DISK_BACK, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) +% +% Far-field boundary marker(s) (NONE = no marker) +MARKER_FAR= ( FF ) +% +% Outlet boundary marker(s) (NONE = no marker) +% Compressible: ( outlet marker, back pressure (static thermodynamic), ... ) +MARKER_OUTLET = ( OUT , 56370.2) +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX = (SPINNER, 0.0) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING = ( DISK, DISK_BACK, SPINNER ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING = ( DISK, DISK_BACK, SPINNER ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( DISK, DISK_BACK ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 20.0 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, +% MOMENT_Y, MOMENT_Z, EFFICIENCY, BUFFET, +% EQUIVALENT_AREA, NEARFIELD_PRESSURE, +% FORCE_X, FORCE_Y, FORCE_Z, THRUST, +% TORQUE, TOTAL_HEATFLUX, +% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, +% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, +% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) +% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. +OBJECTIVE_FUNCTION= DRAG +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-12 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 3 +% +% Number of elements to apply the criteria +CONV_CAUCHY_ELEMS= 1000 +% +% Epsilon to control the series convergence +CONV_CAUCHY_EPS= 1E-10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, +% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +CONV_NUM_METHOD_FLOW= JST +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% Maximum number of iterations +ITER= 1500 +% +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -8 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% Mesh input file +MESH_FILENAME= propeller_variable_load.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FILENAME= restart_flow.dat +% +% Output tabular file format (TECPLOT, CSV) +TABULAR_FORMAT= TECPLOT +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Write the forces breakdown file option (NO, YES) +WRT_FORCES_BREAKDOWN= YES +% +% Output file with the forces breakdown +BREAKDOWN_FILENAME= forces_breakdown.dat +% +% Output file restart flow +RESTART_FILENAME= restart_flow.dat +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 250 +% +% +% +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/rans/flatplate/turb_SA_flatplate.cfg b/TestCases/rans/flatplate/turb_SA_flatplate.cfg index 52762ef7167e..c2adda14f573 100644 --- a/TestCases/rans/flatplate/turb_SA_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SA_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/flatplate/turb_SST_flatplate.cfg b/TestCases/rans/flatplate/turb_SST_flatplate.cfg index 6f38e571850a..77b8f8f61ccf 100644 --- a/TestCases/rans/flatplate/turb_SST_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SST_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg index e11452f40596..71227c60c0e4 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg @@ -6,7 +6,7 @@ % Author: David E. Manosalvas % % Institution: Stanford University % % Date: 02.14.2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/oneram6/turb_ONERAM6.cfg b/TestCases/rans/oneram6/turb_ONERAM6.cfg index 046f93463e6c..e7229150f0ec 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.14 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg index 371ebb933d5a..63bea2013395 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Turbulent flow, ONERA M6, Newton-Krylov solver % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/propeller/propeller.cfg b/TestCases/rans/propeller/propeller.cfg index 2ddb5835d796..99ee5a22d9ec 100644 --- a/TestCases/rans/propeller/propeller.cfg +++ b/TestCases/rans/propeller/propeller.cfg @@ -5,7 +5,7 @@ % Author: % % Institution: % % Date: % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg index e7cd0b9fe8cb..ce48b26de819 100644 --- a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg index 6671d4163914..e0d4b5239f7c 100644 --- a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg index 725d764efcc2..ccb93d4e65a8 100644 --- a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/restart_directdiff_naca/naca0012.cfg b/TestCases/rans/restart_directdiff_naca/naca0012.cfg index e5a4bf5e851c..a6f7452d55c8 100644 --- a/TestCases/rans/restart_directdiff_naca/naca0012.cfg +++ b/TestCases/rans/restart_directdiff_naca/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/s809/trans_s809.cfg b/TestCases/rans/s809/trans_s809.cfg index 09efbc7ee426..3aabee6d8531 100644 --- a/TestCases/rans/s809/trans_s809.cfg +++ b/TestCases/rans/s809/trans_s809.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/s809/turb_S809.cfg b/TestCases/rans/s809/turb_S809.cfg index 1f01e8f6079b..6e4cbf0a0c16 100644 --- a/TestCases/rans/s809/turb_S809.cfg +++ b/TestCases/rans/s809/turb_S809.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/vki_turbine/turb_vki.cfg b/TestCases/rans/vki_turbine/turb_vki.cfg index f800446a4414..984f2abc149c 100644 --- a/TestCases/rans/vki_turbine/turb_vki.cfg +++ b/TestCases/rans/vki_turbine/turb_vki.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg index 9136aefef335..310939f2d5a4 100644 --- a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg +++ b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2020.05.24 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rotating/naca0012/rot_NACA0012.cfg b/TestCases/rotating/naca0012/rot_NACA0012.cfg index af4b128969a7..63f3c151f216 100644 --- a/TestCases/rotating/naca0012/rot_NACA0012.cfg +++ b/TestCases/rotating/naca0012/rot_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2020.06.06 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 6c33afd0bea4..0b0a36e31b9d 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -3,7 +3,7 @@ ## \file serial_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 97f86d64a150..9f30bd552003 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -3,7 +3,7 @@ ## \file serial_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/sliding_interface/bars_SST_2D/bars.cfg b/TestCases/sliding_interface/bars_SST_2D/bars.cfg index 0a4e4874332f..71d771280982 100644 --- a/TestCases/sliding_interface/bars_SST_2D/bars.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/bars.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg index 647ba376a171..1dd8d41836fb 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg index d98ec02e6645..d922c308466e 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg index b6e9674d74a3..a3ed15dbebc4 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_2D/zone_2.cfg b/TestCases/sliding_interface/channel_2D/zone_2.cfg index 301abf1e2057..fcc887a5cdc4 100644 --- a/TestCases/sliding_interface/channel_2D/zone_2.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_2.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/channel_2D/zone_3.cfg b/TestCases/sliding_interface/channel_2D/zone_3.cfg index b6e9674d74a3..a3ed15dbebc4 100644 --- a/TestCases/sliding_interface/channel_2D/zone_3.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_3.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg index 1a445f2156b4..792b3faa62a2 100644 --- a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg index c4f25979729a..9d32610dae14 100644 --- a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg index 34149021cc26..bc262ad41387 100644 --- a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 6cd982fd6e21..5295588f255f 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg index 1bc72884c2e0..0bb4beb22982 100644 --- a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg index 8fa7c6affaee..7c74ee76c386 100644 --- a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg index 1eb4b09ae3e7..8470bf0cb4cc 100644 --- a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg +++ b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Jun 12, 2014 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/unsteady/square_cylinder/turb_square.cfg b/TestCases/unsteady/square_cylinder/turb_square.cfg index ce0cd4f7fa92..ca0b55cfe7c7 100644 --- a/TestCases/unsteady/square_cylinder/turb_square.cfg +++ b/TestCases/unsteady/square_cylinder/turb_square.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.02.25 % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/UnitTests/Common/geometry/CGeometry_test.cpp b/UnitTests/Common/geometry/CGeometry_test.cpp index 920c50e50036..3767f56a37c5 100644 --- a/UnitTests/Common/geometry/CGeometry_test.cpp +++ b/UnitTests/Common/geometry/CGeometry_test.cpp @@ -2,7 +2,7 @@ * \file CGeometry_tests.cpp * \brief Unit tests for CGeometry. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp b/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp index fa4003f5f822..e718b49674a4 100644 --- a/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp +++ b/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp @@ -2,7 +2,7 @@ * \file CDualGrid_tests.cpp * \brief Unit tests for the dual grid classes * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp b/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp index f840f8ecf9d3..b7ef26c36e2d 100644 --- a/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp +++ b/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp @@ -2,7 +2,7 @@ * \file CPrimalGrid_tests.cpp * \brief Unit tests for the primal grid classes * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/simple_ad_test.cpp b/UnitTests/Common/simple_ad_test.cpp index 9e253cb3af85..0282b40cfbe8 100644 --- a/UnitTests/Common/simple_ad_test.cpp +++ b/UnitTests/Common/simple_ad_test.cpp @@ -4,7 +4,7 @@ * basic functionality, this also serves as a regression test * to make sure that AD works within unit testing. * \author C. Pederson - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/simple_directdiff_test.cpp b/UnitTests/Common/simple_directdiff_test.cpp index 91893e894e63..086616b9cbd3 100644 --- a/UnitTests/Common/simple_directdiff_test.cpp +++ b/UnitTests/Common/simple_directdiff_test.cpp @@ -4,7 +4,7 @@ * basic functionality, this also serves as a regression test * to make sure that DD works within unit testing. * \author C. Pederson - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp b/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp index d33d31a59a30..82f6d4063e03 100644 --- a/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp +++ b/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp @@ -3,7 +3,7 @@ * \brief Unit tests for the CQuasiNewtonInvLeastSquares class. * Which should find the root of a n-d linear problem in n+1 iterations. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/Common/vectorization.cpp b/UnitTests/Common/vectorization.cpp index 9c4a3551da55..44972b043970 100644 --- a/UnitTests/Common/vectorization.cpp +++ b/UnitTests/Common/vectorization.cpp @@ -2,7 +2,7 @@ * \file vectorization.cpp * \brief Unit tests for the SIMD type and associated expression templates. * \author P. Gomes - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/SU2_CFD/gradients.cpp b/UnitTests/SU2_CFD/gradients.cpp index cc6b342d1fca..7757b14e1dfb 100644 --- a/UnitTests/SU2_CFD/gradients.cpp +++ b/UnitTests/SU2_CFD/gradients.cpp @@ -2,7 +2,7 @@ * \file gradients.cpp * \brief Unit tests for gradient calculation. * \author P. Gomes, T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp index 04ca30b34f24..e92062f8ba46 100644 --- a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp @@ -2,7 +2,7 @@ * \file CNumerics_tests.cpp * \brief Unit tests for the numerics classes. * \author C. Pederson - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/UnitTests/UnitQuadTestCase.hpp b/UnitTests/UnitQuadTestCase.hpp index 513e5ed31c1c..d9e24cd5d2fa 100644 --- a/UnitTests/UnitQuadTestCase.hpp +++ b/UnitTests/UnitQuadTestCase.hpp @@ -2,7 +2,7 @@ * \file UnitQuadTestCase.hpp * \brief Simple unit quad test to be used in unit tests. * \author T. Albring - * \version 7.1.0 "Blackbird" + * \version 7.1.1 "Blackbird" * * SU2 Project Website: https://su2code.github.io * diff --git a/config_template.cfg b/config_template.cfg index fd9e3d4930c9..949004c7d4e6 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -5,7 +5,7 @@ % Author: ___________________________________________________________________ % % Institution: ______________________________________________________________ % % Date: __________ % -% File Version 7.1.0 "Blackbird" % +% File Version 7.1.1 "Blackbird" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/configure.ac b/configure.ac index 3415d019da91..a0f5f1441a28 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # \file configure.ac # \brief Main file for configuring the autoconf/automake build process # \author M. Colonno, T. Economon, F. Palacios, B. Kirk -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/externals/Makefile.am b/externals/Makefile.am index 2adc6eb09adb..9a04f06dc254 100644 --- a/externals/Makefile.am +++ b/externals/Makefile.am @@ -3,7 +3,7 @@ # \file Makefile.am # \brief Makefile for external libraries # \author B. Kirk, T. Economon, F. Palacios -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/meson.build b/meson.build index cb688126fbed..d15905334d9d 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('SU2', 'c', 'cpp', - version: '7.1.0 "Blackbird"', + version: '7.1.1 "Blackbird"', license: 'LGPL2', default_options: ['buildtype=release', 'warning_level=0', @@ -198,7 +198,7 @@ endif message('''------------------------------------------------------------------------- | ___ _ _ ___ | - | / __| | | |_ ) Release 7.1.0 "Blackbird" | + | / __| | | |_ ) Release 7.1.1 "Blackbird" | | \__ \ |_| |/ / | | |___/\___//___| Meson Configuration Summary | | | diff --git a/meson.py b/meson.py index 8bab2e16064e..282ab3531339 100755 --- a/meson.py +++ b/meson.py @@ -3,7 +3,7 @@ ## \file meson.py # \brief An extended meson script for setting up the environment and running meson # \author T. Albring -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/meson_scripts/init.py b/meson_scripts/init.py index fe0cc063aa98..f0d477136542 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -4,7 +4,7 @@ # \brief Initializes necessary dependencies for SU2 either using git or it # fetches zip files. # \author T. Albring -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io # diff --git a/preconfigure.py b/preconfigure.py index 639740a54d8f..4c0094bed584 100755 --- a/preconfigure.py +++ b/preconfigure.py @@ -3,7 +3,7 @@ ## \file configure.py # \brief An extended configuration script. # \author T. Albring -# \version 7.1.0 "Blackbird" +# \version 7.1.1 "Blackbird" # # SU2 Project Website: https://su2code.github.io #