From 0c216ccb234b8fd8f7861f60cc8ea66c995acec1 Mon Sep 17 00:00:00 2001 From: oleburghardt Date: Tue, 9 Mar 2021 13:22:42 +0100 Subject: [PATCH 01/39] Draft PR commit for heat transfer BC. --- Common/include/CConfig.hpp | 25 ++-- Common/include/option_structure.hpp | 3 +- Common/src/CConfig.cpp | 140 ++++++++++++++++------- SU2_CFD/include/solvers/CIncNSSolver.hpp | 16 +++ SU2_CFD/include/solvers/CSolver.hpp | 16 +++ SU2_CFD/src/integration/CIntegration.cpp | 3 + SU2_CFD/src/solvers/CIncNSSolver.cpp | 22 +++- 7 files changed, 172 insertions(+), 53 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3aa76c0faa40..9ad833734412 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -205,6 +205,7 @@ class CConfig { nMarker_Smoluchowski_Maxwell, /*!< \brief Number of smoluchowski/maxwell wall boundaries. */ nMarker_Isothermal, /*!< \brief Number of isothermal wall boundaries. */ nMarker_HeatFlux, /*!< \brief Number of constant heat flux wall boundaries. */ + nMarker_HeatTransfer, /*!< \brief Number of heat flux wall boundaries with prescribed heat transfer coefficient. */ nMarker_EngineExhaust, /*!< \brief Number of nacelle exhaust flow markers. */ nMarker_EngineInflow, /*!< \brief Number of nacelle inflow flow markers. */ nMarker_Clamped, /*!< \brief Number of clamped markers in the FEM. */ @@ -253,6 +254,7 @@ class CConfig { *Marker_Smoluchowski_Maxwell, /*!< \brief Smoluchowski/Maxwell wall markers. */ *Marker_Isothermal, /*!< \brief Isothermal wall markers. */ *Marker_HeatFlux, /*!< \brief Constant heat flux wall markers. */ + *Marker_HeatTransfer, /*!< \brief Heat flux wall markers with specified heat transfer coefficient. */ *Marker_RoughWall, /*!< \brief Constant heat flux wall markers. */ *Marker_EngineInflow, /*!< \brief Engine Inflow flow markers. */ *Marker_EngineExhaust, /*!< \brief Engine Exhaust flow markers. */ @@ -308,6 +310,8 @@ class CConfig { su2double *Engine_Area; /*!< \brief Specified engine area for nacelle boundaries. */ su2double *Outlet_Pressure; /*!< \brief Specified back pressures (static) for outlet boundaries. */ su2double *Isothermal_Temperature; /*!< \brief Specified isothermal wall temperatures (static). */ + su2double *HeatTransfer_Coeff; /*!< \brief Specified heat transfer coefficients. */ + su2double *HeatTransfer_WallTemp; /*!< \brief Specified isothermal wall temperatures alongside heat transfer coefficients. */ su2double *Wall_Catalycity; /*!< \brief Specified wall species mass-fractions for catalytic boundaries. */ su2double *Heat_Flux; /*!< \brief Specified wall heat fluxes. */ su2double *Roughness_Height; /*!< \brief Equivalent sand grain roughness for the marker according to config file. */ @@ -861,7 +865,6 @@ class CConfig { su2double AitkenDynMinInit; /*!< \brief Aitken's minimum dynamic relaxation factor for the first iteration */ bool RampAndRelease; /*!< \brief option for ramp load and release */ bool Sine_Load; /*!< \brief option for sine load */ - su2double Thermal_Diffusivity; /*!< \brief Thermal diffusivity used in the heat solver. */ su2double Cyclic_Pitch, /*!< \brief Cyclic pitch for rotorcraft simulations. */ Collective_Pitch; /*!< \brief Collective pitch for rotorcraft simulations. */ su2double Mach_Motion; /*!< \brief Mach number based on mesh velocity and freestream quantities. */ @@ -1912,12 +1915,6 @@ class CConfig { */ su2double GetRefArea(void) const { return RefArea; } - /*! - * \brief Get the wave speed. - * \return Value of the wave speed. - */ - su2double GetThermalDiffusivity(void) const { return Thermal_Diffusivity; } - /*! * \brief Get the thermal expansion coefficient. * \return Value of the thermal expansion coefficient. @@ -6540,6 +6537,20 @@ class CConfig { */ su2double GetWall_HeatFlux(string val_index) const; + /*! + * \brief Get the heat transfer coefficient on a heat transfer boundary. + * \param[in] val_index - Index corresponding to the heat transfer boundary. + * \return The heat transfer coefficient. + */ + su2double GetWall_HeatTransfer_Coefficient(string val_index) const; + + /*! + * \brief Get the wall temperature on a heat transfer boundary. + * \param[in] val_index - Index corresponding to the heat transfer boundary. + * \return The wall temperature. + */ + su2double GetWall_HeatTransfer_Temperature(string val_index) const; + /*! * \brief Get the wall function treatment for the given boundary marker. * \param[in] val_marker - String of the viscous wall marker. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 7c9b5df7a6a2..027971ea8230 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1135,7 +1135,8 @@ enum BC_TYPE { ENGINE_EXHAUST = 22, /*!< \brief Boundary nacelle exhaust. */ RIEMANN_BOUNDARY= 24, /*!< \brief Riemann Boundary definition. */ ISOTHERMAL = 25, /*!< \brief No slip isothermal wall boundary condition. */ - HEAT_FLUX = 26, /*!< \brief No slip constant heat flux wall boundary condition. */ + HEAT_FLUX = 26, /*!< \brief No slip constant heat flux wall boundary condition. */ + HEAT_TRANSFER = 27, /*!< \brief No slip heat transfer boundary condition. */ ACTDISK_INLET = 32, /*!< \brief Actuator disk inlet boundary definition. */ ACTDISK_OUTLET = 33, /*!< \brief Actuator disk outlet boundary definition. */ CLAMPED_BOUNDARY = 34, /*!< \brief Clamped Boundary definition. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 54d4a277bcc3..e49310b40f75 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -812,26 +812,26 @@ void CConfig::SetPointersNull(void) { /*--- Marker Pointers ---*/ - Marker_Euler = nullptr; Marker_FarField = nullptr; Marker_Custom = nullptr; - Marker_SymWall = nullptr; Marker_PerBound = nullptr; - Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr; - Marker_Deform_Mesh = nullptr; Marker_Deform_Mesh_Sym_Plane= nullptr; Marker_Fluid_Load = nullptr; - Marker_Inlet = nullptr; Marker_Outlet = nullptr; - Marker_Supersonic_Inlet = nullptr; Marker_Supersonic_Outlet= nullptr; Marker_Smoluchowski_Maxwell = nullptr; - Marker_Isothermal = nullptr; Marker_HeatFlux = nullptr; Marker_EngineInflow = nullptr; - Marker_Load = nullptr; Marker_Disp_Dir = nullptr; Marker_RoughWall = nullptr; - Marker_EngineExhaust = nullptr; Marker_Displacement = nullptr; Marker_Load = nullptr; - Marker_Load_Dir = nullptr; Marker_Load_Sine = nullptr; Marker_Clamped = nullptr; - Marker_FlowLoad = nullptr; Marker_Internal = nullptr; - Marker_All_TagBound = nullptr; Marker_CfgFile_TagBound = nullptr; Marker_All_KindBC = nullptr; - Marker_CfgFile_KindBC = nullptr; Marker_All_SendRecv = nullptr; Marker_All_PerBound = nullptr; - Marker_ZoneInterface = nullptr; Marker_All_ZoneInterface= nullptr; Marker_Riemann = nullptr; - Marker_Fluid_InterfaceBound = nullptr; Marker_CHTInterface = nullptr; Marker_Damper = nullptr; - Marker_Emissivity = nullptr; + Marker_Euler = nullptr; Marker_FarField = nullptr; Marker_Custom = nullptr; + Marker_SymWall = nullptr; Marker_PerBound = nullptr; + Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr; + Marker_Deform_Mesh = nullptr; Marker_Deform_Mesh_Sym_Plane= nullptr; Marker_Fluid_Load = nullptr; + Marker_Inlet = nullptr; Marker_Outlet = nullptr; + Marker_Supersonic_Inlet = nullptr; Marker_Supersonic_Outlet = nullptr; Marker_Smoluchowski_Maxwell= nullptr; + Marker_Isothermal = nullptr; Marker_HeatFlux = nullptr; Marker_EngineInflow = nullptr; + Marker_Load = nullptr; Marker_Disp_Dir = nullptr; Marker_RoughWall = nullptr; + Marker_EngineExhaust = nullptr; Marker_Displacement = nullptr; Marker_Load = nullptr; + Marker_Load_Dir = nullptr; Marker_Load_Sine = nullptr; Marker_Clamped = nullptr; + Marker_FlowLoad = nullptr; Marker_Internal = nullptr; + Marker_All_TagBound = nullptr; Marker_CfgFile_TagBound = nullptr; Marker_All_KindBC = nullptr; + Marker_CfgFile_KindBC = nullptr; Marker_All_SendRecv = nullptr; Marker_All_PerBound = nullptr; + Marker_ZoneInterface = nullptr; Marker_All_ZoneInterface = nullptr; Marker_Riemann = nullptr; + Marker_Fluid_InterfaceBound = nullptr; Marker_CHTInterface = nullptr; Marker_Damper = nullptr; + Marker_Emissivity = nullptr; Marker_HeatTransfer = nullptr; /*--- Boundary Condition settings ---*/ - Isothermal_Temperature = nullptr; + Isothermal_Temperature = nullptr; HeatTransfer_Coeff = nullptr; HeatTransfer_WallTemp = nullptr; Heat_Flux = nullptr; Displ_Value = nullptr; Load_Value = nullptr; FlowLoad_Value = nullptr; Damper_Constant = nullptr; Wall_Emissivity = nullptr; Roughness_Height = nullptr; @@ -860,11 +860,11 @@ void CConfig::SetPointersNull(void) { Engine_Power = nullptr; Engine_NetThrust = nullptr; Engine_GrossThrust = nullptr; Engine_Area = nullptr; EngineInflow_Target = nullptr; - Exhaust_Temperature_Target = nullptr; Exhaust_Temperature = nullptr; - Exhaust_Pressure_Target = nullptr; Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; - Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; - Inlet_Velocity = nullptr; Inflow_Mach = nullptr; Inflow_Pressure = nullptr; - Exhaust_Pressure = nullptr; Outlet_Pressure = nullptr; Isothermal_Temperature= nullptr; + Exhaust_Temperature_Target = nullptr; Exhaust_Temperature = nullptr; Exhaust_Pressure = nullptr; + Exhaust_Pressure_Target = nullptr; Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; + Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; + Inlet_Velocity = nullptr; Inflow_Mach = nullptr; Inflow_Pressure = nullptr; + Outlet_Pressure = nullptr; Isothermal_Temperature = nullptr; ElasticityMod = nullptr; PoissonRatio = nullptr; MaterialDensity = nullptr; @@ -1257,12 +1257,6 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("FREESTREAM_VELOCITY", 3, vel_inf); /* DESCRIPTION: Free-stream viscosity (1.853E-5 Ns/m^2 (air), 0.798E-3 Ns/m^2 (water)) */ addDoubleOption("FREESTREAM_VISCOSITY", Viscosity_FreeStream, -1.0); - /* DESCRIPTION: Thermal conductivity used for heat equation */ - addDoubleOption("SOLID_THERMAL_CONDUCTIVITY", Thermal_Conductivity_Solid, 0.0); - /* DESCRIPTION: Solids temperature at freestream conditions */ - addDoubleOption("SOLID_TEMPERATURE_INIT", Temperature_Freestream_Solid, 288.15); - /* DESCRIPTION: Density used in solids */ - addDoubleOption("SOLID_DENSITY", Density_Solid, 2710.0); /* DESCRIPTION: */ addDoubleOption("FREESTREAM_INTERMITTENCY", Intermittency_FreeStream, 1.0); /* DESCRIPTION: */ @@ -1495,6 +1489,9 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_HEATFLUX \n DESCRIPTION: Specified heat flux wall boundary marker(s) Format: ( Heat flux marker, wall heat flux (static), ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_HEATFLUX", nMarker_HeatFlux, Marker_HeatFlux, Heat_Flux); + /*!\brief MARKER_HEATTRANSFER DESCRIPTION: Heat flux with specified heat transfer coefficient boundary marker(s)\n + * Format: ( Heat transfer marker, heat transfer coefficient, wall temperature (static), ... ) \ingroup Config */ + addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, HeatTransfer_WallTemp); /*!\brief Smluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall boundary marker(s) Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal accomodation coefficient ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, Isothermal_Temperature); //Missing TMAC and TAC @@ -2465,12 +2462,14 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: CHT interface coupling methods */ /* Options: NO, YES \ingroup Config */ addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, DIRECT_TEMPERATURE_ROBIN_HEATFLUX); - - /* DESCRIPTION: Thermal diffusivity constant */ - addDoubleOption("THERMAL_DIFFUSIVITY", Thermal_Diffusivity, 1.172E-5); - /* DESCRIPTION: Thermal diffusivity constant */ addDoubleOption("THERMAL_DIFFUSIVITY_SOLID", Thermal_Diffusivity_Solid, 1.172E-5); + /* DESCRIPTION: Thermal conductivity used for heat equation */ + addDoubleOption("SOLID_THERMAL_CONDUCTIVITY", Thermal_Conductivity_Solid, 0.0); + /* DESCRIPTION: Solids temperature at freestream conditions */ + addDoubleOption("SOLID_TEMPERATURE_INIT", Temperature_Freestream_Solid, 288.15); + /* DESCRIPTION: Density used in solids */ + addDoubleOption("SOLID_DENSITY", Density_Solid, 2710.0); /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ @@ -4586,10 +4585,10 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } /*--- Check that if the wall roughness array are compatible and set deafult values if needed. ---*/ - if ((nMarker_HeatFlux > 0) || (nMarker_Isothermal > 0) || (nMarker_CHTInterface > 0)) { + if ((nMarker_HeatFlux > 0) || (nMarker_Isothermal > 0) || (nMarker_HeatTransfer) || (nMarker_CHTInterface > 0)) { /*--- The total number of wall markers. ---*/ - unsigned short nWall = nMarker_HeatFlux + nMarker_Isothermal + nMarker_CHTInterface; + unsigned short nWall = nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + nMarker_CHTInterface; /*--- If no roughness is specified all walls are assumed to be smooth. ---*/ if (nRough_Wall == 0) { @@ -4605,10 +4604,14 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Roughness_Height[nMarker_HeatFlux + iMarker] = 0.0; Kind_Wall[nMarker_HeatFlux + iMarker] = SMOOTH; } - for (iMarker = 0; iMarker < nMarker_CHTInterface; iMarker++) { + for (iMarker = 0; iMarker < nMarker_HeatTransfer; iMarker++) { Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + iMarker] = 0.0; Kind_Wall[nMarker_HeatFlux + nMarker_Isothermal + iMarker] = SMOOTH; } + for (iMarker = 0; iMarker < nMarker_CHTInterface; iMarker++) { + Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker] = 0.0; + Kind_Wall[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker] = SMOOTH; + } /*--- Check for mismatch in number of rough walls and solid walls. ---*/ } else if (nRough_Wall > nWall) { @@ -4633,7 +4636,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_Wall[iMarker] = SMOOTH; } - /*--- Look through heat flux, isothermal and cht_interface markers and assign proper values. ---*/ + /*--- Look through heat flux, isothermal, heat transfer and cht_interface markers and assign proper values. ---*/ for (iMarker = 0; iMarker < nRough_Wall; iMarker++) { for (jMarker = 0; jMarker < nMarker_HeatFlux; jMarker++) if (Marker_HeatFlux[jMarker].compare(Marker_RoughWall[iMarker]) == 0) { @@ -4647,9 +4650,15 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ chkRough++; } + for (jMarker = 0; jMarker < nMarker_HeatTransfer; jMarker++) + if (Marker_HeatTransfer[jMarker].compare(Marker_RoughWall[iMarker]) == 0) { + Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + jMarker] = temp_rough[iMarker]; + chkRough++; + } + for (jMarker = 0; jMarker < nMarker_CHTInterface; jMarker++) if (Marker_CHTInterface[jMarker].compare(Marker_RoughWall[iMarker]) == 0) { - Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + jMarker] = temp_rough[iMarker]; + Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + jMarker] = temp_rough[iMarker]; chkRough++; } } @@ -4942,7 +4951,7 @@ void CConfig::SetMarkers(unsigned short val_software) { iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, iMarker_Giles, iMarker_Outlet, iMarker_Smoluchowski_Maxwell, - iMarker_Isothermal,iMarker_HeatFlux, + iMarker_Isothermal,iMarker_HeatFlux,iMarker_HeatTansfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, iMarker_Displacement, iMarker_Load, iMarker_FlowLoad, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, @@ -4959,12 +4968,12 @@ void CConfig::SetMarkers(unsigned short val_software) { #endif /*--- Compute the total number of markers in the config file ---*/ - + cout << " nMaker heat flux (2): " << nMarker_HeatFlux << endl; nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + nMarker_PerBound + nMarker_NearFieldBound + nMarker_Fluid_InterfaceBound + nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + nMarker_Smoluchowski_Maxwell + nMarker_Giles + nMarker_Outlet + nMarker_Isothermal + - nMarker_HeatFlux + + nMarker_HeatFlux + nMarker_HeatTransfer + nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_Internal + nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load + nMarker_FlowLoad + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + @@ -5253,6 +5262,12 @@ void CConfig::SetMarkers(unsigned short val_software) { iMarker_CfgFile++; } + for (iMarker_HeatTansfer = 0; iMarker_HeatTansfer < nMarker_HeatTransfer; iMarker_HeatTansfer++) { + Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_HeatTransfer[iMarker_HeatTansfer]; + Marker_CfgFile_KindBC[iMarker_CfgFile] = HEAT_TRANSFER; + iMarker_CfgFile++; + } + for (iMarker_Clamped = 0; iMarker_Clamped < nMarker_Clamped; iMarker_Clamped++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Clamped[iMarker_Clamped]; Marker_CfgFile_KindBC[iMarker_CfgFile] = CLAMPED_BOUNDARY; @@ -5448,7 +5463,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_Fluid_Load, iMarker_Smoluchowski_Maxwell, iWall_Catalytic, - iMarker_Giles, iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, + iMarker_Giles, iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, iMarker_Load, iMarker_FlowLoad, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, @@ -6827,6 +6842,15 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } + if (nMarker_HeatTransfer != 0) { + BoundaryTable << "Heat transfer wall"; + for (iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) { + BoundaryTable << Marker_HeatTransfer[iMarker_HeatTransfer]; + if (iMarker_HeatTransfer < nMarker_HeatTransfer-1) BoundaryTable << " "; + } + BoundaryTable.PrintFooter(); + } + if (nWall_Catalytic != 0) { BoundaryTable << "Catalytic wall"; for (iWall_Catalytic = 0; iWall_Catalytic < nWall_Catalytic; iWall_Catalytic++) { @@ -7605,6 +7629,8 @@ CConfig::~CConfig(void) { delete[] Outlet_Pressure; delete[] Isothermal_Temperature; delete[] Heat_Flux; + delete[] HeatTransfer_Coeff; + delete[] HeatTransfer_WallTemp; delete[] Displ_Value; delete[] Load_Value; delete[] Damper_Constant; @@ -8747,12 +8773,34 @@ su2double CConfig::GetWall_HeatFlux(string val_marker) const { return Heat_Flux[iMarker_HeatFlux]; } +su2double CConfig::GetWall_HeatTransfer_Coefficient(string val_marker) const { + unsigned short iMarker_HeatTransfer = 0; + + if (nMarker_HeatTransfer > 0) { + for (iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) break; + } + + return HeatTransfer_Coeff[iMarker_HeatTransfer]; +} + +su2double CConfig::GetWall_HeatTransfer_Temperature(string val_marker) const { + unsigned short iMarker_HeatTransfer = 0; + + if (nMarker_HeatTransfer > 0) { + for (iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) break; + } + + return HeatTransfer_WallTemp[iMarker_HeatTransfer]; +} + pair CConfig::GetWallRoughnessProperties(string val_marker) const { unsigned short iMarker = 0; short flag = -1; pair WallProp; - if (nMarker_HeatFlux > 0 || nMarker_Isothermal > 0 || nMarker_CHTInterface > 0) { + if (nMarker_HeatFlux > 0 || nMarker_Isothermal > 0 || nMarker_HeatTransfer || nMarker_CHTInterface > 0) { for (iMarker = 0; iMarker < nMarker_HeatFlux; iMarker++) if (Marker_HeatFlux[iMarker] == val_marker) { flag = iMarker; @@ -8765,9 +8813,15 @@ pair CConfig::GetWallRoughnessProperties(string val_m WallProp = make_pair(Kind_Wall[flag], Roughness_Height[flag]); return WallProp; } + for (iMarker = 0; iMarker < nMarker_HeatTransfer; iMarker++) + if (Marker_HeatTransfer[iMarker] == val_marker) { + flag = nMarker_HeatFlux + nMarker_Isothermal + iMarker; + WallProp = make_pair(Kind_Wall[flag], Roughness_Height[flag]); + return WallProp; + } for (iMarker = 0; iMarker < nMarker_CHTInterface; iMarker++) if (Marker_CHTInterface[iMarker] == val_marker) { - flag = nMarker_HeatFlux + nMarker_Isothermal + iMarker; + flag = nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker; WallProp = make_pair(Kind_Wall[flag], Roughness_Height[flag]); return WallProp; } diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 4c7388f5c51f..f5dc22856915 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -116,6 +116,22 @@ class CIncNSSolver final : public CIncEulerSolver { CConfig *config, unsigned short val_marker) override; + /*! + * \brief Impose a heat flux by prescribing a heat transfer coefficient and a wall temperature. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_HeatTransfer_Wall(CGeometry *geometry, + CSolver **solver_container, + CNumerics *conv_numerics, + CNumerics *visc_numerics, + CConfig *config, + unsigned short val_marker) override; + /*! * \brief Impose the (received) conjugate heat variables. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index c2f0f7bc22e9..4cbe5d37b42d 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -1114,6 +1114,22 @@ class CSolver { CConfig *config, unsigned short val_marker) { } + /*! + * \brief A virtual member. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + inline virtual void BC_HeatTransfer_Wall(CGeometry *geometry, + CSolver **solver_container, + CNumerics *conv_numerics, + CNumerics *visc_numerics, + CConfig *config, + unsigned short val_marker) { } + /*! * \brief A virtual member. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 678361fb7bf4..c94ed92a0e98 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -159,6 +159,9 @@ void CIntegration::Space_Integration(CGeometry *geometry, case HEAT_FLUX: solver_container[MainSolver]->BC_HeatFlux_Wall(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); break; + case HEAT_TRANSFER: + solver_container[MainSolver]->BC_HeatTransfer_Wall(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); + break; case CUSTOM_BOUNDARY: solver_container[MainSolver]->BC_Custom(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); break; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 5dd6b564bbaa..3f641644163d 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -201,14 +201,19 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - /*--- Get the specified wall heat flux or temperature from config ---*/ + /*--- Get the specified wall heat flux, temperature or heat transfer coefficient from config ---*/ - su2double Wall_HeatFlux = 0.0, Twall = 0.0; + su2double Wall_HeatFlux = 0.0, Twall = 0.0, Tdelta = 0.0, Transfer_Coefficient = 0.0; if (kind_boundary == HEAT_FLUX) Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); else if (kind_boundary == ISOTHERMAL) Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + else if (kind_boundary == HEAT_TRANSFER) { + Twall = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag); + Tdelta = Twall - config->GetTemperature_FreeStream()/config->GetTemperature_Ref(); + } else SU2_MPI::Error("Unknown type of boundary condition", CURRENT_FUNCTION); @@ -265,6 +270,13 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; } + else if (kind_boundary == HEAT_TRANSFER) { + + /*--- Apply a weak boundary condition for the energy equation. + Compute the residual due to the prescribed temperature and transfer coefficient. ---*/ + LinSysRes(iPoint, nDim+1) -= Transfer_Coefficient*Tdelta*Area; + + } else { // ISOTHERMAL auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); @@ -315,6 +327,12 @@ void CIncNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver**, CNumerics* BC_Wall_Generic(geometry, config, val_marker, ISOTHERMAL); } +void CIncNSSolver::BC_HeatTransfer_Wall(CGeometry *geometry, CSolver**, CNumerics*, + CNumerics*, CConfig *config, unsigned short val_marker) { + + BC_Wall_Generic(geometry, config, val_marker, HEAT_TRANSFER); +} + void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CConfig *config, unsigned short val_marker) { From 436636ee163103e2b5aad803b901a2a785615464 Mon Sep 17 00:00:00 2001 From: oleburghardt Date: Tue, 9 Mar 2021 13:23:25 +0100 Subject: [PATCH 02/39] Small option change. --- Common/src/CConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index e49310b40f75..0fc41ca06498 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2463,7 +2463,7 @@ void CConfig::SetConfig_Options() { /* Options: NO, YES \ingroup Config */ addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, DIRECT_TEMPERATURE_ROBIN_HEATFLUX); /* DESCRIPTION: Thermal diffusivity constant */ - addDoubleOption("THERMAL_DIFFUSIVITY_SOLID", Thermal_Diffusivity_Solid, 1.172E-5); + addDoubleOption("SOLID_THERMAL_DIFFUSIVITY", Thermal_Diffusivity_Solid, 1.172E-5); /* DESCRIPTION: Thermal conductivity used for heat equation */ addDoubleOption("SOLID_THERMAL_CONDUCTIVITY", Thermal_Conductivity_Solid, 0.0); /* DESCRIPTION: Solids temperature at freestream conditions */ From 3cc5d4136f4d28db193bfd5654016eb92c627af6 Mon Sep 17 00:00:00 2001 From: oleburghardt Date: Wed, 10 Mar 2021 16:28:33 +0100 Subject: [PATCH 03/39] Add HEAT_TRANSFER to GetViscous_Wall --- Common/src/CConfig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 9983f407d91a..772eebe5cf77 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -7300,6 +7300,7 @@ bool CConfig::GetViscous_Wall(unsigned short iMarker) const { return (Marker_All_KindBC[iMarker] == HEAT_FLUX || Marker_All_KindBC[iMarker] == ISOTHERMAL || + Marker_All_KindBC[iMarker] == HEAT_TRANSFER || Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE); } From b908f99af17e781e662aa85ca8f61e9737f11fd6 Mon Sep 17 00:00:00 2001 From: oleburghardt Date: Thu, 11 Mar 2021 17:27:49 +0100 Subject: [PATCH 04/39] Remove all SOLID_* config options (superfluous since using split config files), remove possibility to set thermal diffusivity directly. --- Common/include/CConfig.hpp | 45 +++++-------------- Common/src/CConfig.cpp | 18 ++++---- .../cht/CConjugateHeatInterface.cpp | 4 +- SU2_CFD/src/python_wrapper_structure.cpp | 4 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 31 ++++++------- .../coupled_cht/comp_2d/solid_cylinder1.cfg | 6 +-- .../coupled_cht/comp_2d/solid_cylinder2.cfg | 6 +-- .../coupled_cht/comp_2d/solid_cylinder3.cfg | 6 +-- .../disc_adj_incomp_2d/solid_cylinder1.cfg | 6 +-- .../disc_adj_incomp_2d/solid_cylinder2.cfg | 6 +-- .../disc_adj_incomp_2d/solid_cylinder3.cfg | 6 +-- .../coupled_cht/incomp_2d/solid_cylinder1.cfg | 6 +-- .../coupled_cht/incomp_2d/solid_cylinder2.cfg | 6 +-- .../coupled_cht/incomp_2d/solid_cylinder3.cfg | 6 +-- .../incomp_2d_unsteady/solid_cylinder1.cfg | 6 +-- .../incomp_2d_unsteady/solid_cylinder2.cfg | 6 +-- .../incomp_2d_unsteady/solid_cylinder3.cfg | 6 +-- TestCases/disc_adj_heat/disc_adj_heat.cfg | 2 +- .../chtPinArray_2d/configSolid.cfg | 6 +-- .../chtPinArray_3d/configSolid.cfg | 6 +-- 20 files changed, 84 insertions(+), 104 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 275f7b71b366..05cd467d4584 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -805,11 +805,7 @@ class CConfig { array CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */ array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ - su2double Thermal_Conductivity_Solid, /*!< \brief Thermal conductivity in solids. */ - Thermal_Diffusivity_Solid, /*!< \brief Thermal diffusivity in solids. */ - Temperature_Freestream_Solid, /*!< \brief Temperature in solids at freestream conditions. */ - Density_Solid, /*!< \brief Total density in solids. */ - Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ + su2double Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */ ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */ Density_FreeStream, /*!< \brief Free-stream density of the fluid. */ @@ -827,14 +823,15 @@ class CConfig { Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */ Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */ su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number for the gas. */ - Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */ - Length_Ref, /*!< \brief Reference length for non-dimensionalization. */ - Pressure_Ref, /*!< \brief Reference pressure for non-dimensionalization. */ - Temperature_Ref, /*!< \brief Reference temperature for non-dimensionalization.*/ - Temperature_ve_Ref, /*!< \brief Reference vibrational-electronic temperature for non-dimensionalization.*/ - Density_Ref, /*!< \brief Reference density for non-dimensionalization.*/ - Velocity_Ref, /*!< \brief Reference velocity for non-dimensionalization.*/ - Time_Ref, /*!< \brief Reference time for non-dimensionalization. */ + Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */ + Thermal_Diffusivity, /*!< \brief Thermal diffusivity (specified for heat conduction in solids). */ + Length_Ref, /*!< \brief Reference length for non-dimensionalization. */ + Pressure_Ref, /*!< \brief Reference pressure for non-dimensionalization. */ + Temperature_Ref, /*!< \brief Reference temperature for non-dimensionalization.*/ + Temperature_ve_Ref, /*!< \brief Reference vibrational-electronic temperature for non-dimensionalization.*/ + Density_Ref, /*!< \brief Reference density for non-dimensionalization.*/ + Velocity_Ref, /*!< \brief Reference velocity for non-dimensionalization.*/ + Time_Ref, /*!< \brief Reference time for non-dimensionalization. */ Viscosity_Ref, /*!< \brief Reference viscosity for non-dimensionalization. */ Conductivity_Ref, /*!< \brief Reference conductivity for non-dimensionalization. */ Energy_Ref, /*!< \brief Reference viscosity for non-dimensionalization. */ @@ -1635,12 +1632,6 @@ class CConfig { */ su2double GetDensity_FreeStream(void) const { return Density_FreeStream; } - /*! - * \brief Get the value of the solid density. - * \return Solid density. - */ - su2double GetDensity_Solid(void) const { return Density_Solid; } - /*! * \brief Get the value of the frestream temperature. * \return Freestream temperature. @@ -1665,23 +1656,11 @@ class CConfig { */ su2double GetPrandtl_Turb(void) const { return Prandtl_Turb; } - /*! - * \brief Get the value of the thermal conductivity for solids. - * \return Thermal conductivity (solid). - */ - su2double GetThermalConductivity_Solid(void) const { return Thermal_Conductivity_Solid; } - /*! * \brief Get the value of the thermal diffusivity for solids. * \return Thermal conductivity (solid). */ - su2double GetThermalDiffusivity_Solid(void) const { return Thermal_Diffusivity_Solid; } - - /*! - * \brief Get the temperature in solids at initial conditions. - * \return Freestream temperature (solid). - */ - su2double GetTemperature_Initial_Solid(void) const { return Temperature_Freestream_Solid; } + su2double GetThermalDiffusivity(void) const { return Thermal_Diffusivity; } /*! * \brief Get the value of the reference length for non-dimensionalization. @@ -2519,7 +2498,7 @@ class CConfig { * \brief Set the thermal diffusivity for solids. * \return Value of the Froude number. */ - void SetThermalDiffusivity_Solid(su2double val_thermal_diffusivity) { Thermal_Diffusivity_Solid = val_thermal_diffusivity; } + void SetThermalDiffusivity(su2double val_thermal_diffusivity) { Thermal_Diffusivity = val_thermal_diffusivity; } /*! * \brief Set the Froude number for free surface problems. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 772eebe5cf77..616660787f7f 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2490,14 +2490,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: CHT interface coupling methods */ /* Options: NO, YES \ingroup Config */ addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, DIRECT_TEMPERATURE_ROBIN_HEATFLUX); - /* DESCRIPTION: Thermal diffusivity constant */ - addDoubleOption("SOLID_THERMAL_DIFFUSIVITY", Thermal_Diffusivity_Solid, 1.172E-5); - /* DESCRIPTION: Thermal conductivity used for heat equation */ - addDoubleOption("SOLID_THERMAL_CONDUCTIVITY", Thermal_Conductivity_Solid, 0.0); - /* DESCRIPTION: Solids temperature at freestream conditions */ - addDoubleOption("SOLID_TEMPERATURE_INIT", Temperature_Freestream_Solid, 288.15); - /* DESCRIPTION: Density used in solids */ - addDoubleOption("SOLID_DENSITY", Density_Solid, 2710.0); /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ @@ -2880,6 +2872,16 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ newString.append("WRT_SOL_FREQ is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n"); if (!option_name.compare("WRT_SOL_FREQ_DUALTIME")) newString.append("WRT_SOL_FREQ_DUALTIME is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n"); + if (!option_name.compare("THERMAL_DIFFUSIVITY")) + newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n"); + if (!option_name.compare("SOLID_THERMAL_DIFFUSIVITY")) + newString.append("SOLID_THERMAL_DIFFUSIVITY is deprecated. Set KT_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); + if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY")) + newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use KT_CONSTANT instead.\n\n"); + if (!option_name.compare("SOLID_DENSITY")) + newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n"); + if (!option_name.compare("SOLID_TEMPERATURE_INIT")) + newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n"); errorString.append(newString); err_count++; line_count++; diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 51a5cc6423a4..3a2456eb62fb 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -148,13 +148,13 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet /*--- Heat solver stand-alone case ---*/ - thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = donor_config->GetThermalDiffusivity(); heat_flux_density = thermal_diffusivity*dTdn; if ((donor_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || (donor_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { - rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); + rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetMaterialDensity(0); conductivity_over_dist = thermal_diffusivity*rho_cp_solid/dist; } } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index e324046844ef..02bae2a90dfe 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -443,7 +443,9 @@ vector CDriver::GetAllCHTMarkersTag() const { //The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. for(iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == HEAT_FLUX || config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) && config_container[ZONE_0]->GetMarker_All_PyCustom(iMarker)){ + if((config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == HEAT_FLUX || + config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL || + config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == HEAT_TRANSFER) && config_container[ZONE_0]->GetMarker_All_PyCustom(iMarker)){ Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); CHTBoundariesTagList.push_back(Marker_Tag); } diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 72c55b7ad688..9e33f1b37487 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -145,8 +145,7 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM /*--- Set the reference values for temperature ---*/ - su2double Temperature_FreeStream = config->GetInc_Temperature_Init(); - config->SetTemperature_FreeStream(Temperature_FreeStream); + su2double Temperature_FreeStream = config->GetTemperature_FreeStream(); su2double Temperature_Ref = 0.0; if (config->GetRef_Inc_NonDim() == DIMENSIONAL) { @@ -159,21 +158,19 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM Temperature_Ref = config->GetInc_Temperature_Ref(); } config->SetTemperature_Ref(Temperature_Ref); + config->SetTemperature_FreeStreamND(Temperature_FreeStream/Temperature_Ref); /*--- Set the reference values for heat fluxes. If the heat solver runs stand-alone, * thermal conductivity is read directly from config file ---*/ if (heat_equation) { + su2double rho_cp = config->GetMaterialDensity(0)*config->GetSpecific_Heat_Cp(); + config->SetThermalDiffusivity(config->GetKt_Constant() / rho_cp); - su2double rho_cp = config->GetDensity_Solid()*config->GetSpecific_Heat_Cp(); - config->SetThermalDiffusivity_Solid(config->GetThermalConductivity_Solid() / rho_cp); - - config->SetTemperature_FreeStreamND(config->GetTemperature_Initial_Solid()/config->GetTemperature_Ref()); + /*--- Fluxes are computed via thermal diffusivity (not conductivity), so we have to devide by rho*cp ---*/ config->SetHeat_Flux_Ref(rho_cp*Temperature_Ref); } else { - - config->SetTemperature_FreeStreamND(config->GetTemperature_FreeStream()/config->GetTemperature_Ref()); config->SetHeat_Flux_Ref(config->GetViscosity_Ref()*config->GetSpecific_Heat_Cp()); } @@ -601,8 +598,8 @@ void CHeatSolver::Viscous_Residual(CGeometry *geometry, CSolver **solver_contain thermal_diffusivity_j = (laminar_viscosity/Prandtl_Lam) + (eddy_viscosity_j/Prandtl_Turb); } else { - thermal_diffusivity_i = config->GetThermalDiffusivity_Solid(); - thermal_diffusivity_j = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity_i = config->GetThermalDiffusivity(); + thermal_diffusivity_j = config->GetThermalDiffusivity(); } numerics->SetThermalDiffusivity(thermal_diffusivity_i,thermal_diffusivity_j); @@ -726,7 +723,7 @@ void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_conta thermal_diffusivity = laminar_viscosity/Prandtl_Lam; } else - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); Res_Visc[0] = thermal_diffusivity*dTdn*Area; @@ -992,7 +989,7 @@ void CHeatSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solv su2double *Normal = new su2double[nDim]; Temperature_Ref = config->GetTemperature_Ref(); - rho_cp_solid = config->GetDensity_Solid()*config->GetSpecific_Heat_Cp(); + rho_cp_solid = config->GetMaterialDensity(0)*config->GetSpecific_Heat_Cp(); if (flow) { @@ -1112,7 +1109,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C thermal_diffusivity = config->GetViscosity_FreeStreamND()/config->GetPrandtl_Lam(); } else { - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); } HeatFlux[iMarker][iVertex] = thermal_diffusivity*dTdn*config->GetHeat_Flux_Ref(); @@ -1150,7 +1147,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C thermal_diffusivity = config->GetViscosity_FreeStreamND()/config->GetPrandtl_Lam(); } else { - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); } HeatFlux[iMarker][iVertex] = thermal_diffusivity*dTdn*config->GetHeat_Flux_Ref(); @@ -1215,7 +1212,7 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, Prandtl_Lam = config->GetPrandtl_Lam(); Prandtl_Turb = config->GetPrandtl_Turb(); - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); /*--- Compute spectral radius based on thermal conductivity ---*/ @@ -1253,7 +1250,7 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, /*--- Viscous contribution ---*/ - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); if(flow) { if(turb) { eddy_viscosity = solver_container[TURB_SOL]->GetNodes()->GetmuT(iPoint); @@ -1293,7 +1290,7 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, /*--- Viscous contribution ---*/ - thermal_diffusivity = config->GetThermalDiffusivity_Solid(); + thermal_diffusivity = config->GetThermalDiffusivity(); if(flow) { if(turb) { eddy_viscosity = solver_container[TURB_SOL]->GetNodes()->GetmuT(iPoint); diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg index 9f8ec43f71ed..7ace12963b32 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg index bca1647b7dfd..bf2452f11763 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg index e834d1134beb..d32bab9ba10b 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg index feccb6c2413c..9e00ad47b92f 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg index b9a20fa95db7..2eb59a1f86c5 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg index f7576060b5dc..d7c5677b52b9 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg index ea93e593514e..4d1dafa170aa 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg index 4b296aedbc5d..04fccdb8508e 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg index 201c4f681e79..41e1ebc1c0d9 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.000210322 +MATERIAL_DENSITY= 0.000210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg index 56f56418c637..c185669e9c76 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 288.15 +FREESTREAM_TEMPERATURE= 288.15 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.0210322 +MATERIAL_DENSITY= 0.0210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg index 1013307d8f46..bb9a51a9210a 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 288.15 +FREESTREAM_TEMPERATURE= 288.15 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.0210322 +MATERIAL_DENSITY= 0.0210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg index 2f5cdfd50cdd..0dc28248a205 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg @@ -48,18 +48,18 @@ MARKER_MONITORING= ( NONE ) INC_NONDIM= DIMENSIONAL % % Temperature initialization value -SOLID_TEMPERATURE_INIT= 288.15 +FREESTREAM_TEMPERATURE= 288.15 % % Nettis case: hollow cylinder (air w/ 4x the conductivity) % % Solid density (kg/m^3) -SOLID_DENSITY= 0.0210322 +MATERIAL_DENSITY= 0.0210322 % % Solid specific heat (J/kg*K) SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -SOLID_THERMAL_CONDUCTIVITY= 0.1028 +KT_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/disc_adj_heat/disc_adj_heat.cfg b/TestCases/disc_adj_heat/disc_adj_heat.cfg index f708e0109516..fad360aafcf8 100644 --- a/TestCases/disc_adj_heat/disc_adj_heat.cfg +++ b/TestCases/disc_adj_heat/disc_adj_heat.cfg @@ -52,7 +52,7 @@ INC_OUTLET_TYPE= PRESSURE_OUTLET % ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% -SOLID_TEMPERATURE_INIT= 350.0 +FREESTREAM_TEMPERATURE= 350.0 % ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 3b49b93125e3..12d3b42e7b50 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -21,10 +21,10 @@ OPT_OBJECTIVE= AVG_TOTALTEMP % ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% % INC_NONDIM= DIMENSIONAL -SOLID_TEMPERATURE_INIT= 345.0 -SOLID_DENSITY= 2719 +FREESTREAM_TEMPERATURE= 345.0 +MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 871.0 -SOLID_THERMAL_CONDUCTIVITY= 200 +KT_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index a1362711f77c..20a1e7d19f57 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -16,10 +16,10 @@ SOLVER= HEAT_EQUATION % ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% % INC_NONDIM= DIMENSIONAL -SOLID_TEMPERATURE_INIT= 345.0 -SOLID_DENSITY= 2719 +FREESTREAM_TEMPERATURE= 345.0 +MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 871.0 -SOLID_THERMAL_CONDUCTIVITY= 200 +KT_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % From af393004a3e16a65d7c673aaef0f6f2da926123f Mon Sep 17 00:00:00 2001 From: oleburghardt Date: Thu, 11 Mar 2021 23:04:22 +0100 Subject: [PATCH 05/39] Small fix. --- Common/src/CConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 616660787f7f..1deabf2d8ec0 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2874,8 +2874,8 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ newString.append("WRT_SOL_FREQ_DUALTIME is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n"); if (!option_name.compare("THERMAL_DIFFUSIVITY")) newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n"); - if (!option_name.compare("SOLID_THERMAL_DIFFUSIVITY")) - newString.append("SOLID_THERMAL_DIFFUSIVITY is deprecated. Set KT_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); + if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID")) + newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set KT_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY")) newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use KT_CONSTANT instead.\n\n"); if (!option_name.compare("SOLID_DENSITY")) From 72cb713a4554eeda0d5f168e0c37057bce095630 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 18 Mar 2021 22:42:57 +0100 Subject: [PATCH 06/39] Move unsteady CHT regression test to tutorials.py. --- TestCases/parallel_regression.py | 13 ------------- TestCases/serial_regression.py | 13 ------------- TestCases/tutorials.py | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 0ac0942e97ab..7b7573d5ec4c 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1229,19 +1229,6 @@ def main(): cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) - # CHT incompressible unsteady - cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') - cht_incompressible_unsteady.cfg_dir = "coupled_cht/incomp_2d_unsteady" - cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" - cht_incompressible_unsteady.test_iter = 2 - cht_incompressible_unsteady.test_vals = [-1.305471, -0.080372, -0.080376, -0.080372] #last 4 columns - cht_incompressible_unsteady.su2_exec = "mpirun -n 2 SU2_CFD" - cht_incompressible_unsteady.timeout = 1600 - cht_incompressible_unsteady.multizone = True - cht_incompressible_unsteady.unsteady = True - cht_incompressible_unsteady.tol = 0.00001 - test_list.append(cht_incompressible_unsteady) - # CHT compressible cht_compressible = TestCase('cht_compressible') cht_compressible.cfg_dir = "coupled_cht/comp_2d" diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 0b0a36e31b9d..a0bc98470b5c 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1405,19 +1405,6 @@ def main(): cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) - # CHT incompressible unsteady - cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') - cht_incompressible_unsteady.cfg_dir = "coupled_cht/incomp_2d_unsteady" - cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" - cht_incompressible_unsteady.test_iter = 2 - cht_incompressible_unsteady.test_vals = [-1.303588, -0.080377, -0.080380, -0.080377] #last 4 columns - cht_incompressible_unsteady.su2_exec = "SU2_CFD" - cht_incompressible_unsteady.timeout = 1600 - cht_incompressible_unsteady.multizone = True - cht_incompressible_unsteady.unsteady = True - cht_incompressible_unsteady.tol = 0.00001 - test_list.append(cht_incompressible_unsteady) - # CHT compressible cht_incompressible = TestCase('cht_compressible') cht_incompressible.cfg_dir = "coupled_cht/comp_2d" diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 5295588f255f..7b2bef5aa819 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -42,6 +42,20 @@ def main(): ### RUN TUTORIAL CASES ### ###################################### + + # CHT incompressible unsteady + cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') + cht_incompressible_unsteady.cfg_dir = "../Tutorials/multiphysics/unsteady_cht/" + cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible_unsteady.test_iter = 2 + cht_incompressible_unsteady.test_vals = [-2.659390, -2.533160, -0.080399, -0.080399, -0.080399, -12.421450, 0.0000e+00, 0.0000e+00, 2.3824e+02] #last 9 columns + cht_incompressible_unsteady.su2_exec = "mpirun -n 2 SU2_CFD" + cht_incompressible_unsteady.timeout = 1600 + cht_incompressible_unsteady.multizone = True + cht_incompressible_unsteady.unsteady = True + cht_incompressible_unsteady.tol = 0.00001 + test_list.append(cht_incompressible_unsteady) + ### Incompressible Flow # 2D pin case massflow periodic with heatflux BC and prescribed extracted outlet heat From 21d4ed1cf740c306aba606ed40fb1c9d7eeac048 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 19 Jul 2021 23:41:53 +0200 Subject: [PATCH 07/39] Fix overseen merge conflicts. --- Common/src/CConfig.cpp | 2 +- SU2_CFD/src/solvers/CHeatSolver.cpp | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 7a3ae14116d0..ef6d18c890b8 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4728,7 +4728,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } for (iMarker = 0; iMarker < nMarker_CHTInterface; iMarker++) { Roughness_Height[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker] = 0.0; - Kind_Wall[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker] = SMOOTH; + Kind_Wall[nMarker_HeatFlux + nMarker_Isothermal + nMarker_HeatTransfer + iMarker] = WALL_TYPE::SMOOTH; } /*--- Check for mismatch in number of rough walls and solid walls. ---*/ diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 1749af5418fa..c5ad88be7310 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -569,7 +569,7 @@ void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_conta const su2double laminar_viscosity = config->GetMu_ConstantND(); const su2double Prandtl_Lam = config->GetPrandtl_Lam(); - const su2double thermal_diffusivity = flow ? laminar_viscosity/Prandtl_Lam : config->GetThermalDiffusivity_Solid(); + const su2double thermal_diffusivity = flow ? laminar_viscosity/Prandtl_Lam : config->GetThermalDiffusivity(); //su2double Prandtl_Turb = config->GetPrandtl_Turb(); //laminar_viscosity = config->GetViscosity_FreeStreamND(); // TDE check for consistency for CHT @@ -598,12 +598,6 @@ void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_conta dTdn = -(nodes->GetSolution(Point_Normal,0) - Twall)/dist_ij; - if(flow) { - thermal_diffusivity = laminar_viscosity/Prandtl_Lam; - } - else - thermal_diffusivity = config->GetThermalDiffusivity(); - Res_Visc[0] = thermal_diffusivity*dTdn*Area; if(implicit) @@ -907,7 +901,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C string Marker_Tag, HeatFlux_Tag; const su2double thermal_diffusivity = flow ? config->GetViscosity_FreeStreamND()/config->GetPrandtl_Lam() : - config->GetThermalDiffusivity_Solid(); + config->GetThermalDiffusivity(); AllBound_HeatFlux = 0.0; AllBound_AverageT = 0.0; @@ -945,13 +939,6 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C dTdn = (Twall - nodes->GetSolution(iPointNormal,0))/dist; - if(flow) { - thermal_diffusivity = config->GetViscosity_FreeStreamND()/config->GetPrandtl_Lam(); - } - else { - thermal_diffusivity = config->GetThermalDiffusivity(); - } - HeatFlux[iMarker][iVertex] = thermal_diffusivity*dTdn*config->GetHeat_Flux_Ref(); HeatFlux_per_Marker[iMarker] += HeatFlux[iMarker][iVertex]*Area; @@ -983,13 +970,6 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C dTdn = (Twall - nodes->GetTemperature(iPointNormal))/dist; - if(flow) { - thermal_diffusivity = config->GetViscosity_FreeStreamND()/config->GetPrandtl_Lam(); - } - else { - thermal_diffusivity = config->GetThermalDiffusivity(); - } - HeatFlux[iMarker][iVertex] = thermal_diffusivity*dTdn*config->GetHeat_Flux_Ref(); HeatFlux_per_Marker[iMarker] += HeatFlux[iMarker][iVertex]*Area; From c1ec27c46bc916351dd6b0ecca6ead6e90cad256 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Jul 2021 10:31:49 +0200 Subject: [PATCH 08/39] Change cfg-options names of CHT-case added in the meantime. --- .../coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg index 8af4dae4a7d7..102fd5b2733e 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg @@ -11,10 +11,10 @@ OBJECTIVE_WEIGHT= 1.0 % ~Aluminium at room temperature INC_NONDIM= DIMENSIONAL % -SOLID_TEMPERATURE_INIT= 340.0 -SOLID_DENSITY= 2719 +FREESTREAM_TEMPERATURE= 340.0 +MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 0.8710 -SOLID_THERMAL_CONDUCTIVITY= 200 +KT_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % From 884a8316011b6772fd0f9c87c0fe4de89c69a26c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Jul 2021 10:36:10 +0200 Subject: [PATCH 09/39] Make steady_cht a tutorial case, with options taken from coupled_cht/incomp_2d. --- TestCases/tutorials.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 01bf850b4e2d..258f68b4df56 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -42,6 +42,7 @@ def main(): ### RUN TUTORIAL CASES ### ###################################### + ### CHT # CHT incompressible unsteady cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') @@ -56,6 +57,18 @@ def main(): cht_incompressible_unsteady.tol = 0.00001 test_list.append(cht_incompressible_unsteady) + # CHT incompressible, 2D, 3 pins in crossflow + cht_incompressible = TestCase('cht_incompressible') + cht_incompressible.cfg_dir = "../Tutorials/multiphysics/steady_cht" + cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible.test_iter = 10 + cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] #last 4 columns + cht_incompressible.su2_exec = "SU2_CFD" + cht_incompressible.timeout = 1600 + cht_incompressible.multizone = True + cht_incompressible.tol = 0.00001 + test_list.append(cht_incompressible) + ### Incompressible Flow # 2D pin case massflow periodic with heatflux BC and prescribed extracted outlet heat From 2f3ee06c19f5f6d0599c35ec23861032eb0f0fc6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 20 Jul 2021 19:29:09 +0200 Subject: [PATCH 10/39] Change pulled tutorials branch --- .github/workflows/regression.yml | 3 ++- docker/test/runTests.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3d6c73084312..3571cb9ca196 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -87,7 +87,8 @@ jobs: - name: Run Tests in Container uses: docker://su2code/test-su2:20200303 with: - args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} + # -t -c + args: -b ${{github.ref}} -t feature_heatcoeff_BC -c develop -s ${{matrix.testscript}} unit_tests: runs-on: ubuntu-latest name: Unit Tests diff --git a/docker/test/runTests.sh b/docker/test/runTests.sh index eb915243d60b..66227871ccb8 100755 --- a/docker/test/runTests.sh +++ b/docker/test/runTests.sh @@ -9,7 +9,7 @@ usage="$(basename "$0") [-h] [-t tutorial_branch] [-b su2_branch] [-c testcases_branch] [-s test_script] where: -h show this help text - -t branch of su2code/su2code.github.io repo + -t branch of su2code/Tutorials repo (if not provided, it is assumed that it is mounted at /src/SU2) -b branch of su2code/SU2 repo. (if not provided, it is assumed that it is mounted at /src/Tutorials) From 6f2c83f4858adfd2279c5dc4e8b1b4196e291622 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 13:02:09 +0200 Subject: [PATCH 11/39] Make heat transfer coeff boundaries work correctly. --- Common/src/CConfig.cpp | 1 - SU2_CFD/src/solvers/CIncNSSolver.cpp | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 0f805e33d7d4..2626165b8e0f 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -5076,7 +5076,6 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /*--- Compute the total number of markers in the config file ---*/ - cout << " nMaker heat flux (2): " << nMarker_HeatFlux << endl; nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + nMarker_PerBound + nMarker_NearFieldBound + nMarker_Fluid_InterfaceBound + nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + nMarker_Smoluchowski_Maxwell + diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 401a13feed99..7d36d772ca52 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -378,19 +378,18 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Get the specified wall heat flux, temperature or heat transfer coefficient from config ---*/ - su2double Wall_HeatFlux = 0.0, Twall = 0.0, Tdelta = 0.0, Transfer_Coefficient = 0.0; + su2double Wall_HeatFlux = 0.0, Twall = 0.0, Tinfinity = 0.0, Transfer_Coefficient = 0.0; if (kind_boundary == HEAT_FLUX) Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); else if (kind_boundary == ISOTHERMAL) Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); else if (kind_boundary == HEAT_TRANSFER) { - Twall = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); - Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag); - Tdelta = Twall - config->GetTemperature_FreeStream()/config->GetTemperature_Ref(); + Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag) * config->GetTemperature_Ref()/config->GetHeat_Flux_Ref(); + Tinfinity = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); } else - SU2_MPI::Error("Unknown type of boundary condition", CURRENT_FUNCTION); + SU2_MPI::Error("Unknown type of boundary condition.", CURRENT_FUNCTION); /*--- Get wall function treatment from config. ---*/ @@ -398,7 +397,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con // nijso: we do not have a special treatment yet for heated walls // the wall function model is written for heat flux, we have to implement isothermal wall conditions //if (Wall_Function != WALL_FUNCTIONS::NONE) - // SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); + // SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); /*--- Loop over all of the vertices on this boundary marker ---*/ @@ -465,10 +464,13 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con } // if streamwise_periodic } else if (kind_boundary == HEAT_TRANSFER) { + Twall = nodes->GetTemperature(iPoint); + Wall_HeatFlux = Transfer_Coefficient * (Tinfinity - Twall); /*--- Apply a weak boundary condition for the energy equation. - Compute the residual due to the prescribed temperature and transfer coefficient. ---*/ - LinSysRes(iPoint, nDim+1) -= Transfer_Coefficient*Tdelta*Area; + Compute the residual due to the prescribed temperature and transfer coefficient. + Note that for the Heat_Transfer wall, basically a heatflux wall that depends on the local Temperature is applied. ---*/ + LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; } else { // ISOTHERMAL @@ -542,7 +544,7 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Retrieve the specified wall function treatment.---*/ if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); + SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); } /*--- Loop over boundary points ---*/ From eae31331615284bd47b42e09ad3010f597dfd59d Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 13:16:04 +0200 Subject: [PATCH 12/39] Get rid of annoying double screen output for marker analyze fields --- SU2_CFD/src/output/COutput.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index c37bcab5a650..5d6ab2e8d90e 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1099,7 +1099,8 @@ void COutput::SetScreen_Output(const CConfig *config) { PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::SCIENTIFIC: - PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); + // SURFACE_STATIC_TEMPERATURE e.g. is written to screen twice + if(false)PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::PERCENT: PrintingToolbox::PrintScreenPercent(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); From 75f63045278bd55f8baa8d5c786cb82b29604c69 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 13:58:34 +0200 Subject: [PATCH 13/39] Consolidate inputs to BC_HeatTransfer_Wall. --- SU2_CFD/include/solvers/CIncNSSolver.hpp | 16 +++++----------- SU2_CFD/include/solvers/CSolver.hpp | 14 ++++---------- SU2_CFD/src/integration/CIntegration.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 7 +++---- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 51012872bcc2..065df3fe08bd 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -38,7 +38,7 @@ class CIncNSSolver final : public CIncEulerSolver { /*! - * \brief Generic implementation of the isothermal and heatflux walls. + * \brief Generic implementation of the isothermal, heatflux and heat-transfer/convection walls. */ void BC_Wall_Generic(const CGeometry *geometry, const CConfig *config, @@ -158,20 +158,14 @@ class CIncNSSolver final : public CIncEulerSolver { unsigned short val_marker) override; /*! - * \brief Impose a heat flux by prescribing a heat transfer coefficient and a wall temperature. + * \brief Impose a heat flux by prescribing a heat transfer coefficient and a temperature at infinity. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. * \param[in] val_marker - Surface marker where the boundary condition is applied. */ - void BC_HeatTransfer_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) override; + void BC_HeatTransfer_Wall(const CGeometry *geometry, + const CConfig *config, + const unsigned short val_marker) override; /*! * \brief Impose the (received) conjugate heat variables. diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index ee6a7f3a1b6e..1c64abfe84e1 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -1062,20 +1062,14 @@ class CSolver { unsigned short val_marker) { } /*! - * \brief A virtual member. + * \brief Impose a heat flux by prescribing a heat transfer coefficient and a temperature at infinity. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] conv_numerics - Description of the numerical method. - * \param[in] visc_numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. * \param[in] val_marker - Surface marker where the boundary condition is applied. */ - inline virtual void BC_HeatTransfer_Wall(CGeometry *geometry, - CSolver **solver_container, - CNumerics *conv_numerics, - CNumerics *visc_numerics, - CConfig *config, - unsigned short val_marker) { } + inline virtual void BC_HeatTransfer_Wall(const CGeometry *geometry, + const CConfig *config, + const unsigned short val_marker) { } /*! * \brief A virtual member. diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index bec8e99ae624..010ae194cefd 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -154,7 +154,7 @@ void CIntegration::Space_Integration(CGeometry *geometry, solver_container[MainSolver]->BC_HeatFlux_Wall(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); break; case HEAT_TRANSFER: - solver_container[MainSolver]->BC_HeatTransfer_Wall(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); + solver_container[MainSolver]->BC_HeatTransfer_Wall(geometry, config, iMarker); break; case CUSTOM_BOUNDARY: solver_container[MainSolver]->BC_Custom(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 7d36d772ca52..645f03283a3e 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -397,7 +397,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con // nijso: we do not have a special treatment yet for heated walls // the wall function model is written for heat flux, we have to implement isothermal wall conditions //if (Wall_Function != WALL_FUNCTIONS::NONE) - // SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); + // SU2_MPI::Error("Wall function treatment not implemented yet.", CURRENT_FUNCTION); /*--- Loop over all of the vertices on this boundary marker ---*/ @@ -524,8 +524,7 @@ void CIncNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver**, CNumerics* BC_Wall_Generic(geometry, config, val_marker, ISOTHERMAL); } -void CIncNSSolver::BC_HeatTransfer_Wall(CGeometry *geometry, CSolver**, CNumerics*, - CNumerics*, CConfig *config, unsigned short val_marker) { +void CIncNSSolver::BC_HeatTransfer_Wall(const CGeometry *geometry, const CConfig *config, const unsigned short val_marker) { BC_Wall_Generic(geometry, config, val_marker, HEAT_TRANSFER); } @@ -544,7 +543,7 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Retrieve the specified wall function treatment.---*/ if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); + SU2_MPI::Error("Wall function treatment not implemented yet.", CURRENT_FUNCTION); } /*--- Loop over boundary points ---*/ From a6fae7f40d4886246591fb2e29c32d49fb1d331c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 14:08:53 +0200 Subject: [PATCH 14/39] Add compressible version of BC_heattransfer, introducing BC_Heatflux_generic. --- SU2_CFD/include/solvers/CNSSolver.hpp | 20 ++++++++++++++- SU2_CFD/src/solvers/CNSSolver.cpp | 35 ++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/solvers/CNSSolver.hpp b/SU2_CFD/include/solvers/CNSSolver.hpp index 3e362213d69c..958f4659786a 100644 --- a/SU2_CFD/include/solvers/CNSSolver.hpp +++ b/SU2_CFD/include/solvers/CNSSolver.hpp @@ -65,7 +65,7 @@ class CNSSolver final : public CEulerSolver { */ void AddDynamicGridResidualContribution(unsigned long iPoint, unsigned long Point_Normal, - CGeometry* geometry, + const CGeometry* geometry, const su2double* UnitNormal, su2double Area, const su2double* GridVel, @@ -96,6 +96,14 @@ class CNSSolver final : public CEulerSolver { unsigned short val_marker, bool cht_mode = false); + /*! + * \brief Generic implementation of the heatflux and heat-transfer/convection walls. + */ + void BC_HeatFlux_Wall_Generic(const CGeometry *geometry, + const CConfig *config, + unsigned short val_marker, + unsigned short kind_boundary); + /*! * \brief Compute the viscous contribution for a particular edge. * \param[in] iEdge - Edge for which the flux and Jacobians are to be computed. @@ -185,6 +193,16 @@ class CNSSolver final : public CEulerSolver { CConfig *config, unsigned short val_marker) override; + /*! + * \brief Impose a heat flux by prescribing a heat transfer coefficient and a temperature at infinity. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_HeatTransfer_Wall(const CGeometry *geometry, + const CConfig *config, + const unsigned short val_marker) override; + /*! * \brief Impose the Navier-Stokes boundary condition (strong). * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index f3b57266d66c..43d68105a837 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -313,7 +313,7 @@ void CNSSolver::SetRoe_Dissipation(CGeometry *geometry, CConfig *config){ } void CNSSolver::AddDynamicGridResidualContribution(unsigned long iPoint, unsigned long Point_Normal, - CGeometry* geometry, const su2double* UnitNormal, + const CGeometry* geometry, const su2double* UnitNormal, su2double Area, const su2double* GridVel, su2double** Jacobian_i, su2double& Res_Conv, su2double& Res_Visc) const { @@ -406,15 +406,38 @@ void CNSSolver::AddDynamicGridResidualContribution(unsigned long iPoint, unsigne } } -void CNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, - CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { +void CNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver**, CNumerics*, + CNumerics*, CConfig *config, unsigned short val_marker) { + + BC_HeatFlux_Wall_Generic(geometry, config, val_marker, HEAT_FLUX); +} + +void CNSSolver::BC_HeatTransfer_Wall(const CGeometry *geometry, const CConfig *config, const unsigned short val_marker) { + + BC_HeatFlux_Wall_Generic(geometry, config, val_marker, HEAT_TRANSFER); +} + +void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfig *config, + unsigned short val_marker, unsigned short kind_boundary) { /*--- Identify the boundary by string name and get the specified wall heat flux from config as well as the wall function treatment. ---*/ const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - su2double Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + + /*--- Get the specified wall heat flux, temperature or heat transfer coefficient from config ---*/ + + su2double Wall_HeatFlux = 0.0, Tinfinity = 0.0, Transfer_Coefficient = 0.0; + + if (kind_boundary == HEAT_FLUX) { + Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + } + else if (kind_boundary == HEAT_TRANSFER) { + /*--- The required heatflux will be computed for each iPoint individually based on local Temperature. ---*/ + Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag) * config->GetTemperature_Ref()/config->GetHeat_Flux_Ref(); + Tinfinity = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + } // Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); // if (Wall_Function != WALL_FUNCTION::NONE) { @@ -444,6 +467,10 @@ void CNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container if (config->GetMarker_All_PyCustom(val_marker)) Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex); + else if (kind_boundary == HEAT_TRANSFER) { + const su2double Twall = nodes->GetTemperature(iPoint); + Wall_HeatFlux = Transfer_Coefficient * (Tinfinity - Twall); + } /*--- Compute dual-grid area and boundary normal ---*/ From a6b5a10e68df90498a0238f743336791d746a69e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 14:40:33 +0200 Subject: [PATCH 15/39] Clean some GetWall_ routines in CConfig. --- Common/src/CConfig.cpp | 41 ++++++++++++------------------- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 2626165b8e0f..d57eae00c223 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -8864,47 +8864,38 @@ void CConfig::SetIncPressureOut_BC(su2double val_pressure) { su2double CConfig::GetIsothermal_Temperature(string val_marker) const { - unsigned short iMarker_Isothermal = 0; + for (unsigned short iMarker_Isothermal = 0; iMarker_Isothermal < nMarker_Isothermal; iMarker_Isothermal++) + if (Marker_Isothermal[iMarker_Isothermal] == val_marker) + return Isothermal_Temperature[iMarker_Isothermal]; - if (nMarker_Isothermal > 0) { - for (iMarker_Isothermal = 0; iMarker_Isothermal < nMarker_Isothermal; iMarker_Isothermal++) - if (Marker_Isothermal[iMarker_Isothermal] == val_marker) break; - } - - return Isothermal_Temperature[iMarker_Isothermal]; + return Isothermal_Temperature[0]; } su2double CConfig::GetWall_HeatFlux(string val_marker) const { - unsigned short iMarker_HeatFlux = 0; - if (nMarker_HeatFlux > 0) { - for (iMarker_HeatFlux = 0; iMarker_HeatFlux < nMarker_HeatFlux; iMarker_HeatFlux++) - if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) break; - } + for (unsigned short iMarker_HeatFlux = 0; iMarker_HeatFlux < nMarker_HeatFlux; iMarker_HeatFlux++) + if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) + return Heat_Flux[iMarker_HeatFlux]; - return Heat_Flux[iMarker_HeatFlux]; + return Heat_Flux[0]; } su2double CConfig::GetWall_HeatTransfer_Coefficient(string val_marker) const { - unsigned short iMarker_HeatTransfer = 0; - if (nMarker_HeatTransfer > 0) { - for (iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) break; - } + for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) + return HeatTransfer_Coeff[iMarker_HeatTransfer]; - return HeatTransfer_Coeff[iMarker_HeatTransfer]; + return HeatTransfer_Coeff[0]; } su2double CConfig::GetWall_HeatTransfer_Temperature(string val_marker) const { - unsigned short iMarker_HeatTransfer = 0; - if (nMarker_HeatTransfer > 0) { - for (iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) break; - } + for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) + return HeatTransfer_WallTemp[iMarker_HeatTransfer]; - return HeatTransfer_WallTemp[iMarker_HeatTransfer]; + return HeatTransfer_WallTemp[0]; } pair CConfig::GetWallRoughnessProperties(string val_marker) const { diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 43d68105a837..e9ff0a0984b4 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -441,7 +441,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi // Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); // if (Wall_Function != WALL_FUNCTION::NONE) { -// SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); +// SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); // } /*--- Jacobian, initialized to zero if needed. ---*/ From 72a453356bfa7443884fddc16a223312f6a39853 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 17:54:17 +0200 Subject: [PATCH 16/39] Revert changes to python_wrapper_structure of bc_heattransfer PR. --- SU2_CFD/src/python_wrapper_structure.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 1a59930fae5f..588e61d43f17 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -452,9 +452,7 @@ vector CDriver::GetAllCHTMarkersTag() const { //The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. for(iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == HEAT_FLUX || - config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL || - config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == HEAT_TRANSFER) && config_container[ZONE_0]->GetMarker_All_PyCustom(iMarker)){ + if((config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == HEAT_FLUX || config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) && config_container[ZONE_0]->GetMarker_All_PyCustom(iMarker)){ Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); CHTBoundariesTagList.push_back(Marker_Tag); } From 8a3388f8900b7319c8c0017d57f3866b237f1f65 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 18:02:25 +0200 Subject: [PATCH 17/39] Introduce switch-statements to BC_Generic_Wall. --- SU2_CFD/src/solvers/CIncNSSolver.cpp | 38 +++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 645f03283a3e..021856b60a9c 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -380,16 +380,21 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con su2double Wall_HeatFlux = 0.0, Twall = 0.0, Tinfinity = 0.0, Transfer_Coefficient = 0.0; - if (kind_boundary == HEAT_FLUX) - Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); - else if (kind_boundary == ISOTHERMAL) - Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); - else if (kind_boundary == HEAT_TRANSFER) { - Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag) * config->GetTemperature_Ref()/config->GetHeat_Flux_Ref(); - Tinfinity = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + switch(kind_boundary) { + case HEAT_FLUX: + Wall_HeatFlux = config->GetWall_HeatFlux(Marker_Tag)/config->GetHeat_Flux_Ref(); + break; + case ISOTHERMAL: + Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + break; + case HEAT_TRANSFER: + Transfer_Coefficient = config->GetWall_HeatTransfer_Coefficient(Marker_Tag) * config->GetTemperature_Ref()/config->GetHeat_Flux_Ref(); + Tinfinity = config->GetWall_HeatTransfer_Temperature(Marker_Tag)/config->GetTemperature_Ref(); + break; + default: + SU2_MPI::Error("Unknown type of boundary condition.", CURRENT_FUNCTION); + break; } - else - SU2_MPI::Error("Unknown type of boundary condition.", CURRENT_FUNCTION); /*--- Get wall function treatment from config. ---*/ @@ -440,7 +445,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con if (!energy) continue; - if (kind_boundary == HEAT_FLUX) { + switch(kind_boundary) { + case HEAT_FLUX: /*--- Apply a weak boundary condition for the energy equation. Compute the residual due to the prescribed heat flux. ---*/ @@ -462,8 +468,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con LinSysRes(iPoint, nDim+1) += scalar_factor*dot_product; } // if streamwise_periodic - } - else if (kind_boundary == HEAT_TRANSFER) { + break; + + case HEAT_TRANSFER: Twall = nodes->GetTemperature(iPoint); Wall_HeatFlux = Transfer_Coefficient * (Tinfinity - Twall); @@ -471,9 +478,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con Compute the residual due to the prescribed temperature and transfer coefficient. Note that for the Heat_Transfer wall, basically a heatflux wall that depends on the local Temperature is applied. ---*/ LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; + break; - } - else { // ISOTHERMAL + case ISOTHERMAL: const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); @@ -507,7 +514,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con proj_vector_ij = GeometryToolbox::DotProduct(nDim, Edge_Vector, Normal) / dist_ij_2; Jacobian.AddVal2Diag(iPoint, nDim+1, thermal_conductivity*proj_vector_ij); } - } + break; + } // switch } END_SU2_OMP_FOR } From 02ad931d34f5acc02940ba1bf7040eee5d50464b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 28 Jul 2021 18:10:45 +0200 Subject: [PATCH 18/39] Adding comment how some screen output is flawed and why comemnted out. Not fixed though. --- SU2_CFD/src/output/COutput.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 5d6ab2e8d90e..81ef20a79db7 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1099,8 +1099,10 @@ void COutput::SetScreen_Output(const CConfig *config) { PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::SCIENTIFIC: - // SURFACE_STATIC_TEMPERATURE e.g. is written to screen twice - if(false)PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); + // This line causes SCIENTIFIC output from Marker_Analyze to be written to screen twice after one another. + // Thus ruining the nice alignment of the columns in the screen output. Requires debugging. + // Try e.g. SURFACE_STATIC_TEMPERATURE with incompressible cases. + //PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::PERCENT: PrintingToolbox::PrintScreenPercent(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); From 7926b04c802daf88f4c518be0172cd4697cc22fb Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 29 Jul 2021 13:20:43 +0200 Subject: [PATCH 19/39] Add Jacobian contribution of the HeatTransfer BC for comp and incomp solver. --- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 ++++ SU2_CFD/src/solvers/CNSSolver.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 021856b60a9c..6591c503ea10 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -478,6 +478,10 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con Compute the residual due to the prescribed temperature and transfer coefficient. Note that for the Heat_Transfer wall, basically a heatflux wall that depends on the local Temperature is applied. ---*/ LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; + + if (implicit) { + Jacobian.AddVal2Diag(iPoint, nDim+1, Transfer_Coefficient*Area); + } break; case ISOTHERMAL: diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index e9ff0a0984b4..119e251412b0 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -534,6 +534,10 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi Jacobian.AddBlock2Diag(iPoint, Jacobian_i); } + if (kind_boundary == HEAT_TRANSFER){ + Jacobian.AddVal2Diag(iPoint, nDim+1, Transfer_Coefficient*Area); + } + for (auto iVar = 1u; iVar <= nDim; iVar++) { auto total_index = iPoint*nVar+iVar; Jacobian.DeleteValsRowi(total_index); From 0c6855e5daa2b329c2936bc9e1a7dc20782aa54e Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Thu, 29 Jul 2021 13:08:27 +0100 Subject: [PATCH 20/39] Revert COutput --- SU2_CFD/src/output/COutput.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 81ef20a79db7..c37bcab5a650 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1099,10 +1099,7 @@ void COutput::SetScreen_Output(const CConfig *config) { PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::SCIENTIFIC: - // This line causes SCIENTIFIC output from Marker_Analyze to be written to screen twice after one another. - // Thus ruining the nice alignment of the columns in the screen output. Requires debugging. - // Try e.g. SURFACE_STATIC_TEMPERATURE with incompressible cases. - //PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); + PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map.at(RequestedField)[0].value, fieldWidth); break; case ScreenOutputFormat::PERCENT: PrintingToolbox::PrintScreenPercent(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); From a75ba0539d88601e98b8a2f72272096b4b764e24 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 29 Jul 2021 14:37:21 +0200 Subject: [PATCH 21/39] Fighting a hopeless fight against the copy-paste-adapt Monster in CConfig.hpp :( --- Common/include/CConfig.hpp | 173 +++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 4737fd0a71d3..afd979cbfe3b 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -206,7 +206,7 @@ class CConfig { nMarker_Smoluchowski_Maxwell, /*!< \brief Number of smoluchowski/maxwell wall boundaries. */ nMarker_Isothermal, /*!< \brief Number of isothermal wall boundaries. */ nMarker_HeatFlux, /*!< \brief Number of constant heat flux wall boundaries. */ - nMarker_HeatTransfer, /*!< \brief Number of heat flux wall boundaries with prescribed heat transfer coefficient. */ + nMarker_HeatTransfer, /*!< \brief Number of heat-transfer/convection wall boundaries. */ nMarker_EngineExhaust, /*!< \brief Number of nacelle exhaust flow markers. */ nMarker_EngineInflow, /*!< \brief Number of nacelle inflow flow markers. */ nMarker_Clamped, /*!< \brief Number of clamped markers in the FEM. */ @@ -255,7 +255,7 @@ class CConfig { *Marker_Smoluchowski_Maxwell, /*!< \brief Smoluchowski/Maxwell wall markers. */ *Marker_Isothermal, /*!< \brief Isothermal wall markers. */ *Marker_HeatFlux, /*!< \brief Constant heat flux wall markers. */ - *Marker_HeatTransfer, /*!< \brief Heat flux wall markers with specified heat transfer coefficient. */ + *Marker_HeatTransfer, /*!< \brief Heat-transfer/convection markers. */ *Marker_RoughWall, /*!< \brief Constant heat flux wall markers. */ *Marker_EngineInflow, /*!< \brief Engine Inflow flow markers. */ *Marker_EngineExhaust, /*!< \brief Engine Exhaust flow markers. */ @@ -312,7 +312,7 @@ class CConfig { su2double *Outlet_Pressure; /*!< \brief Specified back pressures (static) for outlet boundaries. */ su2double *Isothermal_Temperature; /*!< \brief Specified isothermal wall temperatures (static). */ su2double *HeatTransfer_Coeff; /*!< \brief Specified heat transfer coefficients. */ - su2double *HeatTransfer_WallTemp; /*!< \brief Specified isothermal wall temperatures alongside heat transfer coefficients. */ + su2double *HeatTransfer_WallTemp; /*!< \brief Specified temperatures at infinity alongside heat transfer coefficients. */ su2double *Wall_Catalycity; /*!< \brief Specified wall species mass-fractions for catalytic boundaries. */ su2double *Heat_Flux; /*!< \brief Specified wall heat fluxes. */ su2double *Roughness_Height; /*!< \brief Equivalent sand grain roughness for the marker according to config file. */ @@ -1644,14 +1644,14 @@ class CConfig { su2double GetDensity_FreeStream(void) const { return Density_FreeStream; } /*! - * \brief Get the value of the frestream temperature. - * \return Freestream temperature. + * \brief Get the magnitude of the free-stream velocity of the fluid. + * \return Magnitude of the free-stream velocity. */ su2double GetModVel_FreeStream(void) const { return ModVel_FreeStream; } /*! - * \brief Get the value of the frestream temperature. - * \return Freestream temperature. + * \brief Get the non-dimensional magnitude of the free-stream velocity of the fluid. + * \return Non-dimensional magnitude of the free-stream velocity. */ su2double GetModVel_FreeStreamND(void) const { return ModVel_FreeStreamND; } @@ -1808,8 +1808,8 @@ class CConfig { su2double GetTemperature_FreeStreamND(void) const { return Temperature_FreeStreamND; } /*! - * \brief Get the value of the non-dimensionalized freestream temperature. - * \return Non-dimensionalized freestream temperature. + * \brief Get the value of the non-dimensionalized vibrational-electronic freestream temperature. + * \return Non-dimensionalized vibrational-electronic freestream temperature. */ su2double GetTemperature_ve_FreeStreamND(void) const { return Temperature_ve_FreeStreamND; } @@ -2248,91 +2248,91 @@ class CConfig { /*! * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \param[in] val_froude - Value of the Froude number. */ void SetFroude(su2double val_froude) { Froude = val_froude; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the Mach number. + * \param[in] val_mach - Value of the Mach number. */ void SetMach(su2double val_mach) { Mach = val_mach; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the Reynolds number. + * \param[in] val_reynolds - Value of the Reynolds number. */ void SetReynolds(su2double val_reynolds) { Reynolds = val_reynolds; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference length for nondimensionalization. + * \param[in] val_length_ref - Value of the reference length. */ void SetLength_Ref(su2double val_length_ref) { Length_Ref = val_length_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference velocity for nondimensionalization. + * \param[in] val_velocity_ref - Value of the reference velocity. */ void SetVelocity_Ref(su2double val_velocity_ref) { Velocity_Ref = val_velocity_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference pressure for nondimensionalization. + * \param[in] val_pressure_ref - Value of the reference pressure. */ void SetPressure_Ref(su2double val_pressure_ref) { Pressure_Ref = val_pressure_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference pressure for nondimensionalization. + * \param[in] val_density_ref - Value of the reference pressure. */ void SetDensity_Ref(su2double val_density_ref) { Density_Ref = val_density_ref; } /*! - * \brief Set the reference temperature. - * \return Value of the Froude number. + * \brief Set the reference temperature for nondimensionalization. + * \param[in] val_temperature_ref - Value of the reference temperature. */ void SetTemperature_Ref(su2double val_temperature_ref) { Temperature_Ref = val_temperature_ref; } /*! * \brief Set the reference temperature. - * \return Value of the Froude number. + * \param[in] val_temperature_ve_ref - Value of the reference temperature. */ void SetTemperature_ve_Ref(su2double val_temperature_ve_ref) { Temperature_ve_Ref = val_temperature_ve_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference time for nondimensionalization. + * \param[in] val_time_ref - Value of the reference time. */ void SetTime_Ref(su2double val_time_ref) { Time_Ref = val_time_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference energy for nondimensionalization. + * \param[in] val_energy_ref - Value of the reference energy. */ void SetEnergy_Ref(su2double val_energy_ref) { Energy_Ref = val_energy_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference Omega for nondimensionalization. + * \param[in] val_omega_ref - Value of the reference omega. */ void SetOmega_Ref(su2double val_omega_ref) { Omega_Ref = val_omega_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference Force for nondimensionalization. + * \param[in] val_force_ref - Value of the reference Force. */ void SetForce_Ref(su2double val_force_ref) { Force_Ref = val_force_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference gas-constant for nondimensionalization. + * \param[in] val_gas_constant_ref - Value of the reference gas-constant. */ void SetGas_Constant_Ref(su2double val_gas_constant_ref) { Gas_Constant_Ref = val_gas_constant_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the gas-constant. + * \param[in] val_gas_constant - Value of the gas-constant. */ void SetGas_Constant(su2double val_gas_constant) { Gas_Constant = val_gas_constant; } @@ -2367,26 +2367,26 @@ class CConfig { void SetHeat_Flux_Ref(su2double val_heat_flux_ref) { Heat_Flux_Ref = val_heat_flux_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference viscosity for nondimensionalization. + * \param[in] val_viscosity_ref - Value of the reference viscosity. */ void SetViscosity_Ref(su2double val_viscosity_ref) { Viscosity_Ref = val_viscosity_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the reference conductivity for nondimensionalization. + * \param[in] val_conductivity_ref - Value of the reference conductivity. */ void SetConductivity_Ref(su2double val_conductivity_ref) { Conductivity_Ref = val_conductivity_ref; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the nondimensionalized freestream pressure. + * \param[in] val_pressure_freestreamnd - Value of the nondimensionalized freestream pressure. */ void SetPressure_FreeStreamND(su2double val_pressure_freestreamnd) { Pressure_FreeStreamND = val_pressure_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream pressure. + * \param[in] val_pressure_freestream - Value of the freestream pressure. */ void SetPressure_FreeStream(su2double val_pressure_freestream) { Pressure_FreeStream = val_pressure_freestream; } @@ -2403,62 +2403,62 @@ class CConfig { void SetPressure_Thermodynamic(su2double val_pressure_thermodynamic) { Pressure_Thermodynamic = val_pressure_thermodynamic; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the nondimensionalized freestream density. + * \param[in] val_density_freestreamnd - Value of the nondimensionalized freestream density. */ void SetDensity_FreeStreamND(su2double val_density_freestreamnd) { Density_FreeStreamND = val_density_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream density. + * \param[in] val_density_freestream - Value of the freestream density. */ void SetDensity_FreeStream(su2double val_density_freestream) { Density_FreeStream = val_density_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream viscosity. + * \param[in] val_viscosity_freestream - Value of the freestream viscosity. */ void SetViscosity_FreeStream(su2double val_viscosity_freestream) { Viscosity_FreeStream = val_viscosity_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the magnitude of the free-stream velocity. + * \param[in] val_modvel_freestream - Magnitude of the free-stream velocity. */ void SetModVel_FreeStream(su2double val_modvel_freestream) { ModVel_FreeStream = val_modvel_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional magnitude of the free-stream velocity. + * \param[in] val_modvel_freestreamnd - Non-dimensional magnitude of the free-stream velocity. */ void SetModVel_FreeStreamND(su2double val_modvel_freestreamnd) { ModVel_FreeStreamND = val_modvel_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream temperature. + * \param[in] val_temperature_freestream - Value of the freestream temperature. */ void SetTemperature_FreeStream(su2double val_temperature_freestream) { Temperature_FreeStream = val_temperature_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional freestream temperature. + * \param[in] val_temperature_freestreamnd - Value of the non-dimensional freestream temperature. */ void SetTemperature_FreeStreamND(su2double val_temperature_freestreamnd) { Temperature_FreeStreamND = val_temperature_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream vibrational-electronic temperature. + * \param[in] val_temperature_ve_freestream - Value of the freestream vibrational-electronic temperature. */ void SetTemperature_ve_FreeStream(su2double val_temperature_ve_freestream) { Temperature_ve_FreeStream = val_temperature_ve_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional freestream vibrational-electronic temperature. + * \param[in] val_temperature_ve_freestreamnd - Value of the non-dimensional freestream vibrational-electronic temperature. */ void SetTemperature_ve_FreeStreamND(su2double val_temperature_ve_freestreamnd) { Temperature_ve_FreeStreamND = val_temperature_ve_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional gas-constant. + * \param[in] val_gas_constantnd - Value of the non-dimensional gas-constant. */ void SetGas_ConstantND(su2double val_gas_constantnd) { Gas_ConstantND = val_gas_constantnd; } @@ -2470,62 +2470,63 @@ class CConfig { void SetVelocity_FreeStream(su2double val_velocity_freestream, unsigned short val_dim) { vel_inf[val_dim] = val_velocity_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional free-stream velocity. + * \param[in] val_velocity_freestreamnd - Value of the non-dimensional free-stream velocity component. + * \param[in] val_dim - Value of the current dimension. */ void SetVelocity_FreeStreamND(su2double val_velocity_freestreamnd, unsigned short val_dim) { Velocity_FreeStreamND[val_dim] = val_velocity_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional free-stream viscosity. + * \param[in] val_viscosity_freestreamnd - Value of the non-dimensional free-stream viscosity. */ void SetViscosity_FreeStreamND(su2double val_viscosity_freestreamnd) { Viscosity_FreeStreamND = val_viscosity_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional freestream turbulent kinetic energy. + * \param[in] val_tke_freestreamnd - Value of the non-dimensional freestream turbulent kinetic energy. */ void SetTke_FreeStreamND(su2double val_tke_freestreamnd) { Tke_FreeStreamND = val_tke_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional freestream specific dissipation rate omega. + * \param[in] val_omega_freestreamnd - Value of the non-dimensional freestream specific dissipation rate omega. */ void SetOmega_FreeStreamND(su2double val_omega_freestreamnd) { Omega_FreeStreamND = val_omega_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream turbulent kinetic energy. + * \param[in] val_tke_freestream - Value of the freestream turbulent kinetic energy. */ void SetTke_FreeStream(su2double val_tke_freestream) { Tke_FreeStream = val_tke_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream specific dissipation rate omega. + * \param[in] val_omega_freestream - Value of the freestream specific dissipation rate omega. */ void SetOmega_FreeStream(su2double val_omega_freestream) { Omega_FreeStream = val_omega_freestream; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional freestream energy. + * \param[in] val_energy_freestreamnd - Value of the non-dimensional freestream energy. */ void SetEnergy_FreeStreamND(su2double val_energy_freestreamnd) { Energy_FreeStreamND = val_energy_freestreamnd; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the freestream energy. + * \param[in] val_energy_freestream - Value of the freestream energy. */ void SetEnergy_FreeStream(su2double val_energy_freestream) { Energy_FreeStream = val_energy_freestream; } /*! * \brief Set the thermal diffusivity for solids. - * \return Value of the Froude number. + * \param[in] val_thermal_diffusivity - Value of the thermal diffusivity. */ void SetThermalDiffusivity(su2double val_thermal_diffusivity) { Thermal_Diffusivity = val_thermal_diffusivity; } /*! - * \brief Set the Froude number for free surface problems. - * \return Value of the Froude number. + * \brief Set the non-dimensional total time for unsteady simulations. + * \param[in] val_total_unsttimend - Value of the non-dimensional total time. */ void SetTotal_UnstTimeND(su2double val_total_unsttimend) { Total_UnstTimeND = val_total_unsttimend; } @@ -6618,9 +6619,9 @@ class CConfig { su2double GetWall_HeatTransfer_Coefficient(string val_index) const; /*! - * \brief Get the wall temperature on a heat transfer boundary. + * \brief Get the temperature at inifinty on a heat transfer boundary. * \param[in] val_index - Index corresponding to the heat transfer boundary. - * \return The wall temperature. + * \return The temperature at infinity. */ su2double GetWall_HeatTransfer_Temperature(string val_index) const; From 88091dd83a2acb5ea7c51d19b166234c1b1fa80e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 29 Jul 2021 20:04:20 +0200 Subject: [PATCH 22/39] Change KT_CONSTANT to THERMAL_CONDUCTIVITY_CONSTANT. --- Common/include/CConfig.hpp | 11 ++++++----- Common/src/CConfig.cpp | 8 ++++---- SU2_CFD/src/fluid/CFluidModel.cpp | 4 ++-- SU2_CFD/src/output/CFlowOutput.cpp | 8 ++++---- SU2_CFD/src/output/output_structure_legacy.cpp | 8 ++++---- SU2_CFD/src/solvers/CEulerSolver.cpp | 4 ++-- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 4 ++-- SU2_CFD/src/solvers/CHeatSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 4 ++-- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg | 2 +- .../coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder1.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder2.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder3.cfg | 2 +- .../disc_adj_unsteadyCHT_cylinder/solid.cfg | 2 +- TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg | 2 +- TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg | 2 +- .../coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder1.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder2.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder3.cfg | 2 +- .../cylinder/heated_cylinder.cfg | 2 +- .../transonic_stator_2D/transonic_stator.cfg | 2 +- .../buoyancy_cavity/lam_buoyancy_cavity.cfg | 2 +- .../incomp_navierstokes/cylinder/poly_cylinder.cfg | 2 +- .../chtPinArray_2d/configSolid.cfg | 2 +- .../chtPinArray_3d/configSolid.cfg | 2 +- .../mms/fvm_incomp_navierstokes/lam_mms_fds.cfg | 2 +- TestCases/navierstokes/poiseuille/lam_poiseuille.cfg | 2 +- .../navierstokes/poiseuille/profile_poiseuille.cfg | 2 +- TestCases/nicf/LS89/turb_SA_PR.cfg | 2 +- TestCases/nicf/LS89/turb_SST_PR.cfg | 2 +- .../unsteady_CHT_FlatPlate_Conf.cfg | 2 +- TestCases/radiation/p1model/configp1.cfg | 2 +- TestCases/sliding_interface/bars_SST_2D/bars.cfg | 2 +- .../centrifugal_blade/centrifugal_blade.cfg | 2 +- .../centrifugal_stage/centrifugal_stage.cfg | 2 +- .../transonic_stator_2D/transonic_stator.cfg | 2 +- .../transonic_stator_2D/transonic_stator_rst.cfg | 2 +- config_template.cfg | 12 +++++------- 45 files changed, 67 insertions(+), 68 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index afd979cbfe3b..175f727e50fb 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -794,8 +794,8 @@ class CConfig { Acentric_Factor, /*!< \brief Acentric Factor for real fluid model. */ Mu_Constant, /*!< \brief Constant viscosity for ConstantViscosity model. */ Mu_ConstantND, /*!< \brief Non-dimensional constant viscosity for ConstantViscosity model. */ - Kt_Constant, /*!< \brief Constant thermal conductivity for ConstantConductivity model. */ - Kt_ConstantND, /*!< \brief Non-dimensional constant thermal conductivity for ConstantConductivity model. */ + Thermal_Conductivity_Constant, /*!< \brief Constant thermal conductivity for ConstantConductivity model. */ + Thermal_Conductivity_ConstantND, /*!< \brief Non-dimensional constant thermal conductivity for ConstantConductivity model. */ Mu_Ref, /*!< \brief Reference viscosity for Sutherland model. */ Mu_RefND, /*!< \brief Non-dimensional reference viscosity for Sutherland model. */ Mu_Temperature_Ref, /*!< \brief Reference temperature for Sutherland model. */ @@ -3720,13 +3720,14 @@ class CConfig { * \brief Get the value of the thermal conductivity. * \return Thermal conductivity. */ - su2double GetKt_Constant(void) const { return Kt_Constant; } + su2double GetThermal_Conductivity_Constant(void) const { return Thermal_Conductivity_Constant; } /*! * \brief Get the value of the non-dimensional thermal conductivity. * \return Non-dimensional thermal conductivity. */ - su2double GetKt_ConstantND(void) const { return Kt_ConstantND; } + su2double GetThermal_Conductivity_ConstantND(void) const { return Thermal_Conductivity_ConstantND; } + /*! * \brief Get the value of the reference viscosity for Sutherland model. @@ -3832,7 +3833,7 @@ class CConfig { /*! * \brief Set the value of the non-dimensional thermal conductivity. */ - void SetKt_ConstantND(su2double kt_const) { Kt_ConstantND = kt_const; } + void SetThermal_Conductivity_ConstantND(su2double therm_cond_const) { Thermal_Conductivity_ConstantND = therm_cond_const; } /*! * \brief Set the value of the non-dimensional reference viscosity for Sutherland model. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d57eae00c223..e271a37315ef 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1204,7 +1204,7 @@ void CConfig::SetConfig_Options() { /*--- Options related to Constant Thermal Conductivity Model ---*/ /* DESCRIPTION: default value for AIR */ - addDoubleOption("KT_CONSTANT", Kt_Constant , 0.0257); + addDoubleOption("THERMAL_CONDUCTIVITY_CONSTANT", Thermal_Conductivity_Constant , 0.0257); /*--- Options related to temperature polynomial coefficients for fluid models. ---*/ @@ -2905,9 +2905,9 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ if (!option_name.compare("THERMAL_DIFFUSIVITY")) newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n"); if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID")) - newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set KT_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); + newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set THERMAL_CONDUCTIVITY_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY")) - newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use KT_CONSTANT instead.\n\n"); + newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use THERMAL_CONDUCTIVITY_CONSTANT instead.\n\n"); if (!option_name.compare("SOLID_DENSITY")) newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n"); if (!option_name.compare("SOLID_TEMPERATURE_INIT")) @@ -3578,7 +3578,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if(fabs(Mu_S-110.4) < 1.0E-8) Mu_S *= 1.8; /* Correct the thermal conductivity, if it contains the default SI value. */ - if(fabs(Kt_Constant-0.0257) < 1.0E-10) Kt_Constant *= 0.577789317; + if(fabs(Thermal_Conductivity_Constant-0.0257) < 1.0E-10) Thermal_Conductivity_Constant *= 0.577789317; } /*--- Check for Measurement System ---*/ diff --git a/SU2_CFD/src/fluid/CFluidModel.cpp b/SU2_CFD/src/fluid/CFluidModel.cpp index 9c995c36c535..1367206db669 100644 --- a/SU2_CFD/src/fluid/CFluidModel.cpp +++ b/SU2_CFD/src/fluid/CFluidModel.cpp @@ -59,9 +59,9 @@ void CFluidModel::SetThermalConductivityModel(const CConfig* config) { case CONDUCTIVITYMODEL::CONSTANT: if (config->GetKind_ConductivityModel_Turb() == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) { ThermalConductivity = unique_ptr( - new CConstantConductivityRANS(config->GetKt_ConstantND(), config->GetPrandtl_Turb())); + new CConstantConductivityRANS(config->GetThermal_Conductivity_ConstantND(), config->GetPrandtl_Turb())); } else { - ThermalConductivity = unique_ptr(new CConstantConductivity(config->GetKt_ConstantND())); + ThermalConductivity = unique_ptr(new CConstantConductivity(config->GetThermal_Conductivity_ConstantND())); } break; case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index ffaa742062ab..b3e3ea4936d5 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1397,8 +1397,8 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo case CONDUCTIVITYMODEL::CONSTANT: Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config->GetKt_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetKt_ConstantND()<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetThermal_Conductivity_ConstantND()<< "\n"; break; default: @@ -1762,8 +1762,8 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo case CONDUCTIVITYMODEL::CONSTANT: Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config->GetKt_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetKt_ConstantND()<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetThermal_Conductivity_ConstantND()<< "\n"; break; case CONDUCTIVITYMODEL::POLYNOMIAL: diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index fc65caa3aeb6..f4998148818b 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -2991,8 +2991,8 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry case CONDUCTIVITYMODEL::CONSTANT: Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetKt_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetKt_ConstantND()<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetThermal_Conductivity_ConstantND()<< "\n"; break; default: @@ -3356,8 +3356,8 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry case CONDUCTIVITYMODEL::CONSTANT: Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetKt_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetKt_ConstantND()<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetThermal_Conductivity_ConstantND()<< "\n"; break; case CONDUCTIVITYMODEL::POLYNOMIAL: diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 24507b680d70..1b9269be9971 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1334,7 +1334,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes config->SetMu_Temperature_RefND(config->GetMu_Temperature_Ref()/config->GetTemperature_Ref()); /*--- Constant thermal conductivity model. ---*/ - config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); + config->SetThermal_Conductivity_ConstantND(config->GetThermal_Conductivity_Constant()/Conductivity_Ref); } /*--- Create one final fluid model object per OpenMP thread to be able to use them in parallel. @@ -1480,7 +1480,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes case CONDUCTIVITYMODEL::CONSTANT: ModelTable << "CONSTANT"; Unit << "W/m^2.K"; - NonDimTable << "Molecular Cond." << config->GetKt_Constant() << config->GetKt_Constant()/config->GetKt_ConstantND() << Unit.str() << config->GetKt_ConstantND(); + NonDimTable << "Molecular Cond." << config->GetThermal_Conductivity_Constant() << config->GetThermal_Conductivity_Constant()/config->GetThermal_Conductivity_ConstantND() << Unit.str() << config->GetThermal_Conductivity_ConstantND(); Unit.str(""); NonDimTable.PrintFooter(); break; diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 78455ff360e5..5e8b48b74a21 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1080,7 +1080,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, config->SetMu_Temperature_RefND(config->GetMu_Temperature_Ref()/config->GetTemperature_Ref()); /* constant thermal conductivity model */ - config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); + config->SetThermal_Conductivity_ConstantND(config->GetThermal_Conductivity_Constant()/Conductivity_Ref); FluidModel->SetLaminarViscosityModel(config); FluidModel->SetThermalConductivityModel(config); @@ -1183,7 +1183,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, case CONDUCTIVITYMODEL::CONSTANT: ModelTable << "CONSTANT"; Unit << "W/m^2.K"; - NonDimTable << "Molecular Cond." << config->GetKt_Constant() << config->GetKt_Constant()/config->GetKt_ConstantND() << Unit.str() << config->GetKt_ConstantND(); + NonDimTable << "Molecular Cond." << config->GetThermal_Conductivity_Constant() << config->GetThermal_Conductivity_Constant()/config->GetThermal_Conductivity_ConstantND() << Unit.str() << config->GetThermal_Conductivity_ConstantND(); Unit.str(""); NonDimTable.PrintFooter(); break; diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index c5ad88be7310..c7632f0fa52e 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -124,7 +124,7 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM if (heat_equation) { su2double rho_cp = config->GetMaterialDensity(0)*config->GetSpecific_Heat_Cp(); - config->SetThermalDiffusivity(config->GetKt_Constant() / rho_cp); + config->SetThermalDiffusivity(config->GetThermal_Conductivity_Constant() / rho_cp); /*--- Fluxes are computed via thermal diffusivity (not conductivity), so we have to divide by rho*cp ---*/ config->SetHeat_Flux_Ref(rho_cp*Temperature_Ref); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 3bfad9f52856..5b16a24c00af 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -485,7 +485,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i /*--- Constant thermal conductivity model ---*/ - config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); + config->SetThermal_Conductivity_ConstantND(config->GetThermal_Conductivity_Constant()/Conductivity_Ref); /*--- Conductivity model via polynomial. ---*/ @@ -655,7 +655,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i case CONDUCTIVITYMODEL::CONSTANT: ModelTable << "CONSTANT"; Unit << "W/m^2.K"; - NonDimTable << "Molecular Cond." << config->GetKt_Constant() << config->GetKt_Constant()/config->GetKt_ConstantND() << Unit.str() << config->GetKt_ConstantND(); + NonDimTable << "Molecular Cond." << config->GetThermal_Conductivity_Constant() << config->GetThermal_Conductivity_Constant()/config->GetThermal_Conductivity_ConstantND() << Unit.str() << config->GetThermal_Conductivity_ConstantND(); Unit.str(""); NonDimTable.PrintFooter(); break; diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 4f88dee8d14e..c66c76c6545b 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1247,7 +1247,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short config->SetMu_Temperature_RefND(config->GetMu_Temperature_Ref()/config->GetTemperature_Ref()); /* constant thermal conductivity model */ - config->SetKt_ConstantND(config->GetKt_Constant()/Conductivity_Ref); + config->SetThermal_Conductivity_ConstantND(config->GetThermal_Conductivity_Constant()/Conductivity_Ref); } diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg index 7ace12963b32..66c319e38681 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg index bf2452f11763..ae2cb8e3ae12 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg index d32bab9ba10b..24f90033c273 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg index c4c66039fd96..26ec18da9c92 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg @@ -115,7 +115,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg index 9e00ad47b92f..67a66d3869a0 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg index 2eb59a1f86c5..e8658b68ef70 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg index d7c5677b52b9..f3a9606cbce7 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP = 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg index 102fd5b2733e..56aad35a2c09 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/solid.cfg @@ -14,7 +14,7 @@ INC_NONDIM= DIMENSIONAL FREESTREAM_TEMPERATURE= 340.0 MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 0.8710 -KT_CONSTANT= 200 +THERMAL_CONDUCTIVITY_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg index 072923c45e3e..669aca109e7b 100644 --- a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg @@ -112,7 +112,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg index 4d1dafa170aa..2496488317e8 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg index 04fccdb8508e..bf62a609d22d 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg index 41e1ebc1c0d9..cc1c1d1cda4c 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.000210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg index a12beaa28d9b..a5175103be4a 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg @@ -112,7 +112,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg index c185669e9c76..a0ddf89d522d 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.0210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg index bb9a51a9210a..99015cce998d 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.0210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg index 0dc28248a205..19a11b0da98d 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg @@ -59,7 +59,7 @@ MATERIAL_DENSITY= 0.0210322 SPECIFIC_HEAT_CP= 1004.703 % % Solid thermal conductivity (W/m*K) -KT_CONSTANT= 0.1028 +THERMAL_CONDUCTIVITY_CONSTANT= 0.1028 % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index ad90e53b9854..20d53c7a255c 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -82,7 +82,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 diff --git a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg index 6256ee7923f7..899122374f03 100644 --- a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -126,7 +126,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.047280 +THERMAL_CONDUCTIVITY_CONSTANT= 0.047280 % % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 9cdd52d57360..4bdf076f09a8 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -76,7 +76,7 @@ MU_CONSTANT= 1.716e-5 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0246295028571 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0246295028571 % ----------------------- BODY FORCE DEFINITION -------------------------------% % diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index 46aa9d45affc..2f9c80ce5f46 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -85,7 +85,7 @@ MU_POLYCOEFFS= (1.7893e-05, 1e-8, 0.0, 0.0, 0.0) CONDUCTIVITY_MODEL= POLYNOMIAL_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index c99415359518..58db9c50af40 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -24,7 +24,7 @@ INC_NONDIM= DIMENSIONAL FREESTREAM_TEMPERATURE= 345.0 MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 871.0 -KT_CONSTANT= 200 +THERMAL_CONDUCTIVITY_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index acd4406cc57f..d446a3b405b6 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -19,7 +19,7 @@ INC_NONDIM= DIMENSIONAL FREESTREAM_TEMPERATURE= 345.0 MATERIAL_DENSITY= 2719 SPECIFIC_HEAT_CP = 871.0 -KT_CONSTANT= 200 +THERMAL_CONDUCTIVITY_CONSTANT= 200 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index 3f7ade6273f5..659cbc1e81b1 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -57,7 +57,7 @@ MU_CONSTANT= 0.5 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index c5a80010ebe6..a30099df7f95 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -100,7 +100,7 @@ MU_CONSTANT= 0.1 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Constant Prandtl number PRANDTL_LAM = 1.0 diff --git a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg index 2facd7569d78..9d93577eed1e 100644 --- a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg @@ -100,7 +100,7 @@ MU_CONSTANT= 0.1 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Constant Prandtl number PRANDTL_LAM = 1.0 diff --git a/TestCases/nicf/LS89/turb_SA_PR.cfg b/TestCases/nicf/LS89/turb_SA_PR.cfg index 525a0c2a83ae..27716d5f4125 100644 --- a/TestCases/nicf/LS89/turb_SA_PR.cfg +++ b/TestCases/nicf/LS89/turb_SA_PR.cfg @@ -123,7 +123,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.047280 +THERMAL_CONDUCTIVITY_CONSTANT= 0.047280 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/nicf/LS89/turb_SST_PR.cfg b/TestCases/nicf/LS89/turb_SST_PR.cfg index d5b6aa40938b..45659d83fd62 100644 --- a/TestCases/nicf/LS89/turb_SST_PR.cfg +++ b/TestCases/nicf/LS89/turb_SST_PR.cfg @@ -122,7 +122,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.047280 +THERMAL_CONDUCTIVITY_CONSTANT= 0.047280 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index 98de1c9154ef..4811b389d4bf 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -152,7 +152,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % ------------------------- UNSTEADY SIMULATION -------------------------------% % diff --git a/TestCases/radiation/p1model/configp1.cfg b/TestCases/radiation/p1model/configp1.cfg index 6fab911c2cd9..2f88dcdb5857 100644 --- a/TestCases/radiation/p1model/configp1.cfg +++ b/TestCases/radiation/p1model/configp1.cfg @@ -34,7 +34,7 @@ VISCOSITY_MODEL= CONSTANT_VISCOSITY MU_CONSTANT= 1.716e-5 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY -KT_CONSTANT= 0.0246295028571 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0246295028571 BODY_FORCE= YES BODY_FORCE_VECTOR= ( 0.0, -9.81, 0.0 ) diff --git a/TestCases/sliding_interface/bars_SST_2D/bars.cfg b/TestCases/sliding_interface/bars_SST_2D/bars.cfg index 5587e62d4638..a032bfa1f3e7 100644 --- a/TestCases/sliding_interface/bars_SST_2D/bars.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/bars.cfg @@ -129,7 +129,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.028085 +THERMAL_CONDUCTIVITY_CONSTANT= 0.028085 % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % diff --git a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg index 4066a0420dc8..54b835f61401 100755 --- a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg +++ b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg @@ -118,7 +118,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.025275 +THERMAL_CONDUCTIVITY_CONSTANT= 0.025275 % % % diff --git a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg index 69740ee71b81..867566945723 100755 --- a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg +++ b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg @@ -118,7 +118,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.025275 +THERMAL_CONDUCTIVITY_CONSTANT= 0.025275 % % % diff --git a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg index 2413c86a268f..520379e461b0 100644 --- a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -122,7 +122,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.047280 +THERMAL_CONDUCTIVITY_CONSTANT= 0.047280 % % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% diff --git a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg index 48778dcf05f4..c3a2048e8316 100644 --- a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg +++ b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg @@ -127,7 +127,7 @@ SUTHERLAND_CONSTANT= 110.4 CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.047280 +THERMAL_CONDUCTIVITY_CONSTANT= 0.047280 % % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% diff --git a/config_template.cfg b/config_template.cfg index 501d1f02d6a4..79757bb13a5c 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -264,13 +264,13 @@ BETA_FACTOR= 4.1 % ----------------------------- SOLID ZONE HEAT VARIABLES-----------------------% % % Thermal conductivity used for heat equation -SOLID_THERMAL_CONDUCTIVITY= 0.0 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0 % % Solids temperature at freestream conditions -SOLID_TEMPERATURE_INIT= 288.15 +FREESTREAM_TEMPERATURE= 288.15 % % Density used in solids -SOLID_DENSITY= 2710.0 +MATERIAL_DENSITY= 2710.0 % % ----------------------------- CL DRIVER DEFINITION ---------------------------% % @@ -383,7 +383,7 @@ MU_POLYCOEFFS= (0.0, 0.0, 0.0, 0.0, 0.0) CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 +THERMAL_CONDUCTIVITY_CONSTANT= 0.0257 % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 @@ -398,9 +398,7 @@ TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB % % Turbulent Prandtl number (0.9 (air) by default) PRANDTL_TURB= 0.90 - - - +% % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, ROTATING_FRAME, From fdb86628f00665efe5ba063ec85a8feb58285aa8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 15:21:30 +0200 Subject: [PATCH 23/39] Fix HeatTransfer_BC Jacobian for compressible solver. --- SU2_CFD/src/solvers/CNSSolver.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 119e251412b0..632d6b6ab0bc 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -446,7 +446,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi /*--- Jacobian, initialized to zero if needed. ---*/ su2double **Jacobian_i = nullptr; - if (dynamic_grid && implicit) { + if ((dynamic_grid || (kind_boundary == HEAT_TRANSFER)) && implicit) { Jacobian_i = new su2double* [nVar]; for (auto iVar = 0u; iVar < nVar; iVar++) Jacobian_i[iVar] = new su2double [nVar] (); @@ -535,7 +535,23 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi } if (kind_boundary == HEAT_TRANSFER){ - Jacobian.AddVal2Diag(iPoint, nDim+1, Transfer_Coefficient*Area); + + /*--- It is necessary to zero the jacobian entries of the energy equation. ---*/ + for (auto iVar = 0u; iVar < nVar; ++iVar) + Jacobian_i[nDim+1][iVar] = 0.0; + + const su2double Density = nodes->GetDensity(iPoint); + const su2double Gas_Constant = config->GetGas_ConstantND(); + const su2double Vel2 = GeometryToolbox::SquaredNorm(nDim, &nodes->GetPrimitive(iPoint)[1]); + const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); + + /*--- Equivalent to derivation in CNSSolver::BC_Isothermal_Wall_Generic, but no idea why that derivation is correct. ---*/ + Jacobian_i[nDim+1][0] = Transfer_Coefficient * dTdrho * Area; + + /*--- Take the definition of Temp for an ideal Gas, multiply with rho/rho and derive wrt to conservative variable (rho*E). ---*/ + Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * (Gamma-1.0)/(Gas_Constant*Density) * Area; + + Jacobian.AddBlock2Diag(iPoint, Jacobian_i); } for (auto iVar = 1u; iVar <= nDim; iVar++) { @@ -610,7 +626,7 @@ void CNSSolver::BC_Isothermal_Wall_Generic(CGeometry *geometry, CSolver **solver // Wall_Function = config->GetWallFunction_Treatment(Marker_Tag); // if (Wall_Function != WALL_FUNCTION::NONE) { -// SU2_MPI::Error("Wall function treament not implemented yet", CURRENT_FUNCTION); +// SU2_MPI::Error("Wall function treatment not implemented yet", CURRENT_FUNCTION); // } su2double **Jacobian_i = nullptr; From 33b03a1ef0eb9cb31be1277c7a9c9439acfa8de8 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 16:12:38 +0200 Subject: [PATCH 24/39] Add HT-BC to config_template --- config_template.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config_template.cfg b/config_template.cfg index 79757bb13a5c..ad73228b5868 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -732,6 +732,11 @@ MARKER_EULER= ( airfoil ) % Format: ( marker name, constant heat flux (J/m^2), ... ) MARKER_HEATFLUX= ( NONE ) % +% Navier-Stokes (no-slip), heat-transfer/convection wall marker(s) (NONE = no marker) +% Available for compressible and incompressible flow. +% Format: ( marker name, constant heat-transfer coefficient (J/(K*m^2)), constant reservoir Temperature (K) ... ) +MARKER_HEATTRANSFER= ( NONE ) +% % Navier-Stokes (no-slip), isothermal wall marker(s) (NONE = no marker) % Format: ( marker name, constant wall temperature (K), ... ) MARKER_ISOTHERMAL= ( NONE ) From 76a7a7ff761b17b7097cf7af05a666b4b93fafb4 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 16:18:06 +0200 Subject: [PATCH 25/39] Add inc Testcase for Heat Transfer BC. --- .github/workflows/regression.yml | 2 +- .../chtPinArray_2d/BC_HeatTransfer.cfg | 123 ++++++++++++++++++ TestCases/parallel_regression.py | 11 ++ 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3571cb9ca196..6585e88df939 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -88,7 +88,7 @@ jobs: uses: docker://su2code/test-su2:20200303 with: # -t -c - args: -b ${{github.ref}} -t feature_heatcoeff_BC -c develop -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t feature_heatcoeff_BC -c feature_heatcoeff_BC -s ${{matrix.testscript}} unit_tests: runs-on: ubuntu-latest name: Unit Tests diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg new file mode 100644 index 000000000000..7238fd4ae916 --- /dev/null +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg @@ -0,0 +1,123 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Heat Transfer BC Testcase with 2D-pin-setup % +% Author: T. Kattmann % +% Institution: Robert Bosch GmbH % +% Date: 2020.12.15 % +% File Version 7.1.1 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +% +KIND_TURB_MODEL= NONE +% +OBJECTIVE_FUNCTION= AVG_TEMPERATURE +OBJECTIVE_WEIGHT= 0.0 +% +OPT_OBJECTIVE= NONE +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= CONSTANT +INC_DENSITY_INIT= 1045.0 +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +INC_ENERGY_EQUATION = YES +INC_TEMPERATURE_INIT= 338.0 +INC_NONDIM= INITIAL_VALUES +SPECIFIC_HEAT_CP= 3540.0 +% +FREESTREAM_TURBULENCEINTENSITY= 0.05 +FREESTREAM_TURB2LAMVISCRATIO= 10.0 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 0.001385 +% +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Pr_lam = mu_lam [Pa*s] * c_p [J/(kg*K)] / lambda[W/(m*K)] +% = 1.385e-3 * 3540 / 0.42 +% = 11.7 +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +PRANDTL_LAM= 11.7 +% +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_SYM= ( fluid_symmetry ) +% +% Note that a heat-transfer coefficient of zero will result in an adiabatic wall, +% equivalent to MARKER_HEATFLUX= ( fluid_pin1_interface, 0.0, ... ). +% In the other extreme of a high heat-transfer coefficient value (like shown below), +% the boundary will degenerate to a MARKER_ISOTHERMAL= (fluid_pin1_interface, 400, ... ). +% With 400 above being the reservoir Temperature (or called Temperature at infinity). +MARKER_HEATTRANSFER= ( fluid_pin1_interface, 100000000.0, 400, \ + fluid_pin2_interface, 100000000.0, 400, \ + fluid_pin3_interface, 100000000.0, 400 ) +% +% Alternative options for non-periodic flow +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= ( fluid_inlet, 338.0, 0.3, 1.0, 0.0, 0.0 ) +% +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( fluid_outlet, 0.0 ) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_MONITORING= ( fluid_pin2_interface ) +% +MARKER_ANALYZE = ( fluid_pin2_interface ) +MARKER_ANALYZE_AVERAGE = AREA +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +ITER= 1000 +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1e3 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1e-15 +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= NONE +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -26 +CONV_STARTITER= 100000000 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= fluid.su2 +% +% SURFACE_STATIC_TEMPERATURE had to be removed from SCREEN_OUTPUT for the regression tests +SCREEN_OUTPUT= ( INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TEMPERATURE, TOTAL_HEATFLUX) +SCREEN_WRT_FREQ_INNER= 1 +% +HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) +% +OUTPUT_FILES=(PARAVIEW_MULTIBLOCK) +OUTPUT_WRT_FREQ= 100000 +VOLUME_OUTPUT= (SOLUTION, PRIMITIVE, RESIDUAL) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index db98e43c0d25..aa217a6952de 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -485,6 +485,17 @@ def main(): sp_pipeSlice_3d_dp_hf_tp.tol = 0.00001 test_list.append(sp_pipeSlice_3d_dp_hf_tp) + # 2D pin array with heat transfer BC on pin surfaces + inc_heatTransfer_BC = TestCase('inc_heatTransfer_BC') + inc_heatTransfer_BC.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" + inc_heatTransfer_BC.cfg_file = "BC_HeatTransfer.cfg" + inc_heatTransfer_BC.test_iter = 50 + inc_heatTransfer_BC.test_vals = [-8.242458, -7.340502, -7.407009, -0.152357, -1.6675e+03] #last 7 lines + inc_heatTransfer_BC.su2_exec = "mpirun -n 2 SU2_CFD" + inc_heatTransfer_BC.timeout = 1600 + inc_heatTransfer_BC.tol = 0.00001 + test_list.append(inc_heatTransfer_BC) + ############################ ### Incompressible RANS ### ############################ From 56bf77a3340b5307e9febbec8f9251d4d5349f04 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 16:28:14 +0200 Subject: [PATCH 26/39] fix typo for 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 6585e88df939..369753c0081c 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -88,7 +88,7 @@ jobs: uses: docker://su2code/test-su2:20200303 with: # -t -c - args: -b ${{github.ref}} -t feature_heatcoeff_BC -c feature_heatcoeff_BC -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t feature_heatcoeff_BC -c feature_heatcoeff_bc -s ${{matrix.testscript}} unit_tests: runs-on: ubuntu-latest name: Unit Tests From 8d6120157ff407e7b6949b83d0adfee500281ce8 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Fri, 30 Jul 2021 16:12:28 +0100 Subject: [PATCH 27/39] Apply suggestions from code review --- SU2_CFD/src/solvers/CNSSolver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 632d6b6ab0bc..6fabc45439fa 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -531,14 +531,14 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi if (implicit) { if (dynamic_grid) { - Jacobian.AddBlock2Diag(iPoint, Jacobian_i); } if (kind_boundary == HEAT_TRANSFER){ /*--- It is necessary to zero the jacobian entries of the energy equation. ---*/ - for (auto iVar = 0u; iVar < nVar; ++iVar) - Jacobian_i[nDim+1][iVar] = 0.0; + if (!dynamic_grid) + for (auto iVar = 0u; iVar < nVar; ++iVar) + Jacobian_i[nDim+1][iVar] = 0.0; const su2double Density = nodes->GetDensity(iPoint); const su2double Gas_Constant = config->GetGas_ConstantND(); @@ -551,8 +551,8 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi /*--- Take the definition of Temp for an ideal Gas, multiply with rho/rho and derive wrt to conservative variable (rho*E). ---*/ Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * (Gamma-1.0)/(Gas_Constant*Density) * Area; - Jacobian.AddBlock2Diag(iPoint, Jacobian_i); } + Jacobian.AddBlock2Diag(iPoint, Jacobian_i); for (auto iVar = 1u; iVar <= nDim; iVar++) { auto total_index = iPoint*nVar+iVar; From d282e2d36731ec091ec191b06e330ae7bc70a115 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Fri, 30 Jul 2021 16:15:42 +0100 Subject: [PATCH 28/39] Apply suggestions from code review --- SU2_CFD/src/solvers/CNSSolver.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 6fabc45439fa..d6181b495189 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -530,9 +530,6 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi And add the contributions to the Jacobian due to energy. ---*/ if (implicit) { - if (dynamic_grid) { - } - if (kind_boundary == HEAT_TRANSFER){ /*--- It is necessary to zero the jacobian entries of the energy equation. ---*/ @@ -552,7 +549,9 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * (Gamma-1.0)/(Gas_Constant*Density) * Area; } - Jacobian.AddBlock2Diag(iPoint, Jacobian_i); + if (dynamic_grid || (kind_boundary == HEAT_TRANSFER)) { + Jacobian.AddBlock2Diag(iPoint, Jacobian_i); + } for (auto iVar = 1u; iVar <= nDim; iVar++) { auto total_index = iPoint*nVar+iVar; From df2a720ef11e13eb5ece34b41cae46eadec420c6 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Fri, 30 Jul 2021 16:17:40 +0100 Subject: [PATCH 29/39] Update SU2_CFD/src/solvers/CNSSolver.cpp --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index d6181b495189..b2d1024868cb 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -543,7 +543,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); /*--- Equivalent to derivation in CNSSolver::BC_Isothermal_Wall_Generic, but no idea why that derivation is correct. ---*/ - Jacobian_i[nDim+1][0] = Transfer_Coefficient * dTdrho * Area; + Jacobian_i[nDim+1][0] += Transfer_Coefficient * dTdrho * Area; /*--- Take the definition of Temp for an ideal Gas, multiply with rho/rho and derive wrt to conservative variable (rho*E). ---*/ Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * (Gamma-1.0)/(Gas_Constant*Density) * Area; From 7cef26edcf0467375de5833e0a2ee83dfbdd4d2c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 20:01:23 +0200 Subject: [PATCH 30/39] Update jacobians (and explanation) for Heattransfer BC. --- SU2_CFD/src/solvers/CNSSolver.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index b2d1024868cb..73551a278fe8 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -541,12 +541,16 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi const su2double Gas_Constant = config->GetGas_ConstantND(); const su2double Vel2 = GeometryToolbox::SquaredNorm(nDim, &nodes->GetPrimitive(iPoint)[1]); const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); + const su2double dTdrhoe = (Gamma-1.0)/(Gas_Constant*Density); - /*--- Equivalent to derivation in CNSSolver::BC_Isothermal_Wall_Generic, but no idea why that derivation is correct. ---*/ + /*--- Total specific energy: e=c_v*T+1/2*v^2 => T=1/c_v(rho*e/rho - 1/2||rho v||^2/rho^2). + Together with cv=R/(gamma-1) the following Jacobian contributions for the energy equation can be derived. ---*/ Jacobian_i[nDim+1][0] += Transfer_Coefficient * dTdrho * Area; - /*--- Take the definition of Temp for an ideal Gas, multiply with rho/rho and derive wrt to conservative variable (rho*E). ---*/ - Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * (Gamma-1.0)/(Gas_Constant*Density) * Area; + for (unsigned short iVar = 1; iVar < nVar-1; iVar++) + Jacobian_i[nDim+1][iVar] -= Transfer_Coefficient * dTdrhoe*nodes->GetVelocity(iPoint, iVar-1) * Area; + + Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * dTdrhoe * Area; } if (dynamic_grid || (kind_boundary == HEAT_TRANSFER)) { From 1237cb1d61b1e9b4d22ed8987fe24a0e62d71cf9 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 20:12:46 +0200 Subject: [PATCH 31/39] That's why they pay me the small bucks :( --- SU2_CFD/src/solvers/CNSSolver.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 73551a278fe8..cd5d0174122d 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -547,9 +547,6 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi Together with cv=R/(gamma-1) the following Jacobian contributions for the energy equation can be derived. ---*/ Jacobian_i[nDim+1][0] += Transfer_Coefficient * dTdrho * Area; - for (unsigned short iVar = 1; iVar < nVar-1; iVar++) - Jacobian_i[nDim+1][iVar] -= Transfer_Coefficient * dTdrhoe*nodes->GetVelocity(iPoint, iVar-1) * Area; - Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * dTdrhoe * Area; } From 417c6230d35eeb51d51091d17268056a146ec920 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:39:19 +0200 Subject: [PATCH 32/39] Update SU2_CFD/src/solvers/CNSSolver.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index cd5d0174122d..f7c494381f93 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -538,7 +538,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi Jacobian_i[nDim+1][iVar] = 0.0; const su2double Density = nodes->GetDensity(iPoint); - const su2double Gas_Constant = config->GetGas_ConstantND(); + const su2double oneOnCv = (Gamma - 1.0) / config->GetGas_ConstantND(); const su2double Vel2 = GeometryToolbox::SquaredNorm(nDim, &nodes->GetPrimitive(iPoint)[1]); const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); const su2double dTdrhoe = (Gamma-1.0)/(Gas_Constant*Density); From a00a68e0e68c801d1bc47bea4241e286c750d3a2 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:40:02 +0200 Subject: [PATCH 33/39] Update SU2_CFD/src/solvers/CNSSolver.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index f7c494381f93..9aeb1193e280 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -539,7 +539,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi const su2double Density = nodes->GetDensity(iPoint); const su2double oneOnCv = (Gamma - 1.0) / config->GetGas_ConstantND(); - const su2double Vel2 = GeometryToolbox::SquaredNorm(nDim, &nodes->GetPrimitive(iPoint)[1]); + const su2double Vel2 = nodes->GetVelocity2(iPoint); const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); const su2double dTdrhoe = (Gamma-1.0)/(Gas_Constant*Density); From 6743704435f659476f066b9f3acd73ba30ce6199 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:40:25 +0200 Subject: [PATCH 34/39] Update SU2_CFD/src/solvers/CNSSolver.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 9aeb1193e280..8210ed60d717 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -540,7 +540,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi const su2double Density = nodes->GetDensity(iPoint); const su2double oneOnCv = (Gamma - 1.0) / config->GetGas_ConstantND(); const su2double Vel2 = nodes->GetVelocity2(iPoint); - const su2double dTdrho = 1.0/Density * ( -Tinfinity + (Gamma-1.0)/Gas_Constant*(Vel2/2.0) ); + const su2double dTdrho = oneOnRho * ( -Tinfinity + oneOnCv * 0.5 * Vel2); const su2double dTdrhoe = (Gamma-1.0)/(Gas_Constant*Density); /*--- Total specific energy: e=c_v*T+1/2*v^2 => T=1/c_v(rho*e/rho - 1/2||rho v||^2/rho^2). From 6d07913edab362a933a35fd69b8a9251f69024aa Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:40:49 +0200 Subject: [PATCH 35/39] Update SU2_CFD/src/solvers/CNSSolver.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 8210ed60d717..7496209926f9 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -537,7 +537,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi for (auto iVar = 0u; iVar < nVar; ++iVar) Jacobian_i[nDim+1][iVar] = 0.0; - const su2double Density = nodes->GetDensity(iPoint); + const su2double oneOnRho = 1.0 / nodes->GetDensity(iPoint); const su2double oneOnCv = (Gamma - 1.0) / config->GetGas_ConstantND(); const su2double Vel2 = nodes->GetVelocity2(iPoint); const su2double dTdrho = oneOnRho * ( -Tinfinity + oneOnCv * 0.5 * Vel2); From 063ab9e7608ddf6e041d13b7d216ecbd554b19c7 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:41:08 +0200 Subject: [PATCH 36/39] Update SU2_CFD/src/solvers/CNSSolver.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 7496209926f9..dc2611c85346 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -541,7 +541,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi const su2double oneOnCv = (Gamma - 1.0) / config->GetGas_ConstantND(); const su2double Vel2 = nodes->GetVelocity2(iPoint); const su2double dTdrho = oneOnRho * ( -Tinfinity + oneOnCv * 0.5 * Vel2); - const su2double dTdrhoe = (Gamma-1.0)/(Gas_Constant*Density); + const su2double dTdrhoe = oneOnCv * oneOnRho; /*--- Total specific energy: e=c_v*T+1/2*v^2 => T=1/c_v(rho*e/rho - 1/2||rho v||^2/rho^2). Together with cv=R/(gamma-1) the following Jacobian contributions for the energy equation can be derived. ---*/ From 575be82a936487ff273d9051799de60f94bf9893 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 22:32:56 +0200 Subject: [PATCH 37/39] Re-add Jacobians for HeatTransfer BC with moving walls. --- SU2_CFD/src/solvers/CNSSolver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index dc2611c85346..056e0c478241 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -547,6 +547,9 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry *geometry, const CConfi Together with cv=R/(gamma-1) the following Jacobian contributions for the energy equation can be derived. ---*/ Jacobian_i[nDim+1][0] += Transfer_Coefficient * dTdrho * Area; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Jacobian_i[nDim+1][iDim+1] -= Transfer_Coefficient * dTdrhoe * nodes->GetVelocity(iPoint, iDim) * Area; + Jacobian_i[nDim+1][nDim+1] += Transfer_Coefficient * dTdrhoe * Area; } From 6aea1c9d0fb91801f4e05d03542845e0c25b9f3a Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 30 Jul 2021 22:43:46 +0200 Subject: [PATCH 38/39] Make GetSolution(...,0) to fresher GetTemperature(...) calls. --- SU2_CFD/src/solvers/CHeatSolver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index c7632f0fa52e..b7a6b6724532 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -596,7 +596,7 @@ void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_conta dist_ij += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); dist_ij = sqrt(dist_ij); - dTdn = -(nodes->GetSolution(Point_Normal,0) - Twall)/dist_ij; + dTdn = -(nodes->GetTemperature(Point_Normal) - Twall)/dist_ij; Res_Visc[0] = thermal_diffusivity*dTdn*Area; @@ -937,7 +937,7 @@ void CHeatSolver::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container, C for (auto iDim = 0u; iDim < nDim; iDim++) dist += (Coord_Normal[iDim]-Coord[iDim])*(Coord_Normal[iDim]-Coord[iDim]); dist = sqrt(dist); - dTdn = (Twall - nodes->GetSolution(iPointNormal,0))/dist; + dTdn = (Twall - nodes->GetTemperature(iPointNormal))/dist; HeatFlux[iMarker][iVertex] = thermal_diffusivity*dTdn*config->GetHeat_Flux_Ref(); From 1ef7dcf60c7b2a58cb91985234fc9e1073f0cffa Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 31 Jul 2021 15:48:39 +0200 Subject: [PATCH 39/39] Revert regression.yml --- .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 369753c0081c..e03822a909cb 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -88,7 +88,7 @@ jobs: uses: docker://su2code/test-su2:20200303 with: # -t -c - args: -b ${{github.ref}} -t feature_heatcoeff_BC -c feature_heatcoeff_bc -s ${{matrix.testscript}} + args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} unit_tests: runs-on: ubuntu-latest name: Unit Tests