From 629064713e569e1268aaafe569a2f71af4360e2b Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Wed, 25 Oct 2023 10:16:57 +0200 Subject: [PATCH 01/21] Created branch for solid-to-solid conjugate heat transfer capability --- Common/include/option_structure.hpp | 1 + SU2_CFD/src/drivers/CDriver.cpp | 23 +++++++++++++---------- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 3 +++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 5fe8228925e..755a38f4b48 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -409,6 +409,7 @@ enum ENUM_TRANSFER { CONJUGATE_HEAT_WEAKLY_FS = 17, /*!< \brief Conjugate heat transfer (between incompressible fluids and solids). */ CONJUGATE_HEAT_SF = 18, /*!< \brief Conjugate heat transfer (between solids and compressible fluids). */ CONJUGATE_HEAT_WEAKLY_SF = 19, /*!< \brief Conjugate heat transfer (between solids and incompressible fluids). */ + CONJUGATE_HEAT_SS = 20, /*!< \brief Conjugate heat transfer (between two solids). */ }; /*! diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index c33977ad33f..45eacbcf808 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2492,19 +2492,22 @@ void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeomet if (rank == MASTER_NODE) cout << "sliding interface." << endl; } else if (heat_donor || heat_target) { - if (heat_donor && heat_target) - SU2_MPI::Error("Conjugate heat transfer between solids is not implemented.", CURRENT_FUNCTION); + if (heat_donor && heat_target){ + interface_type = CONJUGATE_HEAT_SS; - const auto fluidZone = heat_target? donor : target; + } else { - if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) - || (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET)) - interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF; - else if (config[fluidZone]->GetWeakly_Coupled_Heat()) - interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; - else - interface_type = NO_TRANSFER; + const auto fluidZone = heat_target? donor : target; + if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) + || (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET)) + interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF; + else if (config[fluidZone]->GetWeakly_Coupled_Heat()) + interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; + else + interface_type = NO_TRANSFER; + } + if (interface_type != NO_TRANSFER) { auto nVar = 4; interface[donor][target] = new CConjugateHeatInterface(nVar, 0); diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 49a9c58e724..95ff11d2064 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -585,6 +585,9 @@ bool CMultizoneDriver::TransferData(unsigned short donorZone, unsigned short tar BroadcastData(SPECIES_SOL, SPECIES_SOL); } break; + case CONJUGATE_HEAT_SS: + BroadcastData(HEAT_SOL, HEAT_SOL); + break; case CONJUGATE_HEAT_FS: BroadcastData(FLOW_SOL, HEAT_SOL); break; From 9f008026d17eaae24ba3b77bb39553eb7b17d8be Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Wed, 15 Nov 2023 17:28:20 +0100 Subject: [PATCH 02/21] Added contact resistance model used in Fluent --- SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 5aa6772907f..361ea5b7b27 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -133,7 +133,10 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { const su2double rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetMaterialDensity(0); - conductivity_over_dist = thermal_diffusivity*rho_cp_solid/dist; + const su2double thermal_conductivity = thermal_diffusivity * rho_cp_solid; + // TODO: add proper contact resistance here. + const su2double R_c = 0.0; + conductivity_over_dist = thermal_conductivity/(dist + thermal_conductivity * R_c); } } From 8c8a62dcc61d8e6acc2e0a30a60e2ca74c9a4311 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Fri, 17 Nov 2023 10:45:04 +0100 Subject: [PATCH 03/21] Defined config option for thermal contact resistance between zones --- Common/include/CConfig.hpp | 17 +++++++++++++++++ Common/src/CConfig.cpp | 13 +++++++++++++ SU2_CFD/include/interfaces/CInterface.hpp | 1 + .../interfaces/cht/CConjugateHeatInterface.hpp | 3 +++ SU2_CFD/src/interfaces/CInterface.cpp | 2 ++ .../interfaces/cht/CConjugateHeatInterface.cpp | 6 ++---- 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index da11f902606..ef3d26bb43c 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -191,6 +191,7 @@ class CConfig { nMarker_Fluid_Load, /*!< \brief Number of markers in which the flow load is computed/employed. */ nMarker_Fluid_InterfaceBound, /*!< \brief Number of fluid interface markers. */ nMarker_CHTInterface, /*!< \brief Number of conjugate heat transfer interface markers. */ + nMarker_ContactResistance, /*!< \brief Number of CHT interfaces with contact resistance. */ nMarker_Inlet, /*!< \brief Number of inlet flow markers. */ nMarker_Inlet_Species, /*!< \brief Number of inlet species markers. */ nSpecies_per_Inlet, /*!< \brief Number of species defined per inlet markers. */ @@ -400,6 +401,7 @@ class CConfig { su2double **Periodic_RotCenter; /*!< \brief Rotational center for each periodic boundary. */ su2double **Periodic_RotAngles; /*!< \brief Rotation angles for each periodic boundary. */ su2double **Periodic_Translation; /*!< \brief Translation vector for each periodic boundary. */ + su2double *CHT_ContactResistance; /*!< \brief Contact resistance values for each solid-solid CHT interface. */ string *Marker_CfgFile_TagBound; /*!< \brief Global index for markers using config file. */ unsigned short *Marker_All_KindBC, /*!< \brief Global index for boundaries using grid information. */ *Marker_CfgFile_KindBC; /*!< \brief Global index for boundaries using config file. */ @@ -592,6 +594,7 @@ class CConfig { bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */ bool FSI_Problem = false,/*!< \brief Boolean to determine whether the simulation is FSI or not. */ Multizone_Problem; /*!< \brief Boolean to determine whether we are solving a multizone problem. */ + bool ContactResistance = false; /*!< \brief Apply contact resistance for conjugate heat transfer. */ unsigned short nID_DV; /*!< \brief ID for the region of FEM when computed using direct differentiation. */ bool AD_Mode; /*!< \brief Algorithmic Differentiation support. */ @@ -3611,6 +3614,20 @@ class CConfig { */ unsigned short GetMarker_n_ZoneInterface(void) const { return nMarker_ZoneInterface; } + /*! + * \brief Contact resistance values are supplied for CHT interfaces. + * \param[in] void + * \return Application of contact resistance. + */ + bool ApplyContactResistance(void) const { return ContactResistance; } + + /*! + * \brief Get the contact resistance value of a specified interface. + * \param[in] val_interface interface index. + * \return Contact resistance value. + */ + const su2double GetContactResistance(unsigned short val_interface) const { return CHT_ContactResistance[val_interface]; } + /*! * \brief Get the DV information for a marker val_marker. * \param[in] val_marker - 0 or 1 depending if the the marker is going to be affected by design variables. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a34902142cf..9163702428c 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1509,6 +1509,8 @@ void CConfig::SetConfig_Options() { addStringListOption("MARKER_ZONE_INTERFACE", nMarker_ZoneInterface, Marker_ZoneInterface); /*!\brief MARKER_CHT_INTERFACE \n DESCRIPTION: CHT interface boundary marker(s) \ingroup Config*/ addStringListOption("MARKER_CHT_INTERFACE", nMarker_CHTInterface, Marker_CHTInterface); + /*!\brief CHT_INTERFACE_CONTACT_RESISTANCE: Thermal contact resistance values for each CHT inerface. \ingroup Config*/ + addDoubleListOption("CHT_INTERFACE_CONTACT_RESISTANCE", nMarker_ContactResistance, CHT_ContactResistance); /* DESCRIPTION: Internal boundary marker(s) */ addStringListOption("MARKER_INTERNAL", nMarker_Internal, Marker_Internal); /* DESCRIPTION: Custom boundary marker(s) */ @@ -3562,6 +3564,17 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error(string("You probably want to set INC_ENERGY_EQUATION= YES for the fluid solver. \n"), CURRENT_FUNCTION); } + /*--- Check correctness and consistency of contact resistance options. ---*/ + if (nMarker_ContactResistance > 0) { + ContactResistance = true; + if ((nMarker_CHTInterface/2) != nMarker_ContactResistance) + SU2_MPI::Error(string("Number of CHT interfaces does not match number of contact resistances. \n"), CURRENT_FUNCTION); + for (auto iCHTMarker=0u; iCHTMarker < nMarker_ContactResistance; iCHTMarker++){ + if (CHT_ContactResistance[iCHTMarker] < 0) + SU2_MPI::Error(string("Contact resistance value should be positive. \n"), CURRENT_FUNCTION); + } + } + /*--- By default, in 2D we should use TWOD_AIRFOIL (independenly from the input file) ---*/ if (val_nDim == 2) Geo_Description = TWOD_AIRFOIL; diff --git a/SU2_CFD/include/interfaces/CInterface.hpp b/SU2_CFD/include/interfaces/CInterface.hpp index 7830e091085..3baac075bba 100644 --- a/SU2_CFD/include/interfaces/CInterface.hpp +++ b/SU2_CFD/include/interfaces/CInterface.hpp @@ -228,4 +228,5 @@ class CInterface { */ void GatherAverageTurboGeoValues(CGeometry *donor_geometry, CGeometry *target_geometry, unsigned short donorZone); + inline virtual void SetContactResistance(su2double val_contact_resistance) {}; }; diff --git a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp index 093675bb5dc..b372ca84980 100644 --- a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp +++ b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp @@ -35,6 +35,7 @@ * \ingroup Interfaces */ class CConjugateHeatInterface : public CInterface { + su2double ContactResistance = 0; /*!<\brief Contact resistance value of the current inerface. */ public: /*! * \brief Constructor of the class. @@ -70,4 +71,6 @@ class CConjugateHeatInterface : public CInterface { */ void SetTarget_Variable(CSolver *target_solution, CGeometry *target_geometry, const CConfig *target_config, unsigned long Marker_Target, unsigned long Vertex_Target, unsigned long Point_Target) override; + + void SetContactResistance(su2double val_contact_resistance) override { ContactResistance = val_contact_resistance; } }; diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 4d8d33b3ecf..72b94b46337 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -108,6 +108,8 @@ void CInterface::BroadcastData(const CInterpolator& interpolator, su2activematrix sendDonorVar(nLocalVertexDonor, nVar); if (markDonor >= 0) { + if (donor_config->ApplyContactResistance()) + SetContactResistance(donor_config->GetContactResistance(iMarkerInt)); for (auto iVertex = 0ul, iSend = 0ul; iVertex < donor_geometry->GetnVertex(markDonor); iVertex++) { const auto iPoint = donor_geometry->vertex[markDonor][iVertex]->GetNode(); diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 361ea5b7b27..270ec227a15 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -133,10 +133,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { const su2double rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetMaterialDensity(0); - const su2double thermal_conductivity = thermal_diffusivity * rho_cp_solid; - // TODO: add proper contact resistance here. - const su2double R_c = 0.0; - conductivity_over_dist = thermal_conductivity/(dist + thermal_conductivity * R_c); + thermal_conductivity = thermal_diffusivity * rho_cp_solid; + conductivity_over_dist = thermal_conductivity/(dist + thermal_conductivity * ContactResistance); } } From 293d8fd7a57874950f6e56d15209a0c7b2b47312 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 11 Dec 2023 16:00:25 +0100 Subject: [PATCH 04/21] removed trailing white spaces --- Common/include/CConfig.hpp | 4 ++-- Common/src/CConfig.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index e42b5289a49..1650a96944b 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -3603,7 +3603,7 @@ class CConfig { /*! * \brief Contact resistance values are supplied for CHT interfaces. * \param[in] void - * \return Application of contact resistance. + * \return Application of contact resistance. */ bool ApplyContactResistance(void) const { return ContactResistance; } @@ -3613,7 +3613,7 @@ class CConfig { * \return Contact resistance value. */ const su2double GetContactResistance(unsigned short val_interface) const { return CHT_ContactResistance[val_interface]; } - + /*! * \brief Get the DV information for a marker val_marker. * \param[in] val_marker - 0 or 1 depending if the the marker is going to be affected by design variables. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index c7ac5f75dfa..2068186e81d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3545,11 +3545,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if ((nMarker_CHTInterface/2) != nMarker_ContactResistance) SU2_MPI::Error(string("Number of CHT interfaces does not match number of contact resistances. \n"), CURRENT_FUNCTION); for (auto iCHTMarker=0u; iCHTMarker < nMarker_ContactResistance; iCHTMarker++){ - if (CHT_ContactResistance[iCHTMarker] < 0) + if (CHT_ContactResistance[iCHTMarker] < 0) SU2_MPI::Error(string("Contact resistance value should be positive. \n"), CURRENT_FUNCTION); } } - + /*--- By default, in 2D we should use TWOD_AIRFOIL (independenly from the input file) ---*/ if (val_nDim == 2) Geo_Description = TWOD_AIRFOIL; From dca70b2959f4fb9ece304b43b4dcc04f42f248d6 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 6 Aug 2024 10:28:44 +0200 Subject: [PATCH 05/21] Added test case for solid-to-solid conjugate heat transfer with contact resistance --- .../solid_solid_contact_resistance/fluid.cfg | 55 +++++++++++++++++++ .../solid_solid_contact_resistance/master.cfg | 31 +++++++++++ .../solid_1.cfg | 47 ++++++++++++++++ .../solid_2.cfg | 41 ++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg create mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg create mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg create mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg new file mode 100644 index 00000000000..f9a42d6a4c5 --- /dev/null +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg @@ -0,0 +1,55 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % +% with contact resistance. % +% Author: E.C.Bunschoten % +% Date: August 6, 2024 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% + +SOLVER= INC_NAVIER_STOKES +INC_ENERGY_EQUATION= YES + +% ------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION -------------------% + +FREESTREAM_TEMPERATURE= 300 + +INC_VELOCITY_INIT=(0.1, 0.0, 0.0) +FLUID_MODEL=INC_IDEAL_GAS + +VISCOSITY_MODEL=CONSTANT_VISCOSITY +MU_CONSTANT=1e-5 + +REF_DIMENSIONALIZATION= DIMENSIONAL +INC_NONDIM= DIMENSIONAL + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +INC_INLET_TYPE=VELOCITY_INLET +INC_OUTLET_TYPE=PRESSURE_OUTLET +MARKER_SYM= ( side_3 ) +MARKER_INLET= ( inlet, 300, 0.1, 1.0, 0.0, 0.0 ) +MARKER_OUTLET= ( outlet, 0.0) +MARKER_INTERNAL= (fluid) +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +CFL_NUMBER= 100 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +CONV_RESIDUAL_MINVAL= -12 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= fluid_mesh.su2 +CONV_FILENAME= history_fluid_3 +TABULAR_FORMAT= CSV \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg new file mode 100644 index 00000000000..32b47d8e09b --- /dev/null +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg @@ -0,0 +1,31 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % +% with contact resistance. % +% Author: E.C.Bunschoten % +% Date: August 6, 2024 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= MULTIPHYSICS +MATH_PROBLEM= DIRECT +MULTIZONE_MESH=NO +CONFIG_LIST = (solid_1.cfg, solid_2.cfg, fluid.cfg) +MARKER_ZONE_INTERFACE= (cht_interface_1_2, cht_interface_2_1, \ + cht_interface_1_3, cht_interface_3_1, \ + cht_interface_2_3, cht_interface_3_2) +MARKER_CHT_INTERFACE= (cht_interface_1_2, cht_interface_2_1, \ + cht_interface_1_3, cht_interface_3_1, \ + cht_interface_2_3, cht_interface_3_2) +CHT_INTERFACE_CONTACT_RESISTANCE = (1e-5, 0, 0) + +CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX +TIME_DOMAIN = NO +OUTER_ITER = 2000 +WRT_ZONE_HIST=YES + +OUTPUT_FILES=(RESTART, PARAVIEW_MULTIBLOCK) \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg new file mode 100644 index 00000000000..06f3d0561ef --- /dev/null +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg @@ -0,0 +1,47 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % +% with contact resistance. % +% Author: E.C.Bunschoten % +% Date: August 6, 2024 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= HEAT_EQUATION + + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= ( isothermal_wall_1, 500.0 ) +MARKER_SYM=(side_1) +MARKER_MONITORING= ( NONE ) +MARKER_INTERNAL=(solid_1) + +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% + +% We should keep the dimensionalization of the coupled flow solver +INC_NONDIM= DIMENSIONAL +FREESTREAM_TEMPERATURE= 300.0 + +% Properties of stainless steel +MATERIAL_DENSITY= 8935 +SPECIFIC_HEAT_CP= 3850 +THERMAL_CONDUCTIVITY_CONSTANT=26 + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +CFL_NUMBER= 100.0 + + +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% + +TIME_DISCRE_HEAT= EULER_IMPLICIT + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +TABULAR_FORMAT= CSV +CONV_FILENAME= history_solid_1 +MESH_FILENAME=solid_mesh_1.su2 \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg new file mode 100644 index 00000000000..213d2520a4e --- /dev/null +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg @@ -0,0 +1,41 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % +% with contact resistance. % +% Author: E.C.Bunschoten % +% Date: August 6, 2024 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= HEAT_EQUATION + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= ( isothermal_wall_2, 300.0 ) +MARKER_SYM=(side_2) +MARKER_INTERNAL=(solid_2) + +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% + +% We should keep the dimensionalization of the coupled flow solver +INC_NONDIM= DIMENSIONAL +FREESTREAM_TEMPERATURE= 300.0 + +MATERIAL_DENSITY= 8000 +SPECIFIC_HEAT_CP= 4420 +THERMAL_CONDUCTIVITY_CONSTANT= 61 + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +CFL_NUMBER= 100.0 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +MESH_FILENAME= solid_mesh_2.su2 +TABULAR_FORMAT= CSV +CONV_FILENAME= history_solid_2 + From 0e11d1f843ed5f043aaccd2e14b53c47c0fb23fd Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 6 Aug 2024 10:46:32 +0200 Subject: [PATCH 06/21] Added test case to regression tests. --- .github/workflows/regression.yml | 2 +- Common/include/CConfig.hpp | 2 +- TestCases/parallel_regression.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index af6f6c60875..f7e5b1952b1 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -213,7 +213,7 @@ jobs: uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: # -t -c - args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t develop -c feature_solid-solid_cht -s ${{matrix.testscript}} - name: Cleanup uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index af5bc3078bc..c7761753d33 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -3677,7 +3677,7 @@ class CConfig { * \param[in] val_interface interface index. * \return Contact resistance value. */ - const su2double GetContactResistance(unsigned short val_interface) const { return CHT_ContactResistance[val_interface]; } + su2double GetContactResistance(unsigned short val_interface) const { return CHT_ContactResistance[val_interface]; } /*! * \brief Get the DV information for a marker val_marker. diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 4cad2c9789c..9ab9f8024fa 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1339,6 +1339,16 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.multizone = True test_list.append(sp_pinArray_3d_cht_mf_hf_tp) + # Solid-to-solid and solid-to-fluid CHT with contact resistance + cht_CR = TestCase('cht_solid_solid') + cht_CR.cfg_dir = "coupled_cht/solid_solid_contact_resistance" + cht_CR.cfg_file = "master.cfg" + cht_CR.test_iter = 100 + cht_CR.test_vals = [-2.128827, -0.588812, -0.588812, -0.588812] + cht_CR.multizone = True + test_list.append(cht_CR) + + ########################## ### Python wrapper ### ########################## From 87ffec480982cec96b57d8cb30d4fc5f55a77dec Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 6 Aug 2024 11:45:47 +0200 Subject: [PATCH 07/21] Modified screen outputs --- .../coupled_cht/solid_solid_contact_resistance/master.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg index 32b47d8e09b..386f46991df 100644 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg @@ -28,4 +28,5 @@ TIME_DOMAIN = NO OUTER_ITER = 2000 WRT_ZONE_HIST=YES -OUTPUT_FILES=(RESTART, PARAVIEW_MULTIBLOCK) \ No newline at end of file +OUTPUT_FILES=(RESTART, PARAVIEW_MULTIBLOCK) +SCREEN_OUTPUT=(RMS_PRESSURE[2],RMS_VELOCITY-X[2],RMS_TEMPERATURE[0],RMS_TEMPERATURE[1]) \ No newline at end of file From faa0ca4dbdade6e1e8e94423a1839e807abb86c0 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 6 Aug 2024 12:19:41 +0200 Subject: [PATCH 08/21] Modified screen outputs --- TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg index 386f46991df..26e48176b16 100644 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg +++ b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg @@ -29,4 +29,4 @@ OUTER_ITER = 2000 WRT_ZONE_HIST=YES OUTPUT_FILES=(RESTART, PARAVIEW_MULTIBLOCK) -SCREEN_OUTPUT=(RMS_PRESSURE[2],RMS_VELOCITY-X[2],RMS_TEMPERATURE[0],RMS_TEMPERATURE[1]) \ No newline at end of file +SCREEN_OUTPUT=(OUTER_ITER, RMS_PRESSURE[2],RMS_VELOCITY-X[2],RMS_TEMPERATURE[0],RMS_TEMPERATURE[1]) \ No newline at end of file From d9645ab17281da038886d3306bd8dcb0f53a8b63 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 6 Aug 2024 13:10:46 +0200 Subject: [PATCH 09/21] Updated residual values for cht test case and updated tutorial branch --- .github/workflows/regression.yml | 2 +- TestCases/parallel_regression.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index f7e5b1952b1..c08dce750b1 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -213,7 +213,7 @@ jobs: uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: # -t -c - args: -b ${{github.ref}} -t develop -c feature_solid-solid_cht -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t feature_solid-solid_cht -c feature_solid-solid_cht -s ${{matrix.testscript}} - name: Cleanup uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 9ab9f8024fa..96b1c4b575e 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1344,7 +1344,7 @@ def main(): cht_CR.cfg_dir = "coupled_cht/solid_solid_contact_resistance" cht_CR.cfg_file = "master.cfg" cht_CR.test_iter = 100 - cht_CR.test_vals = [-2.128827, -0.588812, -0.588812, -0.588812] + cht_CR.test_vals = [ -8.899450, -9.378702, -7.378797, -7.246496] cht_CR.multizone = True test_list.append(cht_CR) From 07e11348ae31ba8c75d0e215c46a830b4ea1067f Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:49:19 +0200 Subject: [PATCH 10/21] Removed solid-to-solid CHT regression test from TestCases --- .../solid_solid_contact_resistance/fluid.cfg | 55 ------------------- .../solid_solid_contact_resistance/master.cfg | 32 ----------- .../solid_1.cfg | 47 ---------------- .../solid_2.cfg | 41 -------------- 4 files changed, 175 deletions(-) delete mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg delete mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg delete mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg delete mode 100644 TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg deleted file mode 100644 index f9a42d6a4c5..00000000000 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/fluid.cfg +++ /dev/null @@ -1,55 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % -% with contact resistance. % -% Author: E.C.Bunschoten % -% Date: August 6, 2024 % -% File Version 8.0.1 "Harrier" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% - -SOLVER= INC_NAVIER_STOKES -INC_ENERGY_EQUATION= YES - -% ------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION -------------------% - -FREESTREAM_TEMPERATURE= 300 - -INC_VELOCITY_INIT=(0.1, 0.0, 0.0) -FLUID_MODEL=INC_IDEAL_GAS - -VISCOSITY_MODEL=CONSTANT_VISCOSITY -MU_CONSTANT=1e-5 - -REF_DIMENSIONALIZATION= DIMENSIONAL -INC_NONDIM= DIMENSIONAL - -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -INC_INLET_TYPE=VELOCITY_INLET -INC_OUTLET_TYPE=PRESSURE_OUTLET -MARKER_SYM= ( side_3 ) -MARKER_INLET= ( inlet, 300, 0.1, 1.0, 0.0, 0.0 ) -MARKER_OUTLET= ( outlet, 0.0) -MARKER_INTERNAL= (fluid) -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% - -CFL_NUMBER= 100 - -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% - -CONV_RESIDUAL_MINVAL= -12 - -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -MESH_FILENAME= fluid_mesh.su2 -CONV_FILENAME= history_fluid_3 -TABULAR_FORMAT= CSV \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg deleted file mode 100644 index 26e48176b16..00000000000 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/master.cfg +++ /dev/null @@ -1,32 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % -% with contact resistance. % -% Author: E.C.Bunschoten % -% Date: August 6, 2024 % -% File Version 8.0.1 "Harrier" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= MULTIPHYSICS -MATH_PROBLEM= DIRECT -MULTIZONE_MESH=NO -CONFIG_LIST = (solid_1.cfg, solid_2.cfg, fluid.cfg) -MARKER_ZONE_INTERFACE= (cht_interface_1_2, cht_interface_2_1, \ - cht_interface_1_3, cht_interface_3_1, \ - cht_interface_2_3, cht_interface_3_2) -MARKER_CHT_INTERFACE= (cht_interface_1_2, cht_interface_2_1, \ - cht_interface_1_3, cht_interface_3_1, \ - cht_interface_2_3, cht_interface_3_2) -CHT_INTERFACE_CONTACT_RESISTANCE = (1e-5, 0, 0) - -CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX -TIME_DOMAIN = NO -OUTER_ITER = 2000 -WRT_ZONE_HIST=YES - -OUTPUT_FILES=(RESTART, PARAVIEW_MULTIBLOCK) -SCREEN_OUTPUT=(OUTER_ITER, RMS_PRESSURE[2],RMS_VELOCITY-X[2],RMS_TEMPERATURE[0],RMS_TEMPERATURE[1]) \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg deleted file mode 100644 index 06f3d0561ef..00000000000 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_1.cfg +++ /dev/null @@ -1,47 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % -% with contact resistance. % -% Author: E.C.Bunschoten % -% Date: August 6, 2024 % -% File Version 8.0.1 "Harrier" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= HEAT_EQUATION - - -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_ISOTHERMAL= ( isothermal_wall_1, 500.0 ) -MARKER_SYM=(side_1) -MARKER_MONITORING= ( NONE ) -MARKER_INTERNAL=(solid_1) - -% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% - -% We should keep the dimensionalization of the coupled flow solver -INC_NONDIM= DIMENSIONAL -FREESTREAM_TEMPERATURE= 300.0 - -% Properties of stainless steel -MATERIAL_DENSITY= 8935 -SPECIFIC_HEAT_CP= 3850 -THERMAL_CONDUCTIVITY_CONSTANT=26 - -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% - -CFL_NUMBER= 100.0 - - -% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% - -TIME_DISCRE_HEAT= EULER_IMPLICIT - -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -TABULAR_FORMAT= CSV -CONV_FILENAME= history_solid_1 -MESH_FILENAME=solid_mesh_1.su2 \ No newline at end of file diff --git a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg b/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg deleted file mode 100644 index 213d2520a4e..00000000000 --- a/TestCases/coupled_cht/solid_solid_contact_resistance/solid_2.cfg +++ /dev/null @@ -1,41 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: solid-to-solid and solid-to-fluid conjugate heat transfer % -% with contact resistance. % -% Author: E.C.Bunschoten % -% Date: August 6, 2024 % -% File Version 8.0.1 "Harrier" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= HEAT_EQUATION - -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_ISOTHERMAL= ( isothermal_wall_2, 300.0 ) -MARKER_SYM=(side_2) -MARKER_INTERNAL=(solid_2) - -% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% - -% We should keep the dimensionalization of the coupled flow solver -INC_NONDIM= DIMENSIONAL -FREESTREAM_TEMPERATURE= 300.0 - -MATERIAL_DENSITY= 8000 -SPECIFIC_HEAT_CP= 4420 -THERMAL_CONDUCTIVITY_CONSTANT= 61 - -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% - -CFL_NUMBER= 100.0 - -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% - -MESH_FILENAME= solid_mesh_2.su2 -TABULAR_FORMAT= CSV -CONV_FILENAME= history_solid_2 - From d560eb67d006254a3b01416f02470341cd8e88c4 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:49:36 +0200 Subject: [PATCH 11/21] Updated tutorials and testcases branch --- .github/workflows/regression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index f28e5a2cf6f..2502204b64c 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -209,7 +209,7 @@ jobs: uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: # -t -c - args: -b ${{github.ref}} -t feature_solid-solid_cht -c feature_solid-solid_cht -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} - name: Cleanup uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: From b3b31fb7be8a61830958c5000b573311327278c2 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:50:09 +0200 Subject: [PATCH 12/21] Removed boolean for the application of contact resistance --- Common/include/CConfig.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 558cffefe07..615959fdd38 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -591,7 +591,7 @@ class CConfig { bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */ bool FSI_Problem = false,/*!< \brief Boolean to determine whether the simulation is FSI or not. */ Multizone_Problem; /*!< \brief Boolean to determine whether we are solving a multizone problem. */ - bool ContactResistance = false; /*!< \brief Apply contact resistance for conjugate heat transfer. */ + //bool ContactResistance = false; /*!< \brief Apply contact resistance for conjugate heat transfer. */ unsigned short nID_DV; /*!< \brief ID for the region of FEM when computed using direct differentiation. */ bool AD_Mode; /*!< \brief Algorithmic Differentiation support. */ @@ -3665,19 +3665,12 @@ class CConfig { */ unsigned short GetMarker_n_ZoneInterface(void) const { return nMarker_ZoneInterface; } - /*! - * \brief Contact resistance values are supplied for CHT interfaces. - * \param[in] void - * \return Application of contact resistance. - */ - bool ApplyContactResistance(void) const { return ContactResistance; } - /*! * \brief Get the contact resistance value of a specified interface. * \param[in] val_interface interface index. - * \return Contact resistance value. + * \return Contact resistance value (zero by default). */ - su2double GetContactResistance(unsigned short val_interface) const { return CHT_ContactResistance[val_interface]; } + su2double GetContactResistance(unsigned short val_interface) const { return (nMarker_ContactResistance > 0) ? CHT_ContactResistance[val_interface] : 0.0; } /*! * \brief Get the DV information for a marker val_marker. From 64e29b80dcda2c336e2a6b0a562d3efcf80ac1ce Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:51:05 +0200 Subject: [PATCH 13/21] Constant contact resistance is applied to all CHT interfaces if a single value is provided --- Common/src/CConfig.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 952edaf72d3..3857e73523f 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3564,12 +3564,20 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check correctness and consistency of contact resistance options. ---*/ if (nMarker_ContactResistance > 0) { - ContactResistance = true; - if ((nMarker_CHTInterface/2) != nMarker_ContactResistance) - SU2_MPI::Error(string("Number of CHT interfaces does not match number of contact resistances. \n"), CURRENT_FUNCTION); + + /*--- Set constant contact resistance across CHT interfaces if a single value is provided. ---*/ + if (nMarker_ContactResistance == 1) { + auto val_CHTInterface = CHT_ContactResistance[0]; + delete [] CHT_ContactResistance; + CHT_ContactResistance = new su2double[nMarker_CHTInterface]; + for (auto iCHTMarker=0u; iCHTMarker < nMarker_CHTInterface; iCHTMarker++) + CHT_ContactResistance[iCHTMarker] = val_CHTInterface; + }else if((nMarker_CHTInterface/2) != nMarker_ContactResistance){ + SU2_MPI::Error("Number of CHT interfaces does not match number of contact resistances.", CURRENT_FUNCTION); + } for (auto iCHTMarker=0u; iCHTMarker < nMarker_ContactResistance; iCHTMarker++){ if (CHT_ContactResistance[iCHTMarker] < 0) - SU2_MPI::Error(string("Contact resistance value should be positive. \n"), CURRENT_FUNCTION); + SU2_MPI::Error("Contact resistance value should be positive.", CURRENT_FUNCTION); } } From c8db996b7acab6f382be848fe04961c21018c0fc Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:51:30 +0200 Subject: [PATCH 14/21] Removed duplicate code --- SU2_CFD/src/drivers/CDriver.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 3c1e523e880..65a25b6c9a2 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2507,14 +2507,6 @@ void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeomet interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; else interface_type = NO_TRANSFER; - - if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) - || (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET)) - interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF; - else if (config[fluidZone]->GetWeakly_Coupled_Heat()) - interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; - else - interface_type = NO_TRANSFER; } if (interface_type != NO_TRANSFER) { From 26d07764730a4404fb6d9cb855d47ac6551261e6 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:52:41 +0200 Subject: [PATCH 15/21] Removed check for the use of contact resistance --- SU2_CFD/src/interfaces/CInterface.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 4b7a30aa618..8deeaaa4ae0 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -108,8 +108,11 @@ void CInterface::BroadcastData(const CInterpolator& interpolator, su2activematrix sendDonorVar(nLocalVertexDonor, nVar); if (markDonor >= 0) { - if (donor_config->ApplyContactResistance()) - SetContactResistance(donor_config->GetContactResistance(iMarkerInt)); + + /*--- Apply contact resistance if specified. ---*/ + + SetContactResistance(donor_config->GetContactResistance(iMarkerInt)); + for (auto iVertex = 0ul, iSend = 0ul; iVertex < donor_geometry->GetnVertex(markDonor); iVertex++) { const auto iPoint = donor_geometry->vertex[markDonor][iVertex]->GetNode(); From ed6acbf088007ed8b99f29bde2464e5b48f9b222 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 10:53:23 +0200 Subject: [PATCH 16/21] Moved solid-solid CHT regression test from TestCases to Tutorials --- TestCases/parallel_regression.py | 9 --------- TestCases/tutorials.py | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 38193eb3757..0137b08806c 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1339,15 +1339,6 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.multizone = True test_list.append(sp_pinArray_3d_cht_mf_hf_tp) - # Solid-to-solid and solid-to-fluid CHT with contact resistance - cht_CR = TestCase('cht_solid_solid') - cht_CR.cfg_dir = "coupled_cht/solid_solid_contact_resistance" - cht_CR.cfg_file = "master.cfg" - cht_CR.test_iter = 100 - cht_CR.test_vals = [ -8.899450, -9.378702, -7.378797, -7.246496] - cht_CR.multizone = True - test_list.append(cht_CR) - ########################## ### Python wrapper ### diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 5d987f8cd9a..50e7ed9cac3 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -64,6 +64,15 @@ def main(): cht_incompressible.multizone = True test_list.append(cht_incompressible) + # Solid-to-solid and solid-to-fluid CHT with contact resistance + cht_CR = TestCase('cht_solid_solid') + cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" + cht_CR.cfg_file = "master.cfg" + cht_CR.test_iter = 100 + cht_CR.test_vals = [ -8.899450, -9.378702, -7.378797, -7.246496] + cht_CR.multizone = True + test_list.append(cht_CR) + ### Incompressible Flow # 2D pin case massflow periodic with heatflux BC and prescribed extracted outlet heat From 2dee186d8299aa4a4d861f32b31aac25e233bd45 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 26 Aug 2024 11:28:53 +0200 Subject: [PATCH 17/21] Updated tutorials branch --- .github/workflows/regression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 2502204b64c..cd916ffcfe5 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -209,7 +209,7 @@ jobs: uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: # -t -c - args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t feature_solid-solid_cht -c develop -s ${{matrix.testscript}} - name: Cleanup uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: From a78dccb9f11657b5f1b2f657a50476ff4686cce1 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Thu, 29 Aug 2024 11:53:06 +0200 Subject: [PATCH 18/21] Pulled develop --- TestCases/tutorials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 50e7ed9cac3..6021d7434d2 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -68,7 +68,7 @@ def main(): cht_CR = TestCase('cht_solid_solid') cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" cht_CR.cfg_file = "master.cfg" - cht_CR.test_iter = 100 + cht_CR.test_iter = 99 cht_CR.test_vals = [ -8.899450, -9.378702, -7.378797, -7.246496] cht_CR.multizone = True test_list.append(cht_CR) From 137ebf77dc5fe028e5671cd7be03801e7b979acd Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Thu, 29 Aug 2024 12:45:06 +0200 Subject: [PATCH 19/21] Updated residual values --- TestCases/tutorials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 6021d7434d2..b4c8534d8a1 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -68,8 +68,8 @@ def main(): cht_CR = TestCase('cht_solid_solid') cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" cht_CR.cfg_file = "master.cfg" - cht_CR.test_iter = 99 - cht_CR.test_vals = [ -8.899450, -9.378702, -7.378797, -7.246496] + cht_CR.test_iter = 80 + cht_CR.test_vals = [ -8.857438, -9.377593, -10.097769, -2.122358] cht_CR.multizone = True test_list.append(cht_CR) From 7fc46b6b069edc77d842cd64d657cc893cd83839 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Thu, 29 Aug 2024 14:03:13 +0200 Subject: [PATCH 20/21] Updated SS-CHT tutorial regression test residual values --- TestCases/tutorials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index b4c8534d8a1..bd99ff6e6c6 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -69,7 +69,7 @@ def main(): cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" cht_CR.cfg_file = "master.cfg" cht_CR.test_iter = 80 - cht_CR.test_vals = [ -8.857438, -9.377593, -10.097769, -2.122358] + cht_CR.test_vals = [ -8.867150, -9.366438, -10.286384, -2.229279] cht_CR.multizone = True test_list.append(cht_CR) From b02c5f8ce98d6cb8bae6b8983340acb44b64009a Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Thu, 29 Aug 2024 16:50:46 +0200 Subject: [PATCH 21/21] Updated residuals according to regression test output --- TestCases/tutorials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index bd99ff6e6c6..b4c8534d8a1 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -69,7 +69,7 @@ def main(): cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" cht_CR.cfg_file = "master.cfg" cht_CR.test_iter = 80 - cht_CR.test_vals = [ -8.867150, -9.366438, -10.286384, -2.229279] + cht_CR.test_vals = [ -8.857438, -9.377593, -10.097769, -2.122358] cht_CR.multizone = True test_list.append(cht_CR)