diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 35296541977..ff713cc20d6 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -237,6 +237,7 @@ class CConfig { *Marker_MixingPlaneInterface, /*!< \brief MixingPlane interface boundary markers. */ *Marker_TurboBoundIn, /*!< \brief Turbomachinery performance boundary markers. */ *Marker_TurboBoundOut, /*!< \brief Turbomachinery performance boundary donor markers. */ + *Marker_Turbomachinery, /*!< \breif Turbomachinery markers */ *Marker_NearFieldBound, /*!< \brief Near Field boundaries markers. */ *Marker_Deform_Mesh, /*!< \brief Deformable markers at the boundary. */ *Marker_Deform_Mesh_Sym_Plane, /*!< \brief Marker with symmetric deformation. */ @@ -443,6 +444,7 @@ class CConfig { TURBO_PERF_KIND *Kind_TurboPerf; /*!< \brief Kind of turbomachynery architecture.*/ TURBOMACHINERY_TYPE *Kind_TurboMachinery; + su2vector Kind_TurboInterface; /* Gradient smoothing options */ su2double SmoothingEps1; /*!< \brief Parameter for the identity part in gradient smoothing. */ @@ -466,6 +468,7 @@ class CConfig { unsigned short* nDV_Value; /*!< \brief Number of values for each design variable (might be different than 1 if we allow arbitrary movement). */ unsigned short nFFDBox; /*!< \brief Number of ffd boxes. */ unsigned short nTurboMachineryKind; /*!< \brief Number turbomachinery types specified. */ + unsigned short nTurboInterfaces; /*!< \brief Number of turbomachiery interfaces */ unsigned short nParamDV; /*!< \brief Number of parameters of the design variable. */ string DV_Filename; /*!< \brief Filename for providing surface positions from an external parameterization. */ string DV_Unordered_Sens_Filename; /*!< \brief Filename of volume sensitivities in an unordered ASCII format. */ @@ -746,6 +749,7 @@ class CConfig { *Marker_All_Turbomachinery, /*!< \brief Global index for Turbomachinery markers using the grid information. */ *Marker_All_TurbomachineryFlag, /*!< \brief Global index for Turbomachinery markers flag using the grid information. */ *Marker_All_MixingPlaneInterface, /*!< \brief Global index for MixingPlane interface markers using the grid information. */ + *Marker_All_Giles, /*!< \brief Global index for Giles markers using the grid information. */ *Marker_All_DV, /*!< \brief Global index for design variable markers using the grid information. */ *Marker_All_Moving, /*!< \brief Global index for moving surfaces using the grid information. */ *Marker_All_Deform_Mesh, /*!< \brief Global index for deformable markers at the boundary. */ @@ -763,6 +767,7 @@ class CConfig { *Marker_CfgFile_Turbomachinery, /*!< \brief Global index for Turbomachinery using the config information. */ *Marker_CfgFile_TurbomachineryFlag, /*!< \brief Global index for Turbomachinery flag using the config information. */ *Marker_CfgFile_MixingPlaneInterface, /*!< \brief Global index for MixingPlane interface using the config information. */ + *Marker_CfgFile_Giles, /*!< \brief Global index for Giles markers flag using the config information. */ *Marker_CfgFile_Moving, /*!< \brief Global index for moving surfaces using the config information. */ *Marker_CfgFile_Deform_Mesh, /*!< \brief Global index for deformable markers at the boundary. */ *Marker_CfgFile_Deform_Mesh_Sym_Plane, /*!< \brief Global index for markers with symmetric deformations. */ @@ -1375,7 +1380,7 @@ class CConfig { su2double** & RotCenter, su2double** & RotAngles, su2double** & Translation); void addTurboPerfOption(const string & name, unsigned short & nMarker_TurboPerf, - string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut); + string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut, string* & Marker_Turbomachinery); void addActDiskOption(const string & name, unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, string* & Marker_ActDiskOutlet, @@ -3513,6 +3518,13 @@ class CConfig { */ void SetMarker_All_MixingPlaneInterface(unsigned short val_marker, unsigned short val_mixpla_interface) { Marker_All_MixingPlaneInterface[val_marker] = val_mixpla_interface; } + /*! + * \brief Set if a marker val_marker is part of the Giles boundary (read from the config file). + * \param[in] val_marker - Index of the marker in which we are interested. + * \param[in] val_giles - 0 if not part of the Giles boundary or greater than 1 if it is part. + */ + void SetMarker_All_Giles(unsigned short val_marker, unsigned short val_giles) { Marker_All_Giles[val_marker] = val_giles; } + /*! * \brief Set if a marker val_marker is going to be affected by design variables val_moving * (read from the config file). @@ -3659,6 +3671,13 @@ class CConfig { */ unsigned short GetMarker_All_TurbomachineryFlag(unsigned short val_marker) const { return Marker_All_TurbomachineryFlag[val_marker]; } +/*! + * \brief Get the Giles boundary information for a marker val_marker. + * \param[in] val_marker value of the marker on the grid. + * \return 0 if is not part of the MixingPlane Interface and greater than 1 if it is part. + */ + unsigned short GetMarker_All_Giles(unsigned short val_marker) const { return Marker_All_Giles[val_marker]; } + /*! * \brief Get the number of FSI interface markers val_marker. * \param[in] void. @@ -5335,6 +5354,12 @@ class CConfig { */ TURBO_PERF_KIND GetKind_TurboPerf(unsigned short val_iZone) const { return Kind_TurboPerf[val_iZone]; }; + /*! + * \brief gets interface kind for an interface marker in turbomachinery problem + * \return interface kind + */ + TURBO_INTERFACE_KIND GetKind_TurboInterface(unsigned short interfaceIndex) const { return Kind_TurboInterface[interfaceIndex]; } + /*! * \brief get outlet bounds name for Turbomachinery performance calculation. * \return name of the bound. @@ -6398,6 +6423,12 @@ class CConfig { */ unsigned short GetMarker_CfgFile_MixingPlaneInterface(const string& val_marker) const; + /*! + * \brief Get the Giles boundary information from the config definition for the marker val_marker. + * \return Plotting information of the boundary in the config information for the marker val_marker. + */ + unsigned short GetMarker_CfgFile_Giles(const string& val_marker) const; + /*! * \brief Get the DV information from the config definition for the marker val_marker. * \return DV information of the boundary in the config information for the marker val_marker. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index d1f59abbd79..923f12cab37 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1622,6 +1622,7 @@ enum BC_TYPE { FLUID_INTERFACE = 39, /*!< \brief Domain interface definition. */ DISP_DIR_BOUNDARY = 40, /*!< \brief Boundary displacement definition. */ DAMPER_BOUNDARY = 41, /*!< \brief Damper. */ + MIXING_PLANE_INTERFACE = 42, /*< \breif Mxing plane */ CHT_WALL_INTERFACE = 50, /*!< \brief Domain interface definition. */ SMOLUCHOWSKI_MAXWELL = 55, /*!< \brief Smoluchoski/Maxwell wall boundary condition. */ SEND_RECEIVE = 99, /*!< \brief Boundary send-receive definition. */ @@ -1752,7 +1753,8 @@ enum RIEMANN_TYPE { TOTAL_CONDITIONS_PT_1D = 11, STATIC_PRESSURE_1D = 12, MIXING_IN_1D = 13, - MIXING_OUT_1D =14 + MIXING_OUT_1D = 14, + MASS_FLOW_OUTLET = 15 }; static const MapType Riemann_Map = { MakePair("TOTAL_CONDITIONS_PT", TOTAL_CONDITIONS_PT) @@ -1769,6 +1771,7 @@ static const MapType Riemann_Map = { MakePair("RADIAL_EQUILIBRIUM", RADIAL_EQUILIBRIUM) MakePair("TOTAL_CONDITIONS_PT_1D", TOTAL_CONDITIONS_PT_1D) MakePair("STATIC_PRESSURE_1D", STATIC_PRESSURE_1D) + MakePair("MASS_FLOW_OUTLET", MASS_FLOW_OUTLET) }; static const MapType Giles_Map = { @@ -1786,6 +1789,7 @@ static const MapType Giles_Map = { MakePair("RADIAL_EQUILIBRIUM", RADIAL_EQUILIBRIUM) MakePair("TOTAL_CONDITIONS_PT_1D", TOTAL_CONDITIONS_PT_1D) MakePair("STATIC_PRESSURE_1D", STATIC_PRESSURE_1D) + MakePair("MASS_FLOW_OUTLET", MASS_FLOW_OUTLET) }; /*! @@ -1862,6 +1866,18 @@ static const MapType TurboPerfKind_Map = { MakePair("PROPELLOR", TURBO_PERF_KIND::PROPELLOR) }; +/*! + * \brief Types of Turbomachinery interfaces. + */ +enum class TURBO_INTERFACE_KIND{ + MIXING_PLANE = ENUM_TRANSFER::MIXING_PLANE, + FROZEN_ROTOR = ENUM_TRANSFER::SLIDING_INTERFACE, +}; +static const MapType TurboInterfaceKind_Map = { + MakePair("MIXING_PLANE", TURBO_INTERFACE_KIND::MIXING_PLANE) + MakePair("FROZEN_ROTOR", TURBO_INTERFACE_KIND::FROZEN_ROTOR) +}; + /*! * \brief Types of Turbomachinery performance flag. */ diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 955d1531482..01ed6de9bf9 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1606,11 +1606,15 @@ class COptionTurboPerformance : public COptionBase { unsigned short& size; string*& marker_turboIn; string*& marker_turboOut; + string*& markers; public: COptionTurboPerformance(const string option_field_name, unsigned short& nMarker_TurboPerf, - string*& Marker_TurboBoundIn, string*& Marker_TurboBoundOut) - : size(nMarker_TurboPerf), marker_turboIn(Marker_TurboBoundIn), marker_turboOut(Marker_TurboBoundOut) { + string*& Marker_TurboBoundIn, string*& Marker_TurboBoundOut, string*& Marker_Turbomachinery) + : size(nMarker_TurboPerf), + marker_turboIn(Marker_TurboBoundIn), + marker_turboOut(Marker_TurboBoundOut), + markers(Marker_Turbomachinery) { this->name = option_field_name; } @@ -1624,6 +1628,7 @@ class COptionTurboPerformance : public COptionBase { this->size = 0; this->marker_turboIn = nullptr; this->marker_turboOut = nullptr; + this->markers = nullptr; return ""; } @@ -1634,10 +1639,16 @@ class COptionTurboPerformance : public COptionBase { this->size = 0; this->marker_turboIn = nullptr; this->marker_turboOut = nullptr; + this->markers = nullptr; ; return newstring; } + this->markers = new string[totalVals]; + for (unsigned long i = 0; i < totalVals; i++) { + this->markers[i].assign(option_value[i]); + } + unsigned long nVals = totalVals / mod_num; this->size = nVals; this->marker_turboIn = new string[nVals]; @@ -1654,6 +1665,7 @@ class COptionTurboPerformance : public COptionBase { this->size = 0; this->marker_turboIn = nullptr; this->marker_turboOut = nullptr; + this->markers = nullptr; } }; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 43f77fc9c52..276c66ebf60 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -539,10 +539,10 @@ void CConfig::addPeriodicOption(const string & name, unsigned short & nMarker_Pe } void CConfig::addTurboPerfOption(const string & name, unsigned short & nMarker_TurboPerf, - string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut) { + string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut, string* & Marker_Turbomachinery) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionTurboPerformance(name, nMarker_TurboPerf, Marker_TurboBoundIn, Marker_TurboBoundOut); + COptionBase* val = new COptionTurboPerformance(name, nMarker_TurboPerf, Marker_TurboBoundIn, Marker_TurboBoundOut, Marker_Turbomachinery); option_map.insert(pair(name, val)); } @@ -1037,6 +1037,7 @@ void CConfig::SetPointersNull() { Marker_MixingPlaneInterface = nullptr; Marker_TurboBoundIn = nullptr; Marker_TurboBoundOut = nullptr; + Marker_Turbomachinery = nullptr; Marker_Giles = nullptr; Marker_Shroud = nullptr; @@ -1633,8 +1634,8 @@ void CConfig::SetConfig_Options() { addStringListOption("MARKER_MIXINGPLANE_INTERFACE", nMarker_MixingPlaneInterface, Marker_MixingPlaneInterface); /*!\brief TURBULENT_MIXINGPLANE \n DESCRIPTION: Activate mixing plane also for turbulent quantities \ingroup Config*/ addBoolOption("TURBULENT_MIXINGPLANE", turbMixingPlane, false); - /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the inflow and outflow boundaries in which the turbomachinery settings are applied. \ingroup Config*/ - addTurboPerfOption("MARKER_TURBOMACHINERY", nMarker_Turbomachinery, Marker_TurboBoundIn, Marker_TurboBoundOut); + /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the boundaries for which the turbomachinery settings are applied. \ingroup Config*/ + addTurboPerfOption("MARKER_TURBOMACHINERY", nMarker_Turbomachinery, Marker_TurboBoundIn, Marker_TurboBoundOut, Marker_Turbomachinery); /*!\brief NUM_SPANWISE_SECTIONS \n DESCRIPTION: Integer number of spanwise sections to compute 3D turbo BC and Performance for turbomachinery */ addUnsignedShortOption("NUM_SPANWISE_SECTIONS", nSpanWiseSections_User, 1); /*!\brief SPANWISE_KIND \n DESCRIPTION: type of algorithm to identify the span-wise sections at the turbo boundaries. @@ -5663,6 +5664,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { Marker_All_Turbomachinery = new unsigned short[nMarker_All] (); // Store whether the boundary is in needed for Turbomachinery computations. Marker_All_TurbomachineryFlag = new unsigned short[nMarker_All] (); // Store whether the boundary has a flag for Turbomachinery computations. Marker_All_MixingPlaneInterface = new unsigned short[nMarker_All] (); // Store whether the boundary has a in the MixingPlane interface. + Marker_All_Giles = new unsigned short[nMarker_All] (); // Store whether the boundary has is a Giles boundary. Marker_All_SobolevBC = new unsigned short[nMarker_All] (); // Store wether the boundary should apply to the gradient smoothing. for (iMarker_All = 0; iMarker_All < nMarker_All; iMarker_All++) { @@ -5688,6 +5690,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { Marker_CfgFile_Turbomachinery = new unsigned short[nMarker_CfgFile] (); Marker_CfgFile_TurbomachineryFlag = new unsigned short[nMarker_CfgFile] (); Marker_CfgFile_MixingPlaneInterface = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Giles = new unsigned short[nMarker_CfgFile] (); Marker_CfgFile_PyCustom = new unsigned short[nMarker_CfgFile] (); Marker_CfgFile_SobolevBC = new unsigned short[nMarker_CfgFile] (); @@ -5808,7 +5811,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { for (iMarker_Fluid_InterfaceBound = 0; iMarker_Fluid_InterfaceBound < nMarker_Fluid_InterfaceBound; iMarker_Fluid_InterfaceBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Fluid_InterfaceBound[iMarker_Fluid_InterfaceBound]; - Marker_CfgFile_KindBC[iMarker_CfgFile] = FLUID_INTERFACE; + Marker_CfgFile_KindBC[iMarker_CfgFile] = BC_TYPE::FLUID_INTERFACE; iMarker_CfgFile++; } @@ -6034,6 +6037,17 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { } } + /*--- Idenftification fo Giles Markers ---*/ + // This is seperate from MP and Turbomachinery Markers as all mixing plane markers are Giles, + // but not all Giles markers are mixing plane + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { + Marker_CfgFile_Giles[iMarker_CfgFile] = NO; + for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) { + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_Giles[iMarker_Giles]) + Marker_CfgFile_Giles[iMarker_CfgFile] = YES; + } + } + /*--- Identification of MixingPlane interface markers ---*/ for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { @@ -6045,6 +6059,37 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] = indexMarker; } + /*--- Once we have identified the MixingPlane and Turbomachinery markers + * we next need to determine what type of interface between zones is + * used. It is convenient to do this here as it tidies up the interface + * preproccesing in CDriver ---*/ + if (nMarker_Turbomachinery != 0) { + nTurboInterfaces = (nMarker_Turbomachinery - 1)*2; //Two markers per zone minus inlet & outlet + Kind_TurboInterface.resize(nTurboInterfaces); + /*--- Loop over all markers ---*/ + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { + /*--- Identify mixing plane markers ---*/ + if (Marker_MixingPlaneInterface != nullptr){ // Necessary in cases where no mixing plane interfaces are defined + if (Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] != 0) { //Is a mixing plane + /*--- Find which list position this marker is in turbomachinery markers ---*/ + const auto* target = std::find(Marker_Turbomachinery, &Marker_Turbomachinery[nMarker_Turbomachinery*2-1], Marker_CfgFile_TagBound[iMarker_CfgFile]); + const auto target_index = target - Marker_Turbomachinery; + /*--- Assert that we find the marker within the turbomachienry markers ---*/ + assert(target != &Marker_Turbomachinery[nMarker_Turbomachinery*2-1]); + /*--- Assign the correct interface ---*/ + Kind_TurboInterface[target_index-1] = TURBO_INTERFACE_KIND::MIXING_PLANE; // Need to subtract 1 from index as to not consider the inlet an interface + } + } + if (Marker_Fluid_InterfaceBound != nullptr){ // No fluid interfaces are defined in the config file (nullptr if no interfaces defined) + if (Marker_CfgFile_KindBC[iMarker_CfgFile] == BC_TYPE::FLUID_INTERFACE) { // iMarker_CfgFile is a fluid interface + const auto* target = std::find(Marker_Turbomachinery, &Marker_Turbomachinery[nMarker_Turbomachinery*2-1], Marker_CfgFile_TagBound[iMarker_CfgFile]); + const auto target_index = target - Marker_Turbomachinery; + Kind_TurboInterface[target_index-1] = TURBO_INTERFACE_KIND::FROZEN_ROTOR; + } + } + } + } + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_DV[iMarker_CfgFile] = NO; for (iMarker_DV = 0; iMarker_DV < nMarker_DV; iMarker_DV++) @@ -7938,6 +7983,13 @@ unsigned short CConfig::GetMarker_CfgFile_MixingPlaneInterface(const string& val return Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile]; } +unsigned short CConfig::GetMarker_CfgFile_Giles(const string& val_marker) const { + unsigned short iMarker_CfgFile; + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; + return Marker_CfgFile_Giles[iMarker_CfgFile]; +} + unsigned short CConfig::GetMarker_CfgFile_DV(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) @@ -8125,6 +8177,9 @@ CConfig::~CConfig() { delete[] Marker_CfgFile_TurbomachineryFlag; delete[] Marker_All_TurbomachineryFlag; + delete[] Marker_CfgFile_Giles; + delete[] Marker_All_Giles; + delete[] Marker_CfgFile_MixingPlaneInterface; delete[] Marker_All_MixingPlaneInterface; @@ -8265,6 +8320,7 @@ CConfig::~CConfig() { delete [] Marker_TurboBoundIn; delete [] Marker_TurboBoundOut; + delete [] Marker_Turbomachinery; delete [] Marker_Riemann; delete [] Marker_Giles; diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index a069424c666..b9b0a0f36cb 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -3370,6 +3370,7 @@ void CPhysicalGeometry::SetBoundaries(CConfig* config) { config->SetMarker_All_PerBound(iMarker, config->GetMarker_CfgFile_PerBound(Marker_Tag)); config->SetMarker_All_Turbomachinery(iMarker, config->GetMarker_CfgFile_Turbomachinery(Marker_Tag)); config->SetMarker_All_TurbomachineryFlag(iMarker, config->GetMarker_CfgFile_TurbomachineryFlag(Marker_Tag)); + config->SetMarker_All_Giles(iMarker, config->GetMarker_CfgFile_Giles(Marker_Tag)); config->SetMarker_All_MixingPlaneInterface(iMarker, config->GetMarker_CfgFile_MixingPlaneInterface(Marker_Tag)); config->SetMarker_All_SobolevBC(iMarker, config->GetMarker_CfgFile_SobolevBC(Marker_Tag)); @@ -3394,6 +3395,7 @@ void CPhysicalGeometry::SetBoundaries(CConfig* config) { config->SetMarker_All_PerBound(iMarker, NO); config->SetMarker_All_Turbomachinery(iMarker, NO); config->SetMarker_All_TurbomachineryFlag(iMarker, NO); + config->SetMarker_All_Giles(iMarker, NO); config->SetMarker_All_MixingPlaneInterface(iMarker, NO); config->SetMarker_All_SobolevBC(iMarker, NO); @@ -3764,6 +3766,7 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig* config, CMeshR config->SetMarker_All_SendRecv(iMarker, NONE); config->SetMarker_All_Turbomachinery(iMarker, config->GetMarker_CfgFile_Turbomachinery(Marker_Tag)); config->SetMarker_All_TurbomachineryFlag(iMarker, config->GetMarker_CfgFile_TurbomachineryFlag(Marker_Tag)); + config->SetMarker_All_Giles(iMarker, config->GetMarker_CfgFile_Giles(Marker_Tag)); config->SetMarker_All_MixingPlaneInterface(iMarker, config->GetMarker_CfgFile_MixingPlaneInterface(Marker_Tag)); config->SetMarker_All_SobolevBC(iMarker, config->GetMarker_CfgFile_SobolevBC(Marker_Tag)); } diff --git a/SU2_CFD/include/fluid/CFluidScalar.hpp b/SU2_CFD/include/fluid/CFluidScalar.hpp index 9f5c9108c51..e3295d99b6d 100644 --- a/SU2_CFD/include/fluid/CFluidScalar.hpp +++ b/SU2_CFD/include/fluid/CFluidScalar.hpp @@ -41,7 +41,6 @@ class CFluidScalar final : public CFluidModel { private: const int n_species_mixture; /*!< \brief Number of species in mixture. */ su2double Gas_Constant; /*!< \brief Specific gas constant. */ - const su2double Gamma; /*!< \brief Ratio of specific heats of the gas. */ const su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */ const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */ const su2double Prandtl_Number; /*!< \brief Prandlt number.*/ @@ -106,7 +105,7 @@ class CFluidScalar final : public CFluidModel { /*! * \brief Constructor of the class. */ - CFluidScalar(su2double val_Cp, su2double val_gas_constant, su2double val_operating_pressure, const CConfig* config); + CFluidScalar(su2double val_operating_pressure, const CConfig* config); /*! * \brief Set viscosity model. diff --git a/SU2_CFD/include/interfaces/CInterface.hpp b/SU2_CFD/include/interfaces/CInterface.hpp index a86db24b12a..a3ffc31c0fb 100644 --- a/SU2_CFD/include/interfaces/CInterface.hpp +++ b/SU2_CFD/include/interfaces/CInterface.hpp @@ -159,15 +159,6 @@ class CInterface { const CConfig *target_config, unsigned long Marker_Target, unsigned long Vertex_Target, unsigned long Point_Target) = 0; - /*! - * \brief A virtual member. - * \param[in] target_solution - Solution from the target mesh. - * \param[in] target_solution - Solution from the target mesh. - * \param[in] donor_zone - Index of the donorZone. - */ - inline virtual void SetAverageValues(CSolver *donor_solution, CSolver *target_solution, - unsigned short donorZone) { } - /*! * \brief A virtual member. * \param[in] donor_geometry - Geometry of the target mesh. @@ -185,6 +176,15 @@ class CInterface { */ inline virtual void SetSpanWiseLevels(const CConfig *donor_config, const CConfig *target_config) { } + /*! + * \brief A virtual member. + * \param[in] target_solution - Solution from the target mesh. + * \param[in] target_solution - Solution from the target mesh. + * \param[in] donor_zone - Index of the donorZone. + */ + inline virtual void SetAverageValues(CSolver *donor_solution, CSolver *target_solution, + unsigned short donorZone) { } + /*! * \brief Transfer pre-processing for the mixing plane inteface. * \param[in] donor_geometry - Geometry of the donor mesh. diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index ce75b38f115..f59da30719b 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -48,11 +48,11 @@ struct CSAVariables { const su2double cb2_sigma = cb2 / sigma; const su2double cw1 = cb1 / k2 + (1 + cb2) / sigma; const su2double cr1 = 0.5; - const su2double CRot = 1.0; + const su2double CRot = 2.0; const su2double c2 = 0.7, c3 = 0.9; /*--- List of auxiliary functions ---*/ - su2double ft2, d_ft2, r, d_r, g, d_g, glim, fw, d_fw, Ji, d_Ji, S, Shat, d_Shat, fv1, d_fv1, fv2, d_fv2; + su2double ft2, d_ft2, r, d_r, g, d_g, glim, fw, d_fw, Ji, d_Ji, Shat, d_Shat, fv1, d_fv1, fv2, d_fv2, Prod; /*--- List of helpers ---*/ su2double Omega, dist_i_2, inv_k2_d2, inv_Shat, g_6, norm2_Grad; @@ -151,20 +151,7 @@ class CSourceBase_TurbSA : public CNumerics { Residual = 0.0; Jacobian_i[0] = 0.0; - /*--- Evaluate Omega with a rotational correction term. ---*/ - - Omega::get(Vorticity_i, nDim, PrimVar_Grad_i + idx.Velocity(), var); - - /*--- Dacles-Mariani et. al. rotation correction ("-R"). ---*/ - if (options.rot) { - var.Omega += var.CRot * min(0.0, StrainMag_i - var.Omega); - /*--- Do not allow negative production for SA-neg. ---*/ - if (ScalarVar_i[0] < 0) var.Omega = abs(var.Omega); - } - if (dist_i > 1e-10) { - /*--- Vorticity ---*/ - var.S = var.Omega; var.dist_i_2 = pow(dist_i, 2); const su2double nu = laminar_viscosity / density; @@ -188,12 +175,24 @@ class CSourceBase_TurbSA : public CNumerics { var.fv2 = 1 - ScalarVar_i[0] / (nu + ScalarVar_i[0] * var.fv1); var.d_fv2 = -(1 / nu - Ji_2 * var.d_fv1) / pow(1 + var.Ji * var.fv1, 2); - /*--- Compute ft2 term ---*/ - ft2::get(var); + /*--- Evaluate Omega with a rotational correction term. ---*/ + + Omega::get(Vorticity_i, nDim, PrimVar_Grad_i + idx.Velocity(), var); /*--- Compute modified vorticity ---*/ ModVort::get(ScalarVar_i[0], nu, var); var.inv_Shat = 1.0 / var.Shat; + var.Prod = var.Shat; + + /*--- Dacles-Mariani et. al. rotation correction ("-R"). ---*/ + if (options.rot) { + var.Prod += var.CRot * min(0.0, StrainMag_i - var.Omega); + /*--- Do not allow negative production for SA-neg. ---*/ + if (ScalarVar_i[0] < 0) var.Prod = abs(var.Prod); + } + + /*--- Compute ft2 term ---*/ + ft2::get(var); /*--- Compute auxiliary function r ---*/ rFunc::get(ScalarVar_i[0], var); @@ -234,7 +233,6 @@ class CSourceBase_TurbSA : public CNumerics { } else if (transition_LM){ var.intermittency = intermittency_eff_i; - //var.intermittency = 1.0; // Is wrong the reference from NASA? // Original max(min(gamma, 0.5), 1.0) always gives 1 as result. var.interDestrFactor = min(max(intermittency_i, 0.5), 1.0); @@ -347,12 +345,12 @@ struct Bsl { /*--- Limiting of \hat{S} based on "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model" * Note 1 option c in https://turbmodels.larc.nasa.gov/spalart.html ---*/ - if (Sbar >= - c2 * var.S) { - var.Shat = var.S + Sbar; + if (Sbar >= - c2 * var.Omega) { + var.Shat = var.Omega + Sbar; } else { - const su2double Num = var.S * (c2 * c2 * var.S + c3 * Sbar); - const su2double Den = (c3 - 2 * c2) * var.S - Sbar; - var.Shat = var.S + Num / Den; + const su2double Num = var.Omega * (c2 * c2 * var.Omega + c3 * Sbar); + const su2double Den = (c3 - 2 * c2) * var.Omega - Sbar; + var.Shat = var.Omega + Num / Den; } if (var.Shat <= 1e-10) { var.Shat = 1e-10; @@ -366,12 +364,12 @@ struct Bsl { /*! \brief Edward. */ struct Edw { static void get(const su2double& nue, const su2double& nu, CSAVariables& var) { - var.Shat = max(var.S * ((1.0 / max(var.Ji, 1.0e-16)) + var.fv1), 1.0e-16); + var.Shat = max(var.Omega * ((1.0 / max(var.Ji, 1.0e-16)) + var.fv1), 1.0e-16); var.Shat = max(var.Shat, 1.0e-10); if (var.Shat <= 1.0e-10) { var.d_Shat = 0.0; } else { - var.d_Shat = -var.S * pow(var.Ji, -2) / nu + var.S * var.d_fv1; + var.d_Shat = -var.Omega * pow(var.Ji, -2) / nu + var.Omega * var.d_fv1; } } }; @@ -383,7 +381,7 @@ struct Neg { // Baseline solution Bsl::get(nue, nu, var); } else { - var.Shat = 1.0e-10; + var.Shat = var.Omega; var.d_Shat = 0.0; } /*--- Don't check whether Sbar <>= -cv2*S. @@ -447,8 +445,8 @@ struct Bsl { static void ComputeProduction(const su2double& nue, const CSAVariables& var, su2double& production, su2double& jacobian) { const su2double factor = var.intermittency * var.cb1; - production = factor * (1.0 - var.ft2) * var.Shat * nue; - jacobian += factor * (-var.Shat * nue * var.d_ft2 + (1.0 - var.ft2) * (nue * var.d_Shat + var.Shat)); + production = factor * (1.0 - var.ft2) * var.Prod * nue; + jacobian += factor * (-var.Prod * nue * var.d_ft2 + (1.0 - var.ft2) * (nue * var.d_Shat + var.Prod)); } static void ComputeDestruction(const su2double& nue, const CSAVariables& var, su2double& destruction, @@ -481,7 +479,7 @@ struct Neg { static void ComputeProduction(const su2double& nue, const CSAVariables& var, su2double& production, su2double& jacobian) { - const su2double dP_dnu = var.intermittency * var.cb1 * (1.0 - var.ct3) * var.S; + const su2double dP_dnu = var.intermittency * var.cb1 * (1.0 - var.ct3) * var.Prod; production = dP_dnu * nue; jacobian += dP_dnu; } diff --git a/SU2_CFD/include/output/CTurboOutput.hpp b/SU2_CFD/include/output/CTurboOutput.hpp index cc7e2356f07..5a1741530cd 100644 --- a/SU2_CFD/include/output/CTurboOutput.hpp +++ b/SU2_CFD/include/output/CTurboOutput.hpp @@ -87,7 +87,7 @@ class CTurbomachineryCombinedPrimitiveStates { class CTurbomachineryState { private: su2double Density, Pressure, Entropy, Enthalpy, Temperature, TotalTemperature, TotalPressure, TotalEnthalpy; - su2double AbsFlowAngle, FlowAngle, MassFlow, Rothalpy, TotalRelPressure; + su2double AbsFlowAngle, FlowAngle, MassFlow, Rothalpy, TangVelocity, TotalRelPressure; vector Velocity, RelVelocity, Mach, RelMach; su2double Area, Radius; @@ -124,6 +124,8 @@ class CTurbomachineryState { const su2double& GetRothalpy() const { return Rothalpy; } + const su2double& GetTangVelocity() const { return TangVelocity; } + const vector& GetVelocity() const { return Velocity; } const vector& GetMach() const { return Mach; } @@ -207,7 +209,7 @@ class CPropellorBladePerformance : public CTurbomachineryBladePerformance { */ class CTurbomachineryStagePerformance { protected: - su2double TotalStaticEfficiency, TotalTotalEfficiency, NormEntropyGen, TotalStaticPressureRatio, TotalTotalPressureRatio, EulerianWork; + su2double TotalStaticEfficiency, TotalTotalEfficiency, NormEntropyGen, TotalStaticPressureRatio, TotalTotalPressureRatio, EulerianWork, TotalPressureLoss, KineticEnergyLoss; CFluidModel& fluidModel; public: @@ -232,6 +234,10 @@ class CTurbomachineryStagePerformance { su2double GetTotalStaticPressureRatio() const { return TotalStaticPressureRatio; } su2double GetTotalTotalPressureRatio() const { return TotalTotalPressureRatio; } + + su2double GetTotalPressureLoss() const { return TotalPressureLoss; } + + su2double GetKineticEnergyLoss() const { return KineticEnergyLoss; } }; /*! diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index fdd5598278e..d498b84c225 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -138,6 +138,7 @@ class CEulerSolver : public CFVMFlowSolverBaseval_marker + */ + inline virtual su2double GetAverageMassFlowRate(unsigned short valMarker) const {return 0.0; } + /*! * \brief A virtual member. * \param[in] val_marker - bound marker. diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 65a25b6c9a2..0c3c4a10c4e 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2476,14 +2476,23 @@ void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeomet if (rank == MASTER_NODE) cout << "boundary displacements from the structural solver." << endl; } else if (fluid_donor && fluid_target) { - /*--- Mixing plane for turbo machinery applications. ---*/ - if (config[donor]->GetBoolMixingPlaneInterface()) { - interface_type = MIXING_PLANE; - auto nVar = solver[donor][INST_0][MESH_0][FLOW_SOL]->GetnVar(); - interface[donor][target] = new CMixingPlaneInterface(nVar, 0); - if (rank == MASTER_NODE) { - cout << "Set mixing-plane interface from donor zone " - << donor << " to target zone " << target << "." << endl; + /*--- Interface handling for turbomachinery applications. ---*/ + if (config[donor]->GetBoolTurbomachinery()) { + auto interfaceIndex = donor+target; // Here we assume that the interfaces at each side are the same kind + switch (config[donor]->GetKind_TurboInterface(interfaceIndex)) { + case TURBO_INTERFACE_KIND::MIXING_PLANE: { + interface_type = MIXING_PLANE; + auto nVar = solver[donor][INST_0][MESH_0][FLOW_SOL]->GetnVar(); + interface[donor][target] = new CMixingPlaneInterface(nVar, 0); + if (rank == MASTER_NODE) cout << "using a mixing-plane interface from donor zone " << donor << " to target zone " << target << "." << endl; + break; + } + case TURBO_INTERFACE_KIND::FROZEN_ROTOR: { + auto nVar = solver[donor][INST_0][MESH_0][FLOW_SOL]->GetnPrimVar(); + interface_type = SLIDING_INTERFACE; + interface[donor][target] = new CSlidingInterface(nVar, 0); + if (rank == MASTER_NODE) cout << "using a fluid interface interface from donor zone " << donor << " to target zone " << target << "." << endl; + } } } else{ diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 07069b4d0ab..368a598e514 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -589,19 +589,19 @@ bool CMultizoneDriver::TransferData(unsigned short donorZone, unsigned short tar { const auto nMarkerInt = config_container[donorZone]->GetnMarker_MixingPlaneInterface() / 2; - /*--- Transfer the average value from the donorZone to the targetZone ---*/ + /*--- Transfer the average value from the donorZone to the targetZone ---*/ + /*--- Loops over the mixing planes defined in the config file to find the correct mixing plane for the donor-target combination ---*/ for (auto iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++) { interface_container[donorZone][targetZone]->AllgatherAverage(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], config_container[donorZone], config_container[targetZone], iMarkerInt ); } - for (donorZone = 0; donorZone < nZone; donorZone++) { - if (interface_types[donorZone][targetZone]==MIXING_PLANE) { - interface_container[donorZone][targetZone]->GatherAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], donorZone); - geometry_container[targetZone][INST_0][MESH_0]->SetAvgTurboGeoValues(config_container[iZone],geometry_container[iZone][INST_0][MESH_0], iZone); - } - } + /*--- Set average value donorZone->targetZone ---*/ + interface_container[donorZone][targetZone]->SetAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], donorZone); + + /*--- Set average geometrical properties FROM donorZone IN targetZone ---*/ + geometry_container[targetZone][INST_0][MESH_0]->SetAvgTurboGeoValues(config_container[iZone],geometry_container[iZone][INST_0][MESH_0], iZone); break; } @@ -623,7 +623,7 @@ bool CMultizoneDriver::TransferData(unsigned short donorZone, unsigned short tar void CMultizoneDriver::SetTurboPerformance() { for (auto donorZone = 1u; donorZone < nZone; donorZone++) { - interface_container[donorZone][ZONE_0]->GatherAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL], + interface_container[donorZone][ZONE_0]->SetAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL], solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], donorZone); } diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index 6b1bd3eaaaa..627ea9c41f7 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -66,8 +66,8 @@ void CSinglezoneDriver::StartSolver() { TimeIter = config_container[ZONE_0]->GetRestart_Iter(); /*--- Run the problem until the number of time iterations required is reached. ---*/ - while ( TimeIter < config_container[ZONE_0]->GetnTime_Iter() ) { - + /*--- or until a SIGTERM signal stops the loop. We catch SIGTERM and exit gracefully ---*/ + while ( TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { /*--- Perform some preprocessing before starting the time-step simulation. ---*/ Preprocess(TimeIter); diff --git a/SU2_CFD/src/fluid/CFluidScalar.cpp b/SU2_CFD/src/fluid/CFluidScalar.cpp index 991e29bd562..5e3a2e2f998 100644 --- a/SU2_CFD/src/fluid/CFluidScalar.cpp +++ b/SU2_CFD/src/fluid/CFluidScalar.cpp @@ -41,12 +41,9 @@ #include "../../include/fluid/CPolynomialViscosity.hpp" #include "../../include/fluid/CSutherland.hpp" -CFluidScalar::CFluidScalar(su2double val_Cp, su2double val_gas_constant, su2double value_pressure_operating, - const CConfig* config) +CFluidScalar::CFluidScalar(su2double value_pressure_operating, const CConfig* config) : CFluidModel(), n_species_mixture(config->GetnSpecies() + 1), - Gas_Constant(val_gas_constant), - Gamma(config->GetGamma()), Pressure_Thermodynamic(value_pressure_operating), GasConstant_Ref(config->GetGas_Constant_Ref()), Prandtl_Number(config->GetPrandtl_Turb()), diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 8deeaaa4ae0..b9617c4c16e 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -253,7 +253,7 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ Donor_Flag= -1; for (int iSize=0; iSize 0.0){ + if(BuffMarkerDonor[iSize] >= 0.0){ Marker_Donor = BuffMarkerDonor[iSize]; Donor_Flag = BuffDonorFlag[iSize]; break; @@ -278,8 +278,8 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ break; } /*--- If the tag hasn't matched any tag within the Flow markers ---*/ - Marker_Target = -1; - + Marker_Target = -1; + Target_Flag = -1; } if (Marker_Target != -1 && Marker_Donor != -1){ @@ -291,7 +291,7 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ for(iSpan = 1; iSpan SpanValuesDonor[jSpan]){ @@ -300,7 +300,7 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ } if(test2 < dist2){ dist2 = test2; - tSpan =jSpan; + tSpan = jSpan; } } @@ -638,15 +638,4 @@ void CInterface::AllgatherAverage(CSolver *donor_solution, CSolver *target_solut delete [] avgNuTarget; delete [] avgKineTarget; delete [] avgOmegaTarget; - - -} - -void CInterface::GatherAverageValues(CSolver *donor_solution, CSolver *target_solution, unsigned short donorZone){ - - - /*--- here we made the strong assumption that the mesh zone order - * follows the same order of the turbomachinery markers ---*/ - SetAverageValues(donor_solution, target_solution, donorZone); - } diff --git a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp index f35dc776f9e..d1bbcf2ff0b 100644 --- a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp @@ -118,7 +118,7 @@ void CMixingPlaneInterface::SetAverageValues(CSolver *donor_solution, CSolver *t unsigned short iSpan; for(iSpan = 0; iSpanSetDensityIn(donor_solution->GetDensityIn(donorZone, iSpan), donorZone, iSpan); target_solution->SetPressureIn(donor_solution->GetPressureIn(donorZone, iSpan), donorZone, iSpan); target_solution->SetTurboVelocityIn(donor_solution->GetTurboVelocityIn(donorZone, iSpan), donorZone, iSpan); diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 27173f3357e..24fd1602e6e 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -471,6 +471,10 @@ void CDiscAdjFluidIteration::SetDependencies(CSolver***** solver, CGeometry**** solvers0[FLOW_SOL]->InitiateComms(geometry0, config[iZone], MPI_QUANTITIES::SOLUTION); solvers0[FLOW_SOL]->CompleteComms(geometry0, config[iZone], MPI_QUANTITIES::SOLUTION); + if (config[iZone]->GetBoolTurbomachinery()) { + solvers0[FLOW_SOL]->TurboAverageProcess(solvers0, geometry0, config[iZone], INFLOW); + solvers0[FLOW_SOL]->TurboAverageProcess(solvers0, geometry0, config[iZone], OUTFLOW); + } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { solvers0[TURB_SOL]->Postprocessing(geometry0, solvers0, config[iZone], MESH_0); diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 1666191e07f..fe7c9fbf397 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -592,6 +592,10 @@ void CFlowCompOutput::LoadTurboHistoryData(std::shared_ptrGetOutletState().GetTotalPressure()); SetHistoryOutputValue("PressureIn_" + tag.str(), BladePerf->GetInletState().GetPressure()); SetHistoryOutputValue("PressureOut_" + tag.str(), BladePerf->GetOutletState().GetPressure()); + SetHistoryOutputValue("TotalTemperatureIn_" + tag.str(), BladePerf->GetInletState().GetTotalTemperature()); + SetHistoryOutputValue("TotalTemperatureOut_" + tag.str(), BladePerf->GetOutletState().GetTotalTemperature()); + SetHistoryOutputValue("TemperatureIn_" + tag.str(), BladePerf->GetInletState().GetTemperature()); + SetHistoryOutputValue("TemperatureOut_" + tag.str(), BladePerf->GetOutletState().GetTemperature()); SetHistoryOutputValue("DensityIn_" + tag.str(), BladePerf->GetInletState().GetDensity()); SetHistoryOutputValue("DensityOut_" + tag.str(), BladePerf->GetOutletState().GetDensity()); SetHistoryOutputValue("NormalVelocityIn_" + tag.str(), BladePerf->GetInletState().GetVelocity()[0]); @@ -604,6 +608,8 @@ void CFlowCompOutput::LoadTurboHistoryData(std::shared_ptrGetOutletState().GetMachValue()); SetHistoryOutputValue("AbsFlowAngleIn_" + tag.str(), BladePerf->GetInletState().GetAbsFlowAngle()*180/PI_NUMBER); SetHistoryOutputValue("AbsFlowAngleOut_" + tag.str(), BladePerf->GetOutletState().GetAbsFlowAngle()*180/PI_NUMBER); + SetHistoryOutputValue("KineticEnergyLoss_" + tag.str(), BladePerf->GetKineticEnergyLoss()); + SetHistoryOutputValue("TotPressureLoss_" + tag.str(), BladePerf->GetTotalPressureLoss()); } SetHistoryOutputValue("EntropyGeneration", TurboStagePerf->GetNormEntropyGen()*100); SetHistoryOutputValue("EulerianWork", TurboStagePerf->GetEulerianWork()); @@ -611,6 +617,8 @@ void CFlowCompOutput::LoadTurboHistoryData(std::shared_ptrGetTotalTotalEfficiency()*100); SetHistoryOutputValue("PressureRatioTS", TurboStagePerf->GetTotalStaticPressureRatio()); SetHistoryOutputValue("PressureRatioTT", TurboStagePerf->GetTotalTotalPressureRatio()); + SetHistoryOutputValue("KineticEnergyLoss_Stage", TurboStagePerf->GetKineticEnergyLoss()); + SetHistoryOutputValue("TotPressureLoss_Stage", TurboStagePerf->GetTotalPressureLoss()); } void CFlowCompOutput::WriteTurboSpanwisePerformance(std::shared_ptr TurboPerf, CGeometry *geometry, CConfig **config, unsigned short val_iZone) { diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 5ffee0d23f5..895419f264d 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -4066,6 +4066,10 @@ void CFlowOutput::AddTurboOutput(unsigned short nZone){ AddHistoryOutput("TotalPressureOut_" + tag, "TotPressureOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Flow angle in " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("PressureIn_" + tag, "PressureIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Pressure ratio " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("PressureOut_" + tag, "PressureOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Flow angle in " + tag, HistoryFieldType::DEFAULT); + AddHistoryOutput("TotalTemperatureIn_" + tag, "TotTemperatureIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Temperature ratio " + tag, HistoryFieldType::DEFAULT); + AddHistoryOutput("TotalTemperatureOut_" + tag, "TotTemperatureOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Flow angle in " + tag, HistoryFieldType::DEFAULT); + AddHistoryOutput("TemperatureIn_" + tag, "TemperatureIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Temperature ratio " + tag, HistoryFieldType::DEFAULT); + AddHistoryOutput("TemperatureOut_" + tag, "TemperatureOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Flow angle in " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("DensityIn_" + tag, "DensityIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Flow angle out " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("DensityOut_" + tag, "DensityOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Absolute flow angle in " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("NormalVelocityIn_" + tag, "NormalVelocityIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Absolute flow angle out " + tag, HistoryFieldType::DEFAULT); @@ -4078,12 +4082,16 @@ void CFlowOutput::AddTurboOutput(unsigned short nZone){ AddHistoryOutput("MachOut_" + tag, "MachOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Total-to-Static efficiency " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("AbsFlowAngleIn_" + tag, "AbsFlowAngleIn_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Absolute flow angle in " + tag, HistoryFieldType::DEFAULT); AddHistoryOutput("AbsFlowAngleOut_" + tag, "AbsFlowAngleOut_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Absolute flow angle out " + tag, HistoryFieldType::DEFAULT); + AddHistoryOutput("KineticEnergyLoss_" + tag, "KELC_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Blade Kinetic Energy Loss Coefficient", HistoryFieldType::DEFAULT); + AddHistoryOutput("TotPressureLoss_" + tag, "TPLC_" + tag, ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Blade Pressure Loss Coefficient", HistoryFieldType::DEFAULT); } //Adds turbomachinery machine performance variables AddHistoryOutput("EntropyGeneration", "EntropyGen", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); - AddHistoryOutput("EulerianWork", "EulerianWork", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); - AddHistoryOutput("TotalStaticEfficiency", "TotStaticEff", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); - AddHistoryOutput("TotalTotalEfficiency", "TotTotEff", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); - AddHistoryOutput("PressureRatioTS", "PRTS", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); - AddHistoryOutput("PressureRatioTT", "PRTT", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine entropy generation", HistoryFieldType::DEFAULT); + AddHistoryOutput("EulerianWork", "EulerianWork", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine Eulerian work", HistoryFieldType::DEFAULT); + AddHistoryOutput("TotalStaticEfficiency", "TotStaticEff", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine total-to-static efficiency", HistoryFieldType::DEFAULT); + AddHistoryOutput("TotalTotalEfficiency", "TotTotEff", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine total-to-total efficiency", HistoryFieldType::DEFAULT); + AddHistoryOutput("PressureRatioTS", "PRTS", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine total-to-static pressure ratio", HistoryFieldType::DEFAULT); + AddHistoryOutput("PressureRatioTT", "PRTT", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine total-to-toal pressure ratio", HistoryFieldType::DEFAULT); + AddHistoryOutput("KineticEnergyLoss_Stage", "KELC_all", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine Kinetic Energy Loss Coefficient", HistoryFieldType::DEFAULT); + AddHistoryOutput("TotPressureLoss_Stage", "TPLC_all", ScreenOutputFormat::SCIENTIFIC, "TURBO_PERF", "Machine Pressure Loss Coefficient", HistoryFieldType::DEFAULT); } diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index d8aa5c16af9..499d0d69fd5 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -25,6 +25,9 @@ * License along with SU2. If not, see . */ +#include +#include + #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../include/solvers/CSolver.hpp" @@ -47,6 +50,15 @@ #include "../../include/output/filewriter/CSU2BinaryFileWriter.hpp" #include "../../include/output/filewriter/CSU2MeshFileWriter.hpp" +namespace { +volatile sig_atomic_t STOP; + +void signalHandler(int signum) { + std::cout << "Interrupt signal (" << signum << ") received, saving files and exiting.\n"; + STOP = 1; +} +} + COutput::COutput(const CConfig *config, unsigned short ndim, bool fem_output): rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()), @@ -169,7 +181,11 @@ COutput::COutput(const CConfig *config, unsigned short ndim, bool fem_output): volumeDataSorter = nullptr; surfaceDataSorter = nullptr; - headerNeeded = false; + headerNeeded = false; + + /*--- Setup a signal handler for SIGTERM. ---*/ + + signal(SIGTERM, signalHandler); } COutput::~COutput() { @@ -233,7 +249,7 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon if (config[ZONE_0]->GetMultizone_Problem()) Iter = OuterIter; - + /*--- Turbomachinery Performance Screen summary output---*/ if (Iter%100 == 0 && rank == MASTER_NODE) { SetTurboPerformance_Output(TurboPerf, config[val_iZone], TimeIter, OuterIter, InnerIter); @@ -946,9 +962,13 @@ bool COutput::ConvergenceMonitoring(CConfig *config, unsigned long Iteration) { if (convFields.empty() || Iteration < config->GetStartConv_Iter()) convergence = false; + /*--- If a SIGTERM signal is sent to one of the processes, we set convergence to true. ---*/ + if (STOP) convergence = true; + /*--- Apply the same convergence criteria to all processors. ---*/ unsigned short local = convergence, global = 0; + SU2_MPI::Allreduce(&local, &global, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); convergence = global > 0; diff --git a/SU2_CFD/src/output/CTurboOutput.cpp b/SU2_CFD/src/output/CTurboOutput.cpp index b0e61f10e25..59430179231 100644 --- a/SU2_CFD/src/output/CTurboOutput.cpp +++ b/SU2_CFD/src/output/CTurboOutput.cpp @@ -60,7 +60,7 @@ void CTurbomachineryState::ComputeState(CFluidModel& fluidModel, const CTurbomac Pressure = primitiveState.GetPressure(); std::vector velocity = primitiveState.GetVelocity(); Velocity.assign(velocity.begin(), velocity.end()); - su2double tangVel = primitiveState.GetTangVelocity(); + TangVelocity = primitiveState.GetTangVelocity(); /*--- Compute static TD quantities ---*/ fluidModel.SetTDState_Prho(Pressure, Density); @@ -81,9 +81,9 @@ void CTurbomachineryState::ComputeState(CFluidModel& fluidModel, const CTurbomac std::for_each(Mach.begin(), Mach.end(), [&](su2double& el) { el /= soundSpeed; }); /*--- Compute relative kinematic quantities ---*/ - su2double tangVel2 = tangVel * tangVel; + su2double tangVel2 = TangVelocity * TangVelocity; RelVelocity.assign(Velocity.begin(), Velocity.end()); - RelVelocity[1] -= tangVel; + RelVelocity[1] -= TangVelocity; su2double relVel2 = GetRelVelocityValue(); FlowAngle = atan(RelVelocity[1] / RelVelocity[0]); RelMach.assign(RelVelocity.begin(), RelVelocity.end()); @@ -244,6 +244,8 @@ void CTurbomachineryStagePerformance::ComputeTurbineStagePerformance(const CTurb fluidModel.SetTDState_Ps(OutState.GetPressure(), InState.GetEntropy()); su2double enthalpyOutIs = fluidModel.GetStaticEnergy() + OutState.GetPressure() / fluidModel.GetDensity(); su2double totEnthalpyOutIs = enthalpyOutIs + 0.5 * OutState.GetVelocityValue() * OutState.GetVelocityValue(); + su2double tangVel = OutState.GetTangVelocity(); + su2double relVelOutIs2 = 2 * (OutState.GetRothalpy() - enthalpyOutIs) + tangVel * tangVel; /*--- Compute turbine stage performance ---*/ NormEntropyGen = (OutState.GetEntropy() - InState.GetEntropy()) / InState.GetEntropy(); @@ -252,6 +254,9 @@ void CTurbomachineryStagePerformance::ComputeTurbineStagePerformance(const CTurb TotalTotalEfficiency = EulerianWork / (InState.GetTotalEnthalpy() - totEnthalpyOutIs); TotalStaticPressureRatio = InState.GetTotalPressure() / OutState.GetPressure(); TotalTotalPressureRatio = InState.GetTotalPressure() / OutState.GetTotalPressure(); + TotalPressureLoss = (InState.GetTotalRelPressure() - OutState.GetTotalRelPressure()) / + (OutState.GetTotalRelPressure() - OutState.GetPressure()); + KineticEnergyLoss = 2 * (OutState.GetEnthalpy() - enthalpyOutIs) / relVelOutIs2; } void CTurbomachineryStagePerformance::ComputeCompressorStagePerformance(const CTurbomachineryState& InState, diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e38f88e6c40..286a84e21c7 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -232,6 +232,9 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Exhaust_Pressure.resize(nMarker); Exhaust_Area.resize(nMarker); + /*--- Turbomachinery simulation ---*/ + AverageMassFlowRate.resize(nMarker); + /*--- Read farfield conditions from config ---*/ Temperature_Inf = config->GetTemperature_FreeStreamND(); @@ -279,6 +282,8 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Exhaust_Temperature[iMarker] = Temperature_Inf; Exhaust_Pressure[iMarker] = Pressure_Inf; Exhaust_Area[iMarker] = 0.0; + + AverageMassFlowRate[iMarker] = 0.0; } /*--- Initialize the solution to the far-field state everywhere. ---*/ @@ -6422,6 +6427,16 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu break; + case MASS_FLOW_OUTLET: + auto const MassFlowRate_e = config->GetGiles_Var1(Marker_Tag); + auto const relFacMassFlowRate = config->GetGiles_Var2(Marker_Tag); + + Pressure_e = AveragePressure[val_marker][nSpanWiseSections]+relFacMassFlowRate*GetFluidModel()->GetdPdrho_e()*(AverageMassFlowRate[val_marker]-MassFlowRate_e); + + /*--- Compute avg characteristic jump ---*/ + c_avg[nDim + 1] = -2.0*(AveragePressure[val_marker][iSpan]-Pressure_e); + break; + } /*--- Loop over all the vertices on this boundary marker ---*/ @@ -6593,7 +6608,7 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu break; - case STATIC_PRESSURE:case STATIC_PRESSURE_1D:case MIXING_OUT:case RADIAL_EQUILIBRIUM:case MIXING_OUT_1D: + case STATIC_PRESSURE:case STATIC_PRESSURE_1D:case MIXING_OUT:case RADIAL_EQUILIBRIUM:case MIXING_OUT_1D: case MASS_FLOW_OUTLET: /* --- implementation of Giles BC---*/ if(config->GetSpatialFourier()){ @@ -9084,8 +9099,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC /*--- Compute the averaged value for the boundary of interest for the span of interest ---*/ const bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); - su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, - avgVelocity[MAXNDIM] = {0}; + su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, avgVelocity[MAXNDIM] = {0}; for (auto iVar = 0u; iVarGetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ auto Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetBoolGiles() || config->GetBoolRiemann()){ + if(config->GetMarker_All_Giles(iMarker) || config->GetBoolRiemann()){ // May have to implement something similar for Riemann? if(config->GetBoolRiemann()){ if(config->GetKind_Data_Riemann(Marker_Tag) == RADIAL_EQUILIBRIUM){ RadialEquilibriumPressure[iMarker][nSpanWiseSections/2] = config->GetRiemann_Var1(Marker_Tag)/config->GetPressure_Ref(); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 5b81394bd9a..215445d2c5e 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -325,7 +325,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0)); Pressure_Thermodynamic = config->GetPressure_Thermodynamic(); - auxFluidModel = new CFluidScalar(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic, config); + auxFluidModel = new CFluidScalar(Pressure_Thermodynamic, config); auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init()); break; @@ -482,7 +482,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i break; case FLUID_MIXTURE: - fluidModel = new CFluidScalar(Specific_Heat_CpND, Gas_ConstantND, Pressure_ThermodynamicND, config); + fluidModel = new CFluidScalar(Pressure_ThermodynamicND, config); fluidModel->SetTDState_T(Temperature_FreeStreamND, config->GetSpecies_Init()); break; diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index bfbd4edad58..f8327c868bd 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -1730,6 +1730,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, CSolver *solverFlow = solver_container[iMesh][FLOW_SOL]; CSolver *solverTurb = solver_container[iMesh][TURB_SOL]; + CSolver *solverSpecies = solver_container[iMesh][SPECIES_SOL]; /* Compute the reduction factor for CFLs on the coarse levels. */ @@ -1744,10 +1745,12 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, solver residual within the specified number of linear iterations. */ su2double linResTurb = 0.0; + su2double linResSpecies = 0.0; if ((iMesh == MESH_0) && solverTurb) linResTurb = solverTurb->GetResLinSolver(); + if ((iMesh == MESH_0) && solverSpecies) linResSpecies = solverSpecies->GetResLinSolver(); - /* Max linear residual between flow and turbulence. */ - const su2double linRes = max(solverFlow->GetResLinSolver(), linResTurb); + /* Max linear residual between flow and turbulence/species transport. */ + const su2double linRes = max(solverFlow->GetResLinSolver(), max(linResTurb, linResSpecies)); /* Tolerance limited to an acceptable value. */ const su2double linTol = max(acceptableLinTol, config->GetLinear_Solver_Error()); @@ -1779,6 +1782,11 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, New_Func += log10(solverTurb->GetRes_RMS(iVar)); } } + if ((iMesh == MESH_0) && solverSpecies) { + for (unsigned short iVar = 0; iVar < solverSpecies->GetnVar(); iVar++) { + New_Func += log10(solverSpecies->GetRes_RMS(iVar)); + } + } /* Compute the difference in the nonlinear residuals between the current and previous iterations, taking care with very low initial @@ -1822,6 +1830,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, su2double myCFLMin = 1e30, myCFLMax = 0.0, myCFLSum = 0.0; const su2double CFLTurbReduction = config->GetCFLRedCoeff_Turb(); + const su2double CFLSpeciesReduction = config->GetCFLRedCoeff_Species(); SU2_OMP_MASTER if ((iMesh == MESH_0) && fullComms) { @@ -1888,6 +1897,9 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, if ((iMesh == MESH_0) && solverTurb) { solverTurb->GetNodes()->SetLocalCFL(iPoint, CFL * CFLTurbReduction); } + if ((iMesh == MESH_0) && solverSpecies) { + solverSpecies->GetNodes()->SetLocalCFL(iPoint, CFL * CFLSpeciesReduction); + } /* Store min and max CFL for reporting on the fine grid. */ diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index c893649c1dd..af200ef7603 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -561,7 +561,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-6.614627, -3.001324, -14.336143, -8.776079, -11.382919, -5.852328, 73273.000000, 73273.000000, 0.019884, 82.491000] + Jones_tc_restart.test_vals = [-10.467026, -2.871699, -19.214627, -13.508254, -11.582396, -6.306163, 73273, 73273, 0.019884, 82.491] test_list.append(Jones_tc_restart) # 2D axial stage @@ -582,6 +582,15 @@ def main(): transonic_stator_restart.test_vals_aarch64 = [-5.007735, -3.099310, -2.751696, 1.091966, -3.542819, 2.163237, -471630, 94.866, -0.035738] test_list.append(transonic_stator_restart) + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.632374, -8.895124, -9.350417] + multi_interface.test_vals_aarch64 = [-8.632374, -8.895124, -9.350417] + test_list.append(multi_interface) + ###################################### ### Sliding Mesh ### ###################################### diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 0137b08806c..4047b6b39ba 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1083,7 +1083,7 @@ def main(): Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" Aachen_3D_restart.test_iter = 5 Aachen_3D_restart.enabled_with_asan = False - Aachen_3D_restart.test_vals = [-9.853215, -8.891480, -9.610418, -8.028579, -7.792957, -4.384186] + Aachen_3D_restart.test_vals = [-9.829186, -8.875103, -9.609509, -8.075211, -7.759491, -4.360714] test_list.append(Aachen_3D_restart) # Jones APU Turbocharger restart @@ -1091,7 +1091,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-6.614623, -3.001323, -14.336147, -8.776081, -11.382919, -5.852327, 73273, 73273, 0.019884, 82.491] + Jones_tc_restart.test_vals = [-10.467612, -2.871708, -19.345651, -13.625871, -11.582397, -6.306168, 73273, 73273, 0.019884, 82.491] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1112,6 +1112,15 @@ def main(): transonic_stator_restart.test_vals_aarch64 = [-5.011834, -3.091110, -2.757795, 1.087934, -3.544707, 2.166101, -471630, 94.868, -0.035888] test_list.append(transonic_stator_restart) + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.632374, -8.895124, -9.350417] + multi_interface.test_vals_aarch64 = [-8.632374, -8.895124, -9.350417] + test_list.append(multi_interface) + ###################################### ### Sliding Mesh ### ###################################### diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 080b41053b7..08b45e3b3ff 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -860,7 +860,7 @@ def main(): Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine" Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" Aachen_3D_restart.test_iter = 5 - Aachen_3D_restart.test_vals = [-9.853207, -8.891479, -9.610411, -8.028566, -7.792947, -4.384177] + Aachen_3D_restart.test_vals = [-9.829185, -8.875103, -9.609505, -8.075194, -7.759490, -4.360713] test_list.append(Aachen_3D_restart) # Jones APU Turbocharger restart @@ -868,7 +868,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-6.614623, -3.001323, -14.336147, -8.776081, -11.382919, -5.852327, 73273.000000, 73273.000000, 0.019884, 82.491000] + Jones_tc_restart.test_vals = [-10.466644, -2.871703, -19.193464, -13.487820, -11.582397, -6.306167, 73273, 73273, 0.019884, 82.491] test_list.append(Jones_tc_restart) # 2D axial stage @@ -889,6 +889,15 @@ def main(): transonic_stator_restart.test_vals_aarch64 = [-5.008547, -3.102420, -2.752033, 1.091152, -3.543849, 2.169844, -471630, 94.866, -0.035806] test_list.append(transonic_stator_restart) + # Multiple turbomachinery interface restart + multi_interface = TestCase('multi_interface') + multi_interface.cfg_dir = "turbomachinery/multi_interface" + multi_interface.cfg_file = "multi_interface_rst.cfg" + multi_interface.test_iter = 5 + multi_interface.test_vals = [-8.632374, -8.895124, -9.350417] + multi_interface.test_vals_aarch64 = [-8.632374, -8.895124, -9.350417] + test_list.append(multi_interface) + ###################################### ### Sliding Mesh ### diff --git a/TestCases/turbomachinery/multi_interface/multi_interface_rst.cfg b/TestCases/turbomachinery/multi_interface/multi_interface_rst.cfg new file mode 100644 index 00000000000..a52301e7153 --- /dev/null +++ b/TestCases/turbomachinery/multi_interface/multi_interface_rst.cfg @@ -0,0 +1,151 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Quarter Concentirc Cylinder Channel w/ % +% Different Interface Methods % +% Author: J. Kelly % +% Institution: University of Liverpool % +% Date: Sep 5th, 2024 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +MULTIZONE= YES +CONFIG_LIST=(zone_1.cfg,zone_2.cfg,zone_3.cfg) +NZONES=3 +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= RANS +KIND_TURB_MODEL= SA +MATH_PROBLEM= DIRECT +RESTART_SOL= YES +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +MACH_NUMBER= 0.35 +AOA= 0.0 +FREESTREAM_PRESSURE= 100.0E+03 +FREESTREAM_TEMPERATURE= 300.0 +FREESTREAM_DENSITY= 1.205 +FREESTREAM_OPTION= TEMPERATURE_FS +FREESTREAM_TURBULENCEINTENSITY = 0.05 +FREESTREAM_TURB2LAMVISCRATIO = 100.0 +INIT_OPTION= TD_CONDITIONS +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.00 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 +REF_DIMENSIONALIZATION= DIMENSIONAL +% +% ------------------------------ EQUATION OF STATE ----------------------------% +% +FLUID_MODEL= STANDARD_AIR +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= SUTHERLAND +MU_REF= 1.716E-5 +MU_T_REF= 273.15 +SUTHERLAND_CONSTANT= 110.4 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= (HUB1, 0.0, SHROUD1, 0.0, HUB2, 0.0, SHROUD2, 0.0, HUB3, 0.0, SHROUD3, 0.0) +MARKER_PERIODIC= (PER1, PER2, 0.0, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 0.0, 0.0, PER4, PER3, 0.0, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 0.0, 0.0, PER6, PER5, 0.0, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 0.0, 0.0) +% +%-------- INFLOW/OUTFLOW BOUNDARY CONDITION SPECIFIC FOR TURBOMACHINERY --------% +% +MARKER_TURBOMACHINERY= (INFLOW, OUTMIX_0, INMIX_1, OUTMIX_1, INMIX_2, OUTFLOW) +MARKER_ZONE_INTERFACE= (OUTMIX_0, INMIX_1, OUTMIX_1, INMIX_2) +MARKER_FLUID_INTERFACE= (OUTMIX_0, INMIX_1) +MARKER_MIXINGPLANE_INTERFACE= (OUTMIX_1, INMIX_2) +MARKER_GILES= (INFLOW, TOTAL_CONDITIONS_PT, 104E+03, 300, 1.0, 0.0, 0.0, 1.0, 0.0, OUTMIX_1, MIXING_OUT, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, INMIX_2, MIXING_IN, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, OUTFLOW, STATIC_PRESSURE_1D, 90.0E+03, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) +GILES_EXTRA_RELAXFACTOR= (0.05, 0.05) +SPATIAL_FOURIER= NO +% +%---------------------------- TURBOMACHINERY SIMULATION -----------------------------% +% +TURBOMACHINERY_KIND= AXIAL, AXIAL, AXIAL +TURBO_PERF_KIND= (TURBINE, TURBINE, TURBINE) +MIXINGPLANE_INTERFACE_KIND= LINEAR_INTERPOLATION +TURBULENT_MIXINGPLANE= YES +RAMP_OUTLET_PRESSURE= NO +AVERAGE_PROCESS_KIND= MIXEDOUT +PERFORMANCE_AVERAGE_PROCESS_KIND= MIXEDOUT +MIXEDOUT_COEFF= (1.0, 1.0E-05, 100) +AVERAGE_MACH_LIMIT= 0.05 +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 2.0 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.99, 1.01, 1.0, 20, 1E-4) +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_ERROR= 1E-4 +LINEAR_SOLVER_ITER= 5 +% +% ----------------------- SLOPE LIMITER DEFINITION ----------------------------% +% +VENKAT_LIMITER_COEFF= 0.01 +LIMITER_ITER= 999999 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN_WANG +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +TIME_DISCRE_TURB= EULER_IMPLICIT +CFL_REDUCTION_TURB= 1.0 +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +OUTER_ITER= 10 +CONV_FIELD= RMS_DENSITY +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 0 +CONV_CAUCHY_ELEMS= 999 +CONV_CAUCHY_EPS= 1E-6 +SCREEN_OUTPUT= (OUTER_ITER, RMS_DENSITY[0], RMS_DENSITY[1], RMS_DENSITY[2]) +OUTPUT_FILES= RESTART +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= three_zone_quarter_cyl.su2 +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat +TABULAR_FORMAT= TECPLOT +CONV_FILENAME= history +RESTART_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat +VOLUME_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint +GRAD_OBJFUNC_FILENAME= of_grad.dat +SURFACE_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint +OUTPUT_WRT_FREQ= 100 +HISTORY_WRT_FREQ_OUTER= 1 +WRT_ZONE_CONV= NO +WRT_ZONE_HIST= YES diff --git a/TestCases/turbomachinery/multi_interface/zone_1.cfg b/TestCases/turbomachinery/multi_interface/zone_1.cfg new file mode 100644 index 00000000000..3d7a019754a --- /dev/null +++ b/TestCases/turbomachinery/multi_interface/zone_1.cfg @@ -0,0 +1,6 @@ +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +% +% +% Type of dynamic mesh (NONE, ROTATING_FRAME) +GRID_MOVEMENT= NONE +% diff --git a/TestCases/turbomachinery/multi_interface/zone_2.cfg b/TestCases/turbomachinery/multi_interface/zone_2.cfg new file mode 100644 index 00000000000..3d7a019754a --- /dev/null +++ b/TestCases/turbomachinery/multi_interface/zone_2.cfg @@ -0,0 +1,6 @@ +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +% +% +% Type of dynamic mesh (NONE, ROTATING_FRAME) +GRID_MOVEMENT= NONE +% diff --git a/TestCases/turbomachinery/multi_interface/zone_3.cfg b/TestCases/turbomachinery/multi_interface/zone_3.cfg new file mode 100644 index 00000000000..3d7a019754a --- /dev/null +++ b/TestCases/turbomachinery/multi_interface/zone_3.cfg @@ -0,0 +1,6 @@ +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +% +% +% Type of dynamic mesh (NONE, ROTATING_FRAME) +GRID_MOVEMENT= NONE +%